Jump to content
xisto Community
Sign in to follow this  
magiccode91405241511

Style P And H? Html Tags

Recommended Posts

Well, I have found that css was very hard to predict and precise control their apperance.When mix and use the p and h? tags. Their apperaence were not identity.Place the h? tags within the p tag causes style error on both firefox and IE.So, anyone should do it reserved, instead, place the p tag with any h? tags will do the jobs on both browsers.Still learning it coz it much varies when doing styles.Tested it on XHTML 1.0 Strict

Share this post


Link to post
Share on other sites

I did not understand your post quite well. I think what you are trying to say is this:

 

This is valid:

<h1> some text </h1>
<p>some text</p>

 

This is also valid:

<p>some text</p>
<h2>some heading</h2>

 

This is not valid ([X]HTML error) and redundant:

<h1><p>Some text</p></h1>

 

This is not valid:

<p><h4>Some text</h4></p>

 

By using valid XHTML Strict and CSS that isn't too fancy (syntax-wise, not appearance), you can be sure it is fairly consistent with most browsers (IE, Firefox, Opera, Safari), with some minor issues IE.

 

(e.g. Do not use "fancy" things like table[summary^=Employee Info] because they won't be properly read in IE most likely.)

Edited by FirefoxRocks (see edit history)

Share this post


Link to post
Share on other sites

Yep, you really shouldn't mix P tags with header tags. One is essentially like the other, only Header tags will format the text differently.You can customize how the text looks in those types of tags using CSS. So if you want a H2 tag to be 12px, and a H1 tag to be 16px, you can just do that in a style sheet, and it will automatically apply those styles whenever you use those tags. Saves the trouble of updating individual sections of code if you need to change something, as you will only need to change the style sheet, and it will automatically update whichever page is using that stylesheet!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.