Foward Slash

Jim,

I noticed that at the end of a lot of lines of code of yours, you have a space and a forward slash. How do these ends help and what types of lines of code should they be used on.

Thanks,

Roger

Comments

  1. AMPC says:

    Can you give me an example?

    Not sure on what site you are referring to.

    Thanks,

    Jim.

  2. Actual says:

    Jim,

    See the end of some of these lines of code ending with a space an a forward slash?

    <html xml:lang="en" lang="en" xmlns="w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

    Thanks,

    Roger

  3. AMPC says:

    I see – that is because I am using the doctype I am. It is needed to validate (for those concerned with validation).

    Using the forward slash depends on doctype. If it’s strict, you’ll need to close your tags (using the forward slash). For example:

    <br> – Is HTML complaint.
    <br /> – Is xHTML and HTML complaint.

    Check out w3.org/TR/xhtml1/ for more info.

Speak Your Mind

Comment moderation is enabled. Your comment may take some time to appear.