Question about using <br /> with 'strict' xhmtl

Discussion in 'HTML' started by BT, Feb 14, 2005.

  1. BT

    BT Guest

    I've just started the move from html to xhtml and I have a question. I was
    getting verification errors from all of the <br /> tags that I added to a
    page. I thought this tag could be used anywhere. By trial and error, it
    seems that this tag works just fine...as long as it is inside of <p> or
    <div> tags.

    Can anyone give me some more detail or point me to a link where I might find
    out how and where this tag can be used with 'strict' xhtml?

    much appreciated
     
    BT, Feb 14, 2005
    #1
    1. Advertising

  2. On Mon, 14 Feb 2005 16:21:58 GMT, BT <> wrote:

    [ using <br /> with XHTML ]

    > Can anyone give me some more detail or point me to a link where I might
    > find
    > out how and where this tag can be used with 'strict' xhtml?
    >


    The DTD tells:
    <http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>


    --
    ,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
    | weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
    | webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
    |zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
    `-------------------------------------------------- --<--@ ------------'
     
    Barbara de Zoete, Feb 14, 2005
    #2
    1. Advertising

  3. BT wrote:

    > I've just started the move from html to xhtml and I have a question. I
    > was getting verification errors from all of the <br /> tags that I added
    > to a page. I thought this tag could be used anywhere.


    They can go pretty much anywhere you can have text (character data) or
    images. Since you haven't mentioned problems with text or images it
    suggests that you are misusing them as a substitute for the CSS margin
    properties.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Feb 14, 2005
    #3
  4. BT

    Steve Pugh Guest

    "BT" <> wrote:

    >I've just started the move from html to xhtml and I have a question.


    And apparantly from Transitional to Strict at the same time. You'll
    probably gain greater benefit from going to HTML 4 Transitional to
    HTML 4 Strict than you will in any change from HTML to XHTML. But so
    long as you understand what using Strict means and write your code
    accordingly the difference between HTML 4.01 and XHTML 1.0 is largely
    irrelevant.

    >I was
    >getting verification errors from all of the <br /> tags that I added to a
    >page. I thought this tag could be used anywhere. By trial and error, it
    >seems that this tag works just fine...as long as it is inside of <p> or
    ><div> tags.


    In the Strict versions of HTML 4.x and XHTML 1.0 text (and HTML markup
    that is treated as text such as <img> and <br>) can not appear nakedly
    inside the body but must appear inside a container of some sort.

    >Can anyone give me some more detail or point me to a link where I might find
    >out how and where this tag can be used with 'strict' xhtml?


    Structure your code so that all text (and hence all line breaks - you
    are using <br> to break lines of text and not create the illusion of
    vertical margins, aren't you?) is marked up inside an appropriate
    block level container.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Feb 14, 2005
    #4
  5. BT

    Jan Faerber Guest

    BT ... output:

    > I was
    > getting verification errors from all of the <br /> tags that I added to a
    > page.


    With Quanta you get those errors aswell. The verification depends on the
    tool you use. Quanta does not verify xhtml and does not know <br />.
    You will get an error:

    '[line number]: unknown attribute "/" for element <br>.'

    http://validator.w3.org/ ... but this validator knows it better - e.g.:

    http://tinyurl.com/5cmbb says:

    This page is not Valid XHTML 1.0 Strict!

    Line 16, column 976: end tag for "br" omitted, but OMITTAG NO was specified

    ....256" size="55" name="q" value=""><br><input type="submit"
    value="Google-Suche



    --
    Jan Faerber

    http://html.janfaerber.com
     
    Jan Faerber, Feb 14, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ed
    Replies:
    1
    Views:
    659
  2. Dave Winter
    Replies:
    16
    Views:
    3,443
    brucie
    Apr 8, 2004
  3. Replies:
    3
    Views:
    560
    Steven Cheng[MSFT]
    Oct 9, 2006
  4. Matthias Braun

    XHMTL and CSS Problem

    Matthias Braun, Jan 31, 2010, in forum: HTML
    Replies:
    14
    Views:
    1,299
    Matthias Braun
    Feb 1, 2010
  5. Florian Weimer

    Tunneling own XML content in XHMTL etc.

    Florian Weimer, Jan 24, 2011, in forum: XML
    Replies:
    6
    Views:
    1,020
    Florian Weimer
    Feb 5, 2011
Loading...

Share This Page