Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
  1. #1
    Member beans's Avatar
    Join Date
    Jul 2005
    Location
    Melbourne, Australia
    Posts
    66
    Member #
    10559
    Hi guys, I have been writing my first website using Notepad but just recently got Dreamweaver because it's a bloody big site and I thought that DW would make it a little easier. Anyway i noticed that it does this thing with tags that I haven't seen before, for example:
    it turns a break tag
    Code:
    <br>
    into this:
    Code:
    <br />
    I'm just wondering why it does that and is there any reason - is it important? Because when I did a little validation on the page it kept coming up with stuff like "br should be closed before closing p", and I figure it's because I don't put that extra space and slash there... because I didn't think you needed to!

    someone please enlighten me :cheeky:
    - gah!

  2.  

  3. #2
    Senior Member Fallout's Avatar
    Join Date
    Aug 2003
    Location
    Richmond, Virginia
    Posts
    543
    Member #
    2748
    The " />" ending is used in XHTML for tags that don't have an end tag. For example, input, img, and br all are closed with this method. Without the ending, the validator will give you an error, but it's an easy fix.

  4. #3
    Junior Member
    Join Date
    May 2003
    Location
    Cambridgeshire, UK
    Posts
    29
    Member #
    1544
    HTML will validate fine with just <br> however if you wish to make your website XHTML compliant then you should really use <br /> i even think <br></br> is valid XHTML.

    It doesn't really make much difference if your only making a simple site, but if dreamweaver does it automatically there's not much harm in using <br /> instead.

    Oh and the reason for the / in that tag is because XHTML follows rules of XML, one of which is that all opened tags must have a closing tag.

  5. #4
    Senior Member tha_Gsheep's Avatar
    Join Date
    Feb 2003
    Location
    Scotland
    Posts
    188
    Member #
    780
    Remember to serve up your site with at least the HTML Transitional doctype when using self-escaped tags heres the transitional one:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

    Your browser will render the presentation of the page slightly differently depending on the doctype you declare at the top. Especially if you are using CSS in the mix.
    www.appletv.co.uk

  6. #5
    Member beans's Avatar
    Join Date
    Jul 2005
    Location
    Melbourne, Australia
    Posts
    66
    Member #
    10559
    thanks for the tips everyone. I think dreamweaver may have put an xhtml doctype into the header, so i'll change it to the HTML transitional one seeing as i have no intention to write xhtml or be compliant with it...
    - gah!

  7. #6
    Senior Member Rince's Avatar
    Join Date
    Nov 2004
    Posts
    183
    Member #
    8318
    You should be using the HTML Strict doc type for all new pages. That is:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    The transitional doctypes are for when you are upgrading from say html 3.2 to html 4.01. If you didn't write in 3.2, then there is no advatage to the transitional doctype.

  8. #7
    Senior Member tha_Gsheep's Avatar
    Join Date
    Feb 2003
    Location
    Scotland
    Posts
    188
    Member #
    780
    Thats true but sometimes I've had problems with using strict when using CSS. So the options there if your a twit like myself.
    www.appletv.co.uk

  9. #8
    Member beans's Avatar
    Join Date
    Jul 2005
    Location
    Melbourne, Australia
    Posts
    66
    Member #
    10559
    i'm a twit, i'll take the option
    - gah!

  10. #9
    Senior Member Rince's Avatar
    Join Date
    Nov 2004
    Posts
    183
    Member #
    8318
    The change in CSS behaviour is more likely to be due to switching the browser (IE) form Standard to Quirks mode. Check out this article for picking the correct doctype for your code.
    http://hsivonen.iki.fi/doctype/

    The only difference between strict and transitional is tht under trans you can use the following deprecated tags: APPLET, BASEFONT, CENTER, DIR, FONT, ISINDEX, MENU, S, STRIKE, and U.

    But really, you probably won't be using them (excpet maybe <centre> <font> which dreamweaver/frontpage keep putting everywhere despite the fact they were depracated back in 1997! And there are many alternatives to them so why use them.)


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:17 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com