473,508 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using paragraphs within CSS box -- why not?

Joe
Hello,

The code below is an entire HTML page that has a problem when using a
<p> tag inside a CSS box (when running IE6). I was being a good boy
and I replaced my single-cell <table> elements with these CSS boxes.
However, I can't use <p> formatting within the a CSS box. The nested
paragraph jumps outside of the box. I've been told that the HTML works
as expected sinde the Dreamweaver preview window, so I'm suspecting
IE6. Anyone know how to make this box work?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>BOX</title>
<style>
..cbox {
width:450px;
height:auto;
border-style:solid;
border-width:thin;
border-color:blue;
padding-left:5px;
padding-right:5px;
padding-top:10px;
padding-bottom:12px;
margin-left:0px;
margin-right:0px;
margin-top:0px;
margin-bottom:12px;
text-align:center;
color:red;
}
</style>
<head>
<body>
<h3>We ask of an HTML expert...</h3>
<p class="cbox">
<b>Why does this box work?</b>
</p>
<p class="cbox">
<p><b>And this box doesn't?</b></p>
</p>
<h3>Can you keep the &LT;P&GT; or &LT;DIV&GT; inside the box?</h3>
</body>
</html>

Jul 21 '05 #1
7 3046
*Joe*:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<p class="cbox">
<p><b>And this box doesn't?</b></p>
</p>


You don't have a CSS problem, but encountered an HTML (validation) FAQ.
I suppose you know where to find the answer.
Jul 21 '05 #2
in comp.infosystems.www.authoring.stylesheets, Joe wrote:
The nested paragraph jumps outside of the box.
What does paragraph nested in paragraph mean? As there is no reason for
nesting paragraphs, nesting paragraphs is impossible.

If you need generic box, use div. P element is for marking up paragraphs.

So, when HMTL parser sees <p>foo<p>bar it interprets them as 2 paragraphs
following each other. Extra </p>'s are ignored as errors.
I've been told that the HTML works
as expected sinde the Dreamweaver preview window, so I'm suspecting
IE6.


When bad browser gives you bad results, don't try to test it using worse
browser... But, nesting things inside paragraph is not as simple as you
might think - many browsers have error correction thinking different
ways...

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Support me, buy Opera:
https://secure.bmtmicro.com/opera/bu...tml?AID=882173
Jul 21 '05 #3
Joe
Thank you for your notes. The reason I wrapped with <P> tags was
because every book and every sample of code that I looked at did it
that way. But you're right, of course. It makes more sense to wrap
with DIV tags -- and now my formatting works, too. Thanks, again.

By the way... been to Utrecht. Nice city.

Jul 21 '05 #4
Joe wrote :
Thank you for your notes. The reason I wrapped with <P> tags was
because every book and every sample of code that I looked at did it
that way.
What are these samples that you are looking at? I would first
suggest... dont look at those samples.

By the way... been to Utrecht. Nice city.

Indeed. However bloody cold at times.

--
if the oil light is on, dont think it will just go away

Jul 21 '05 #5
Joe
Thanks for your comments. I had Googled high and low looking for an
answer to the nested <p><div></div></p> question. Only found an answer
here. If you have time, can you please point me to this FAQ? It
sounds like a useful thing to have.

Jul 21 '05 #6
in comp.infosystems.www.authoring.stylesheets, Disco Octopus wrote:
Joe wrote :
Thank you for your notes. The reason I wrapped with <P> tags was
because every book and every sample of code that I looked at did it
that way.


What are these samples that you are looking at? I would first
suggest... dont look at those samples.


And don't read books about web design, unless you are very certain about
their quality. All books I have seen have made fundamental error in first
few pages. But I haven't been actively looking for one in years.

There must be some good ones too...
Utrecht

However bloody cold at times.


LOL.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Support me, buy Opera:
https://secure.bmtmicro.com/opera/bu...tml?AID=882173
Jul 21 '05 #7
tink
1 New Member
WoW almost a year later.... Has anything changed regarding the use of nested <p>'s?
in comp.infosystems.www.authoring.stylesheets, Disco Octopus wrote:[color=blue]
> Joe wrote :[color=green]
> > Thank you for your notes. The reason I wrapped with <P> tags was
> > because every book and every sample of code that I looked at did it
> > that way.[/color]
>
> What are these samples that you are looking at? I would first
> suggest... dont look at those samples.[/color]

And don't read books about web design, unless you are very certain about
their quality. All books I have seen have made fundamental error in first
few pages. But I haven't been actively looking for one in years.

There must be some good ones too...
[color=blue][color=green]
> > Utrecht[/color]
> However bloody cold at times.[/color]

LOL.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Support me, buy Opera:
https://secure.bmtmicro.com/opera/bu...tml?AID=882173
I came a googleing last night when I came across a nested <p> tag in an article about "Floats" and CSS by John Gallent of Community MX.
The example he was using to illustrate his point was this.
<div style="float:left; width:30%;">
<p>Left float text</p></div>
<p> <!-- first block box -->
<div style="float:right; width:150px;">
<p>Right float text</p></div>
Text following the right nested float
</p>
<p>Paragraph</p> <!-- second block box -->
<p>Paragraph</p> <!-- third block box -->
I haven't had a chance to finish the article as I went off in search of "what the heck is a nest <p>" And I haven't written the author as yet either as I want to obviously finish the essay as well as do my research on the questions that come up.
Can you enlighten another lost soul a bit more on this? How would you do this. This code was talking about float boxes over lapping other text blocks
Meanwhile, the block boxes following the float just get covered by the float (even though their content
may have been moved aside). If the float is made very tall, it can drape over a large stack of block boxes,
as shown in the second screen shot image.
May 8 '06 #8

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

Similar topics

7
2312
by: Jukka K. Korpela | last post by:
After noticing that IE 7 beta supports selectors like p+p, I started wondering how to achieve a simple rendering of paragraphs so that 1) there is no vertical spacing between paragraphs (i.e. the...
1
2015
by: razilon | last post by:
Hi, I've written a managed class that makes use of stl vectors of a few unmanaged structs for data handling/manipulation, but I'm getting a few very strange errors. I get an "Unhandled...
0
1326
by: razilon | last post by:
Hi, I've written a managed class that makes use of stl vectors of a few unmanaged structs for data handling/manipulation, but I'm getting a few very strange errors. I get an "Unhandled...
7
2605
by: pbd22 | last post by:
Hi. I am somewhat new to this and would like some advice. I want to search my xml file using "keyword" search and return results based on "proximity matching" - in other words, since the search...
2
2610
by: trezraven | last post by:
I am creating a template in Word 2007 using Visual Basic Editor. I am pulling information from an Access database. I know this is probably a stupid question, but for the life of me I can't figure out...
16
3765
by: danep | last post by:
Hi all, On my site I have a section of code that resembles the following: <p id="gear" style="display: none;"> <p>test</p> </p> This renders fine in Firefox (that is, nothing is...
4
1914
by: Sjef Janssen | last post by:
Hallo, I'm trying to create boxes that have nicely spaced paragraphs, but a title that is in a colored line full-width. Here is my styles: In the div content I create the framed boxes and...
5
4446
by: keoo | last post by:
Im putting the part of the code which is relevant to my question......The program is opening the texfile which i already have created..Im not quite managing to make the program count the number of...
2
5840
by: pramodkh | last post by:
Hi All I am parsing a word doc using perl. I am using Win32::OLE module for this. I am able to get the Paragraphs/styles/Text from the word doc. But facing some problem when I am trying to get...
0
7129
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7398
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...
1
7061
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
7502
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...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1566
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.