FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

css ul li a. is this possible?

 


yo.hassan
#holycow [list-type:none; margin:2; padding:2; border-top:solid 1px #333; ] the above css can markup like this..? <ul id="holycow"><li id="holycow"><a href="#">it works?</a> can this be done? One more thing.. Can i assign anchor rule for <h1> like h1 a (rules here)? Note.. '(' means curly brace. Writing from my phone and it doesn't have that character.
AftershockVibe
Yes, if I'm reading what you are looking for correctly then it certainly is possible. However, since IDs should be unique you should use classes instead of IDs to apply the styles:

Code:
.holycow {list-type:none; margin:2; padding:2; border-top:solid 1px #333; }

Applies to:
Code:
<ul class="holycow">


Also, yes you can do exactly what you wrote as your second question;
Code:
h1 a {color: #00FF00;}

That will make any <a> tag within a <h1> element green.

You can even extend that and go for something like the following:
Code:
#MyContent h3.minHeader span
{
   color: #FF0000;
}


That will make the text within any <span> element with the id "MyContent" which is also within a <h3> element of the "minHeader" class.
yo.hassan
thanks. i guess i am getting to intermediate level of css with help from u guys in this forum. thanks again
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.