Welcome to WebmasterWorld Guest from 54.162.226.212

Forum Moderators: not2easy

Message Too Old, No Replies

Assign more than 1 attribute a CSS

depending on where located in page

     
1:55 pm on Jul 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello

In an attempt to avoid having tables for a menu on the left of a page I wish to use the "diplay: Block;" and assign it to the "a's" so that all the <a href>'s can just be inserted and the CSS will scroll them down the page. I have managed to figure out how to do this but it assigns this attribute to the whole page and not just the 1 <TD> I am dealing with. Can I assign more than one type.

This is the successful code:

a {

font-family: "Times New Roman", Times, serif;
font-size: medium;
display: block;
color: #0099CC;

}

Cheers in advance.

2:08 pm on Jul 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry to answer my own post:

Figured it out.

Assign an id="name" to the element and then call the class you are after class="menu"

a {

font-family: "Times New Roman", Times, serif;
font-size: medium;
display: block;
color: #0099CC;

}

#menu a {

font-family: "Times New Roman", Times, serif;
font-size: medium;
display: block;
color: #000000;

}

3:30 pm on Jul 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ukgimp -

Give this thread a once over too if you haven't already:

[webmasterworld.com...]

Great methods for organizing your classes/ids and style sheets.

3:46 pm on Jul 26, 2002 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



They should also be in there own div which I guess #menu is right?

then you can assign classes to the a's like this:

a.mainCat:hover {
backrgound-color: blue;
}
a.subCat {
background-color: green;
}

Nick

 

Featured Threads

Hot Threads This Week

Hot Threads This Month