Wednesday 21 September 2011

How do I figure out what CSS tags are applying to what parts of my page?

This is related to this question I asked a bit ago. http://answers.yahoo.com/question/index;鈥?/a>



I've tried that code (basically that is what I thought I should do before I even asked but was just confirming, but it's not changing the font I want, as far as I can tell it's not changing anything on the site). So my general question is how do you know what tags are applying to what?How do I figure out what CSS tags are applying to what parts of my page?to answer you 1st question, use this but change the color to what ever you want:



.module h3 {color: red}



second question, how:



1) remember a text you want to change. in you case is 'Tucson Tabernacle'



2) right click then select 'view source'. your notepad should popout showing your source code.



3) scroll down till you see the body tag - %26lt;body%26gt;



4) hit Ctrl+F. this will bring up a box named Find. in the text box, type the word you are targeting. this case 'Tucson Tabernacle'



5) click 'find next', and it will find the text you typed in. once you see it you will also see that there is %26lt;h3%26gt; to the left of it.

thats called a tag - specifically a level 3 header tag.



you can use that to style the text you want by doing:



h3 {color:what_color_you like}



h3 alone will change all occurence of the h3 tag in the page. if you look above, you will see 3 %26lt;div%26gt; and one %26lt;div class=%26quot;module%26quot;%26gt;. the class is for css specificity and is used to limit the 'scope' of the styling to that object and its contents.



class is denoted with a period[ . ] in css

id with a pound [#]



if you look further up you will see %26lt;td id=%26quot;navigation%26quot;%26gt;



#navigation h3 {color:what_color}





will do that same



so basically there are several ways of doing what you want
How do I figure out what CSS tags are applying to what parts of my page?
Look at the area in question - the text you want to change and see if there are any classes that apply to it or id's that apply. If not, look at the tag itself in the stylesheet (is it an H4, for example) or see if it is enclosed in a DIV with a class or ID assigned to it.



If you want to post a URL I'd be glad to take a look at it and try to help.



Joyce

http://www.DesignByJoyce.com/
How do I figure out what CSS tags are applying to what parts of my page?
The class the links are using is a.mainLevel. You need to change the font color in that, not in the div that contains the links. Links don't inherit their style from the surrounding container.