Web Design Forums

HTML and CSS Help

Having problems with these web design scripting? Ask here.

Simple Tag Question



Site of the Month Nominations
ENTER YOUR SITE NOW!

Reply
 
LinkBack Thread Tools
Old June 12 '09, 05:12 PM (#1)
MaryJo is offline
WDF Member
 
MaryJo's Avatar
 
Join Date: May 2008
Posts: 47
MaryJo is an unknown quantity at this point
Simple Tag Question

When does a tag need the closing tag <> </>
and when does it not? < >

My brain is fried from reading and being on the computer all day.

Thanks for your help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 12 '09, 08:54 PM (#2)
imagn is offline
WDF Regular
 
imagn's Avatar
 
Join Date: July 2007
Location: Los Angeles
Posts: 156
imagn will become famous soon enough
There are only a few tags that don't need it and those would best be described as ones where content doesn't exist within them.
For example:
Line Breaks - <br />
Horizontal Rules - <hr />
In XHTML the traling "/>" acts as the closing tag.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 12 '09, 09:44 PM (#3)
MaryJo is offline
WDF Member
 
MaryJo's Avatar
 
Join Date: May 2008
Posts: 47
MaryJo is an unknown quantity at this point
Thanks imagn - That was a great way to describe it. Makes more sense to me now.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 13 '09, 03:44 PM (#4)
filburt1 is offline
bored
 
filburt1's Avatar
 
Join Date: July 2002
Location: Maryland, US
Posts: 11,785
filburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to all
Tags like those are called "self-closing" tags. Any tag that can't contain other content (for example, an image, line break, horizontal rule, meta tag, etc.) must be self-closing.

In XML (and therefore XHTML), <foo></foo> and <foo /> are identical as far as the parser is concerned, but in reality, there are browser problems where you have to use one or the other. For example, you can't do <script type="text/javascript" src="foo.js" /> because most browsers don't properly detect the script tag as being closed.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 13 '09, 06:35 PM (#5)
Hitch - CP is offline
WDF Member
 
Hitch - CP's Avatar
 
Join Date: June 2009
Location: London
Posts: 84
Hitch - CP is on a distinguished road
Normal WYSIWYG programs like Dreamweaver do this for you, although many people don't like to use these programs as they can add-in unnecessary code along with other problems ...still got my vote though.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 18 '09, 07:04 AM (#6)
stanneon is offline
New Member!
 
stanneon's Avatar
 
Join Date: June 2009
Posts: 8
stanneon is an unknown quantity at this point
Quote:
Originally Posted by imagn
There are only a few tags that don't need it and those would best be described as ones where content doesn't exist within them.
For example:
Line Breaks - <br />
Horizontal Rules - <hr />
In XHTML the traling "/>" acts as the closing tag.
This is right, the XHTML closing tag also applies to the image tag, we usually use <img src=""></img> right, but it's more easier now because instead of that we just close it after declaring the src="" or anything that follows after). <img src="" />
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 2 '09, 06:55 AM (#7)
nitin is offline
New Member!
 
nitin's Avatar
 
Join Date: July 2009
Posts: 14
nitin is an unknown quantity at this point
Actually most of the html tags has ending tag. But there are some tags dont have end tag. For example break tag, hr tag dont have tag mostly these are the two which will use very useful in most of the coding.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  Web Design Forums » Programming Help » HTML and CSS Help

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
The future of Web Design Forums.net filburt1 Announcements 128 January 30 '10 05:27 AM
Simple question to help a lot fireseed HTML and CSS Help 1 February 5 '08 03:55 PM
Simple question - best way to create vertical padding between divs in CSS? TheGardener HTML and CSS Help 5 October 12 '07 12:14 PM
Should be a very simple question... twharry General Web Design Discussion 1 August 11 '04 01:36 AM

 
User Infomation
Your Avatar

Site Of The Month

Ticket Cake
Ticket Cake

Ticket Cake is a drupal based event ticketing platform. It features that ability to browse events and share them.

Nominate Your Site Now!

Advertisement
WolfCMS.org

Latest Articles
- by RickM
- by bfsog

Advertisement

Partner Links



All times are GMT -4. The time now is 02:50 AM.


WebDesignForums.net is Copyright © 2010 RikeMedia.

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163