Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When highlighting text using Style and Background, as in Style["Test ", White, Background -> Lighter@Blue] is there a way to pad (ie, enlarge) the bounding box?

The bottom of the background seems coincident with the base of the text: here

share|improve this question
up vote 3 down vote accepted
Style[Pane[" Test "], White, Background -> Lighter@Blue]

enter image description here


Controlling the padding:

Style[Pane[" Test ", ImageMargins -> 10], White,  Background -> Lighter@Blue]
share|improve this answer
Ok that works. But is there no way to parametrically control size? (Other than rendering an independent Rectangle) – alancalvitti Jul 21 '12 at 19:22
@alancalvitti Add that request to the question. I tried to answer it in its current state – Dr. belisarius Jul 21 '12 at 19:23
@alancalvitti See edit – Dr. belisarius Jul 21 '12 at 19:25

You could play with the FrameMargins ...

Framed[Style["Test", White], FrameStyle -> None, FrameMargins -> 2, 
 Background -> Lighter@Blue] 


share|improve this answer
Thank you, so Framed it is. – alancalvitti Jul 21 '12 at 19:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.