Giraffes can eat grass when they want too or need too.
However grass is pretty low on a list of foods that Giraffes eat.
Most Giraffes rarely eat much grass but they do sometimes eat grass.
Giraffes mostly prefer to eat foods such as leaves, buds and shrubs on trees that are high up in the air because it's easier for the Giraffe to reach those foods that are above them because the Giraffes neck is so long.
But if Giraffes want to or need to eat some grass they can do so.
I have seen a few Giraffes reach down and eat grass from the ground so they do sometimes eat grass.
Most Giraffes though I've seen will prefer to eat the other things above them.