|
| |
|
|
Starhugger
Posts: 631 Joined: 4/12/2005 From: Canada Status: offline
|
How do they do this? - 2/10/2008 23:55:29
I'm blaming Caz for encouraging me to create CSS templates for my site, when I should be doing other things. In the process of looking for inspiration and wisdom, I was browsing through CSS Zen Garden and saw a theme that has sections with graduated colour from top to bottom. Each section seems to have a repeating background that uses a slivered GIF slice that is repeated x-wise. The GIF has the graduation of colour. Fine. No problem. The mystery is that when I increase or decrease the font size, making each section longer or shorter, vertically, the graduation of colour also stretches and contracts with it -- consistently! So how does a fixed length graphic get stretched when the font increases? (I isolated the graphic with small fonts and large ones, and the background graphic is the same.) I'm using Firefox, which can adjust the font size for virtually any web page (except Flash). Could it be something that done in Firefox itself? Usually, when I adjust the font size against fixed-size backgrounds, the fonts will just overflow the visual container, so this really surprised me. I looked at it in IE7 and it doesn't have the kind of font definition that IE7 knows how to adjust, so I can't really test it there. I'm just very curious how they do that (or what is doing that). Here's the link to the page. Maybe someone else can figure out what kind of smoke and mirrors are being used. Starhugger
|
|
|
|
Starhugger
Posts: 631 Joined: 4/12/2005 From: Canada Status: offline
|
RE: How do they do this? - 2/11/2008 2:51:18
Fascinating! So it's not actually expanding the gradient itself; it's just expanding the background colour below the gradient graphic, and the colour matches the darkest bottom edge of the gradient. It makes the eye think it's expanding the gradient too, when it's not. It's interesting too that when you shrink the font down to microscopic, the size of the Div still shrinks with it to less than the height of the gradient GIF, but it seems to hide any overhang at the bottom of the GIF. So you still get the subtle colour difference; it's just not quite as dark at the bottom. But now I'm not quite sure how they do that either. Is that the default behaviour when you have a graphic declared in a background CSS statement (rather than positioning the graphic itself), where it will only show the area of the GIF that matches the Div's size and then ignores the rest? I expected there to be an "overflow: hidden" statement or something, but I don't see it. Is that necessary only when it's an actual object in the HTML, but not if it's part of the CSS styling? Thanks Tailslide! SH
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|