# How to make a box with grey color background using fbox in latex

how to make a box with grey color background using fbox in latex?

I have the following code but have no idea how to change the background into grey color.

\fbox{$\phantom{\num{665}}$}


Appreciate for any help

• \colorbox{grey}{$\phantom{\num{665}}$} should do the trick. – Bernard Sep 23 '19 at 9:31
• Hi Bernard, for some reason your suggestion not working, I dont know where I do wrong – polosepian Sep 23 '19 at 9:45
• Maybe something conflicting in the rest of your code? Is \num defined? – Bernard Sep 23 '19 at 9:54
• I got the following error: Undefined contol sequence – polosepian Sep 23 '19 at 10:02

Please try with \colorbox{gray!50}{\hbox to 5pc{\vbox to 5pc{}}}
Please try with \fcolorbox{black}{gray!50}{\hbox to 5pc{\vbox to 5pc{}}}
• Border color means you need to get the outer rule color ? Please confirm if my understanding is correct... – MadyYuvi Sep 23 '19 at 10:08
• Its my pleasure to help... Please read the link en.wikibooks.org/wiki/LaTeX/Boxes#colorbox_and_fcolorbox about more possible boxes in LaTeX – MadyYuvi Sep 23 '19 at 10:29