[BNM] Couple of quick html/css/DWT questions

Joe Aliferis joe at newforms.co.uk
Tue Jan 15 12:34:55 GMT 2008


use a class and an id combined ?

class contains generic stuff

id has specific changes for that block

.myClass,
.myClass a {
background-image: url(myimage.gif);
background-repeat: no-repeat
background-position: 10px 10px;
}

#name.myClass a:hover {
background-position: 20px 10px;

}

<div class="myClass" id="name"></div>


Joe







paul perrin wrote:
> Thanks Joe,
>
> Almost - but I just wanted to change the vertical position so I can use a
> single class for all the hovers rather than having to code them all one by
> one(!).
>
> A bit more info -- it is a menu with roll overs - I fancied having the
> entire menu as a single png - top half  'selected' images, bottom half
> 'unselected' - then all the specific positioning can be done in just one
> place (against each buttons anchor tag), the roll over just setting the
> vertical offset to 0... Then changng the height/width or anything about the
> menu just needs to be updated in one place.
>
> .myClass a:hover {
> background-position: <dont change> 0px;
> }
>
> Regards
>
> Paul
>
> On 15/01/2008, Joe Aliferis <joe at newforms.co.uk> wrote:
>   
>> 1 = yes
>>
>> .myClass,
>> .myClass a {
>> background-image: url(myimage.gif);
>> background-repeat: no-repeat
>> background-position: 10px 10px;
>> }
>>
>> .myClass a:hover {
>> background-position: 20px 10px;
>> }
>>
>> -----------------------------------------------------
>>
>> <div class="myClass"><a href="Javascript:;">myLink</a></div>
>>
>>
>> Joe
>>
>>
>>
>> paul perrin wrote:
>>     
>>> Hi
>>>
>>> For anyone with a minute to spare...
>>>
>>> 1) Is there a neat (non-javascript) way of changing the y position of a
>>>       
>> css
>>     
>>> background image without changing the x (I just want the image to move
>>> up/down, leaving the sideways pos where it is)
>>>
>>> 2) When using a dynamic web template, is there a way to make a link
>>>       
>> relative
>>     
>>> to the location of the actual pages rather than the template? e.g. to
>>>       
>> allow
>>     
>>> a single template to be used, and to pick up images from which ever
>>> directory the final page is located in? (where the final page is HTML -
>>>       
>> so
>>     
>>> no server side stuff).
>>>
>>>
>>> Cheers!
>>>
>>> Paul /)/+)
>>>
>>>       
>> --
>>
>> BNM Subscribe/Unsubscribe:
>> http://www.brightonnewmedia.org/options/bnmlist
>>
>> Archive Search - http://icanhaz.com/bnmarchive
>>
>> BNM powered by Wessex Networks:
>> http://www.wessexnetworks.com
>>
>>     


More information about the BNMlist mailing list. Powered by Wessex Networks