As I work on incorporating stylistic text inside rounded divs, I encounter a challenge where the text touches the top of the container. While I have successfully managed to customize various content elements such as nested divs and background images, this particular issue has proven to be quite troublesome.
The traditional method of using image borders or cover-ups is not feasible due to our dynamic graphical backgrounds. What we need is a solution that can truly clip the text.
This problem is most noticeable in earlier versions of Chrome and Firefox 3.x.
If you'd like to experiment, here is the sample code:
div {
-moz-border-radius: 45px;
border-radius: 45px;
background-color: #ccc;
font-size: 100px;
color: #777;
line-height: 70%;
overflow: hidden;
width: 257px;
}
The glitch:
Note that this issue has been resolved in newer versions of Chrome and Firefox 4 - the relief:
Given that a majority of our site users are still on Firefox 3.6, it would be great to find an elegant solution for them as well. Any assistance would be greatly appreciated! Thanks