1. This website uses cookies. By continuing to use this website you are giving consent to cookies being used.
    For information on cookies and how you can disable them visit our Cookie Usage page.
    Dismiss Notice

HTML line break question

Discussion in 'Web Development' started by pusscat, Oct 21, 2009.

  1. pusscat

    pusscat New Member

    If using the line break do you need a opening tag for it aswell as a closing one.

    example

    <br>text here</br>

    or is it

    <b>text here</br> or is the slash after the br

    as am validating my pages as make them and getting errors on one or two
    pages and its the </br> that has the problem everything else validates great
    I need the line breaks in some of the paragraphs

    Thanks

    Angie
     
  2. ishkey

    ishkey Moderator, Logos, Sports Crests Staff Member Verified Member

    Depending on which DTD (Document Type Definition) you have in the top of your page determines which style to use.

    <br> - Is HTML complaint.
    <br /> - Is xHTML complaint

    they are stand alone tags, just like the <hr> tag creates a horizontal line in an HTML page.

    example
    Code:
    <p>YourName<br>123 Street<br>Some Town</p>
    code would output:
    YourName
    123 Street
    Some Town
     
  3. pusscat

    pusscat New Member

  4. pusscat

    pusscat New Member

    Ok took html through html tidy and that found no problems, so re-validated it and its come up with no problems

    which is wierd as havent made any changes to it since last validated and it came up with errors

    But aslong as its clean thats the main thing

    Thanks for the help is appreciated


    Angie