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?

Edited by yandoo
Link to comment
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.

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.