Spinal
MB Enthusiast
- Joined
- Sep 14, 2004
- Messages
- 4,806
- Location
- between Uxbridge and the Alps
- Car
- x254, G350, Duster, S320, Mach1, 900ss and a few more
I have a strange question...
I'm working on a new site to keep track of all the weird and wonderful trips I do, and I saw a neat trick on another site... but I'm having trouble achieving the same effect.
If you look at this page:
The Journal | Overland Journal
(or pretty much any page on that site)
on the left hand side there is a menu, done almost entirely with CSS - there is no javascript involved, which is what I'm trying to get to.
The issue is; when I try something similar, my background image (which essentially is a black .png with rounded edges) doesn't get resized.
If you mouseover (or hover to use CSS appropriate jargon) you'll notice that the black .png is resized to fit the length of the text...
and I can't figure out how to do that. I tried cheating, and looking at their source code, but I can't see any attributes on the background option that resizes the image...
Any ideas?
TIA,
M.
EDIT: Forgot my source code!
I'm working on a new site to keep track of all the weird and wonderful trips I do, and I saw a neat trick on another site... but I'm having trouble achieving the same effect.
If you look at this page:
The Journal | Overland Journal
(or pretty much any page on that site)
on the left hand side there is a menu, done almost entirely with CSS - there is no javascript involved, which is what I'm trying to get to.
The issue is; when I try something similar, my background image (which essentially is a black .png with rounded edges) doesn't get resized.
If you mouseover (or hover to use CSS appropriate jargon) you'll notice that the black .png is resized to fit the length of the text...
and I can't figure out how to do that. I tried cheating, and looking at their source code, but I can't see any attributes on the background option that resizes the image...
Any ideas?
TIA,
M.
EDIT: Forgot my source code!
Code:
.test1:hover span {
background:url(../images/roundedbox.png) center top no-repeat;
color:#ffffff;
}
Code:
<td class="test1"><span>Link 5</span></td>
Last edited: