Jump to content

Text outside of a tag


Sikroth
 Share

Recommended Posts

Hello everybody; I have a quick question: Is it possible (and by possible I mean valid and correct) to place some text without a container tag? For example this code (assuming header is well written, etc).

<body>  	<p>This text is inside a paragraph and is valid</p>  	This text is placed directly on the body. Is it valid?  </body>

Would it be valid XHTML? Thanks in advance, and sorry if my english is bad!

Link to comment
Share on other sites

It depends on <doctype!> used, Transitional doctype would be fine, Strict would throw a invalid warning stating it should be within a block element container as in <p> or <div>, BUT not! inline element as <span>, <strong> or <em>.
Okay, that's what I thought. I had a bit of a discussion with a friend about the subject, because he usually works with transitional XHTML and therefore had no problems with text directly on the body, but I told him to always place it inside a paragraph :P. Thank you!
.... and your english is perfect!!
Thanks! It's good to know :D
Link to comment
Share on other sites

I had a bit of a discussion with a friend about the subject, because he usually works with transitional XHTML
I think you already win the argument right there...
Is it possible (and by possible I mean valid and correct)
Transitional should not be used for any new development, it was only included to help out older sites that were long past their prime but still wanted to validate. Transitional in this cases implies transitioning from no DTD to a Strict DTD. Edited by thescientist
Link to comment
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
 Share

×
×
  • Create New...