473,395 Members | 1,474 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.

<br /> or <div /> with old browsers...

so i am starting to use more of <br /and <div style="clear: both" /
>...
which is the XHTML style...

now, won't those actually confuse the old browsers? for example,
will the old browser treat the "div" as not closing, and so everything
after the div will be treated as part of that div?

Jun 19 '07 #1
10 3161
Scripsit Su************@gmail.com:
so i am starting to use more of <br /and <div style="clear: both" /
>...
which is the XHTML style...
Are trolling, or just clueless? You posted the same question to
c.i.w.a.stylesheets, with a different Subject and different wording, but
exhibiting the same ignorance-based willingness to use XHTML. You apparently
haven't read this group even for a few days; otherwise you wouldn't think
about using XHTML style.

Please learn to post to Usenet before starting to compose your next message:
http://www.cs.tut.fi/~jkorpela/usenet/dont.html

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jun 19 '07 #2
<Su************@gmail.composted...
: so i am starting to use more of <br /and <div style="clear:both"/>...
: which is the XHTML style...

<div style="clear:both;margin:0px auto;width:200px;border:1px solid #0000CC;text-align:center;line-height:1.5em;padding:0.2em;">Some
Content</div>

As far as I know <divalways has a closing tag. I've NEVER
seen <div/until your post here. Even HTML requires a closing
tag.

Also note that <divtags may default to clear:both; so that may
not be needed. Most browsers insert a line-break before the
starting <divand after the completing </divtags.

http://www.w3schools.com/tags/
http://www.w3schools.com/tags/tag_div.asp

--
Jim Carlock
Jun 19 '07 #3
On Jun 19, 7:26 am, "Jim Carlock" <anonym...@127.0.0.1wrote:
As far as I know <divalways has a closing tag. I've NEVER
seen <div/until your post here.
It is fine in (true) XHTML (for which the previously mentioned 'older
browsers' will go 'Eh? Don't recognise this. You wanna save it to your
disk?'
Even HTML requires a closing
tag.
The above code sample has a closing tag.
Also note that <divtags
Elements, not tags
may default to clear:both;
They don't
http://www.w3schools.com/tags/http:/...gs/tag_div.asp
Avoid w3schools. They provide more errors per paragraph then any other
HTML tutorial site.
--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/

Jun 19 '07 #4
On 19 Jun, 06:12, Summercooln...@gmail.com wrote:
so i am starting to use more of <br /and <div style="clear: both" />...

which is the XHTML style...

now, won't those actually confuse the old browsers?
Who knows? Who can know how many obscure old browsers your code might
meet on its travels.

So go read the XHTML Appendix C notes on HTML compatibility. They'll
tell you.

Jun 19 '07 #5
RvT
On 19 jun, 00:12, Summercooln...@gmail.com wrote:
so i am starting to use more of <br /and <div style="clear: both" />...

which is the XHTML style...

now, won't those actually confuse the old browsers? for example,
will the old browser treat the "div" as not closing, and so everything
after the div will be treated as part of that div?

<div /does not exist as it is an container of information, just like
<pand <b>, etc. <br/does need the extra slash because it does not
contain information. So, it is:

<div>content</div>
<b>content</b>
<p>content</p>

but

Hello<br/>
next line

It is really not so difficult.

Jun 22 '07 #6
Scripsit RvT:
<div /does not exist as it is an container of information,
Of course it exists. In XHTML, it is a valid element, which is equivalent to
<div></div>. If it did not exist, there would be no reason to say that it
should not be used (in documents that might be processed by software that
does not understand XML), as the XHTML 1.0 specification says. There's no
point in saying "should not" about something to which "shall not" already
applies (such as invalid documents).

It's a container element, just with empty content. It's bad practice, though
not explicitly frowned upon in specifications. Oddly enough, the HTML 4.01
specification explicitly says that empty _paragraphs_ (<p></p>) should not
be used and that browsers should ignored them, but it has no such statement
about empty div (or about a paragraph with dummy content, such as the common
bogosity <p>&nbsp;</p>).
It is really not so difficult.
People can make things difficult to themselves by using XHTML without
understanding it and even mixing XHTML and classic HTML.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jun 22 '07 #7
On 2007-06-22, Jukka K. Korpela <jk******@cs.tut.fiwrote:
Scripsit RvT:
><div /does not exist as it is an container of information,
[...]
It's a container element, just with empty content. It's bad practice, though
not explicitly frowned upon in specifications. Oddly enough, the HTML 4.01
specification explicitly says that empty _paragraphs_ (<p></p>) should not
be used and that browsers should ignored them,
It does say that, but do any of them ignore them?

I don't know much about the history of these things, but it seems that
that may have partially evolved into the margin-collapsing rules in CSS
2.1, especially the rule that margins collapse "through" zero-height
boxes.

Assuming for the sake of argument that <pis in no way special apart
from its default styles of display: block, top and bottom margins, and
no padding or borders, then according to the margin collapsing rules:

<p>Blah blah</p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p>Blah blah</p>

renders exactly the same as

<p>Blah blah</p>
<p></p>
<p>Blah blah</p>

since the margins of all those adjacent empty paragraphs collapse
through each other. Of course this isn't quite the same as "ignoring
empty paragraphs" but it renders the same in many circumstances.
Jun 22 '07 #8
Scripsit Ben C:
>Oddly enough, the HTML 4.01 specification explicitly says that empty
_paragraphs_ (<p></p>) should not be used and that browsers should
ignored them,

It does say that, but do any of them ignore them?
I haven't made any study on this, since I think it suffices to know the
recommendation, see that it is reasonable, and to know fairly surely that
some browsers fail to follow the recommendation. After all, as an author, I
don't care about the treatment of some constructs that I should not use and
do not use.
according to the margin collapsing rules:

<p>Blah blah</p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p>Blah blah</p>

renders exactly the same as

<p>Blah blah</p>
<p></p>
<p>Blah blah</p>
That's what happens on IE 7, and the rendering is exactly the same as for

<p>Blah blah</p>
<p>Blah blah</p>

The behavior is the same with CSS disabled, using the well-known "toggle
CSS" favelet, though I'm not sure how well it disables the "browser style
sheet".

And it's the same even in Quirks Mode.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jun 22 '07 #9
RvT
On 22 jun, 05:15, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
Scripsit RvT:
<div /does not exist as it is an container of information,

Of course it exists. In XHTML, it is a valid element, which is equivalent to
<div></div>.
A DIV needs to be opened and close, there is not such thing as <div /
>, that would result in a validation error.
Jun 22 '07 #10
On Jun 22, 4:00 pm, RvT <rmvan...@gmail.comwrote:
On 22 jun, 05:15, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
Scripsit RvT:
<div /does not exist as it is an container of information,
Of course it exists. In XHTML, it is a valid element, which is equivalent to
<div></div>.

A DIV needs to be opened and close, there is not such thing as <div />,
<div /is opening and closing the div element.
that would result in a validation error.
Try it in a validator and see.

Steve

Jun 22 '07 #11

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

Similar topics

4
by: fis | last post by:
Hi all, I've problem because there are needed break lines in my texts on the web site but i can't do it :( My pipeline looks like: XMS -> I18N -> XSLT -> HTML I have lot of texts in my...
2
by: John D | last post by:
can anyone explain why a site would use this in their page <!--<BR>--> Presumably it is hiding the <BR> from ... ??? TIA John
16
by: Axel Dahmen | last post by:
Hi, I always thought that "1em" equals one line height. But if I replace <br><hr><br> by <hr style="margin: 1em 0;">
7
by: noor.rahman | last post by:
I have an XML file that stores data from an HTML form. I use XSL to display the data in HTML format. The data may have newline characters. However, XSL is not displaying the newlines properly in...
2
by: Winshent | last post by:
I have a multi line text in an admin page on my cms. I am trying to capture carriage returns as and replace them with <p></p> bfore the string gets written to the database. I have tried all...
1
by: Winshent | last post by:
I have a multi line text in an admin page on my cms. I am trying to capture carriage returns as and replace them with <p></p> bfore the string gets written to the database. I have tried all...
9
by: Wayne | last post by:
$a = $_POST; # txt_content = This is a<CR><LF>Test $p = str_replace ("%0D%0A", "<br>", $a); That is the above code that I am using, however, it is not picking up the CR/LF from the textarea. I...
2
by: xhe | last post by:
I met a very headache problem in javascript, I think this might be difference between IE and NS / Safari. I have a text area <form> <textarea name='tex1' onkeyup='displayit();'></textarea>...
7
by: Nathan Sokalski | last post by:
Something that I recently noticed in IE6 (I don't know whether it is true for other browsers or versions of IE) is that it renders <br/and <br></br> differently. With the <br/version, which is what...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.