Jump to content

<h2> tag properties are different


yandoo

Recommended Posts

Hiya I have an <h2> tag that I have added added a class too. <h2 class="TitleText"> But when i look at it compared to a <p class> in a browser it looks different in font, although they do have the same size and colour properties? Why is this please?

 

.TitleText { font-family:Arial, Helvetica, sans-serif; font-size:22px; color:#669900;TEXT-DECORATION: none;}

 

So I guess its because it is a heading and not a paragraph tag but why can i not fully control how it looks?

Link to comment
https://forums.phpfreaks.com/topic/272942-tag-properties-are-different/
Share on other sites

I'm willing to bet that there are some default browser styles you haven't overwritten. Most likely font-weight.

Open the page in your fav browser with developer tools (Opera, Chrome or Firefox with Firebug), and then check the computer CSS styles for both elements. Should spot the difference right away.

Hiya, thanks for reply. Yes of course the weight properties! I feel silly now it seems so obvious.

 

Can i ask you something else that too may seem silly..? How can I adjust the spacing above and below the heading? With the h1 it seems to add space both above and below it as its a heading...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.