HighDots Forums  

div inside a p

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss div inside a p in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jeff Thies
 
Posts: n/a

Default div inside a p - 09-08-2003 , 03:12 AM






I have this in IE5 windows:

<p style="color: red">
<div>This is not red</div>
and this is red
</p>

Why is that? Are divs never allowed inside paragraphs?

Jeff

Reply With Quote
  #2  
Old   
David Dorward
 
Posts: n/a

Default Re: div inside a p - 09-08-2003 , 03:58 AM






Jeff Thies wrote:

Quote:
Why is that? Are divs never allowed inside paragraphs?
http://validator.w3.org/ is your friend.

But - yes. Paragraphs can only hold inline content.

--
David Dorward http://dorward.me.uk/


Reply With Quote
  #3  
Old   
Matthias Gutfeldt
 
Posts: n/a

Default Re: div inside a p - 09-08-2003 , 10:00 AM



Jeff Thies wrote:
Quote:
I have this in IE5 windows:

p style="color: red"
div>This is not red</div
and this is red
/p

Why is that? Are divs never allowed inside paragraphs?
Never - well, never if you're using W3C HTML. There might be other HTML
versions that allow it :-).


Matthias



Reply With Quote
  #4  
Old   
Thomas Scholz
 
Posts: n/a

Default Re: div inside a p - 09-08-2003 , 11:51 AM



David Dorward gestand:

Quote:
Jeff Thies wrote:

Why is that? Are divs never allowed inside paragraphs?

But - yes. Paragraphs can only hold inline content.
<p><object><div>Hello World!</div></object></p>

:-)

Thomas


Reply With Quote
  #5  
Old   
David Dorward
 
Posts: n/a

Default Re: div inside a p - 09-08-2003 , 05:02 PM



Jeff Thies wrote:

Quote:
Thanks, I stumbled across this at the W3C just now:

FORM action="http://somesite.com/prog/adduser" method="post"
P
First name: <INPUT type="text" name="firstname"><BR
....
/P
/FORM

Which oddly enough is almost exactly what I was trying to do. But
without the zig zag alignment. Looks like I'll have to do this with divs
instead.
Probably better with <label>, <fieldset>, <legend> and some CSS. Have a look
at the contact form on my site (see sig) for an example.

--
David Dorward http://dorward.me.uk/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.