Jump to content

Text outside of a tag


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 post
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 post
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 post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...