css style quetion -question, too lol

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

css style quetion -question, too lol

Post by Ruth »

Just out of curiousity I was wondering if there's a way to code in a menu item the norepeat for the bgimage? The thought just came up by a question someone asked about 'stretching' an image instead of having it repeat if a menu item wrapped [which this person seemed to want] when it went wider than the set size of the menu [which they also wanted], so I was just curious if that's possible to do and set the image to be always center?

Ruth
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Ruth,

I suppose you could use the offclass menu item property. Define a style like so

Code: Select all

.menuBG {
background-repeat:no-repeat;
background-position:50% 50%;
}
The background-repeat setting would cause no repeating, and the background-position would center the image within the item. Define the bgimage property in the menu style, and define the menu item like so:

Code: Select all

aI("text=whatever;url=whatever.htm;offclass=menuBG;");
...similarly for onclass and overbgimage.

That should take care of the no-repeat and centering concern... don't know about "stretching" the image though. I'm not aware of a css background property that does that, but then, I'm not very conversant with css. Might have to think on it some more.

Kevin
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Thanks Kevin..it's something good to know, never know when it might come in handy...wonder if you can use off/onclass for just one menu item, though instead of having to use it in the full menu style?

Ruth
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

innkeeper9 wrote:...wonder if you can use off/onclass for just one menu item, though instead of having to use it in the full menu style?
Yes, you can. They can be used as style properties or as [urlhttp://milonic.com/itemproperties.php]menu item properties[/url].

Cheers,

Kevin
Post Reply