473,395 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

div inside a p

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
Jul 20 '05 #1
6 14858
Jeff Thies wrote:
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/
Jul 20 '05 #2
Jeff Thies wrote:
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

Jul 20 '05 #3
David Dorward gestand:
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
Jul 20 '05 #4
David Dorward gestand:
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
Jul 20 '05 #5
Jeff Thies wrote:
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/
Jul 20 '05 #6
Jeff Thies wrote:
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/
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nick Coghlan | last post by:
Anyone playing with the CPython interpreter's new command line switch might have noticed that it only works with top-level modules (i.e. scripts that are directly on sys.path). If the script is...
15
by: Nick Coghlan | last post by:
Python 2.4's -m command line switch only works for modules directly on sys.path. Trying to use it with modules inside packages will fail with a "Module not found" error. This PEP aims to fix that...
9
by: sathya | last post by:
I was going through an Boyer-Moore-Horspool pattern match, I saw a array inside a array, like the below, skip ] = patlen - i - 1; The array is decleared as int skip; unsigned char *pat;
0
by: Severino | last post by:
Hi all, we have developed a .NET component for use inside Windows Forms: this component has been written using VC++.NET (2003) and is working perfectly when inserted inside VC#.NET or VB.NET...
0
by: Severino | last post by:
Hi all, we have developed a .NET component for use inside Windows Forms: this component has been written using VC++.NET (2003) and is working perfectly when inserted inside VC#.NET or VB.NET...
0
by: Les Caudle | last post by:
I have a menu system composed of a DataList nested inside a DataList. The outer DataList has it's DataSource (composed of a DataSet with two tables linked by a CategoryPagesRelation Relation) set...
1
by: Matik | last post by:
Hi to all, Probably I'm just doing something stupid, but I would like you to tell me that (if it is so), and point the solution. There ist the thing: I' having a sp, where I call other sp...
4
by: Rares Vernica | last post by:
Hi, How can I save a reference inside a container? For example I have: map<string, unsignedX; I would like to be able to save a reference to a position inside X. For a vector, the...
5
by: Test | last post by:
Is it possibel to have DIV's inside a table cell so that their position can be given relative to top left corner of the cell. Now the DIVs seem to position themselves relative to previous object.
14
by: raylopez99 | last post by:
KeyDown won't work KeyPress fails KeyDown not seen inspired by a poster here:http://tinyurl.com/62d97l I found some interesting stuff, which I reproduce below for newbies like me. The main...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.