Forums

This topic is locked

How do I close: tag that was left unclosed.

Posted 15 Jun 2007 09:27:42
1
has voted
15 Jun 2007 09:27:42 Kylie Jensen posted:
Hi
Can someone help me....
How do I close:
Line 31 Col 105 : Closed a <img> tag that was left unclosed.
Line 62 Col 122 : Closed a <img> tag that was left unclosed.
Line 69 Col 31 : Closed a <br> tag that was left unclosed.
Line 70 Col 76 : Closed a <input> tag that was left unclosed.
Line 72 Col 17 : Closed a <br> tag that was left unclosed.
Line 73 Col 18 : Closed a <br> tag that was left unclosed.
Line 74 Col 75 : Closed a <input> tag that was left unclosed.
Line 78 Col 10 : Closed a <br> tag that was left unclosed.
Line 128 Col 14 : Closed a <br> tag that was left unclosed.
Line 130 Col 12 : Closed a <br> tag that was left unclosed.
Line 132 Col 25 : Closed a <br> tag that was left unclosed.
Line 137 Col 131 : Closed a <img> tag that was left unclosed.
Line 137 Col 135 : Closed a <br> tag that was left unclosed.

Im new to learning code.

Replies

Replied 15 Jun 2007 09:49:16
15 Jun 2007 09:49:16 Alan C replied:
each of your tags needs to be closed when you're using xhtml, but . . . the browsers will do it for you if you forget, there is some opinion that says that the browsers ought not to do it, but then there would be lots of pages that didn't work. IMHO it's time for the browsers to stop being so kind.

Looking at your list, those are all tags that have just one part, take the <pre id=code><font face=courier size=2 id=code> &lt;br&gt;</font id=code></pre id=code> tag, it only has one part, it's not like <pre id=code><font face=courier size=2 id=code> &lt;p&gt; some text &lt;/p&gt;</font id=code></pre id=code> that has an opening and closing part. So, the answer is that you close these tags in a different way, for break it's <pre id=code><font face=courier size=2 id=code> &lt;br /&gt;</font id=code></pre id=code>

That's a space followed by the /

The others are similar
Replied 15 Jun 2007 10:50:44
15 Jun 2007 10:50:44 Kylie Jensen replied:
Can you look at my code and give me a before and after example for a couple of examples please? Thanks Heaps
website is www.development.acnm.edu.au/latest/home_page.html

&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
&lt;title&gt;Australian College of Natural Medicine&lt;/title&gt;
&lt;style type="text/css"&gt;
@import url(layout.css);
&lt;/style&gt;
&lt;style type="text/css"&gt;
@import url(menu.css);@import url("styles.css";
.style1 {color: #666666}
.semester {
font-size: 11px;
font-family: Arial, Helvetica, sans-serif;
color: #60721E;
}
&lt;/style&gt;
&lt;script type="text/javascript" language="javascript" src="menu.js"&gt;&lt;/script&gt;
&lt;link href="/index.html/styles.css" rel="stylesheet" type="text/css" /&gt;
&lt;script type="text/javascript"&gt;
&lt;!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape"&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//--&gt;
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="header_two"&gt;
&lt;div id="top_image"&gt;&lt;img src="images/new pictures/top_leaf.jpg" alt="top_leaf" width="980" height="10" /&gt;&lt;/div&gt;
&lt;div id="menu"&gt;
&lt;ul class="menulist" id="listMenuRoot"&gt;
&lt;li&gt;&lt;a href="home_page.html"&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="courses.html"&gt;Courses&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="acupuncture.html"&gt;Acupuncture&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="aromatherapy.html"&gt;Aromatherapy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="homeopathy.html"&gt;Homeopathy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="counselling.html"&gt;Holistic Counselling&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="massage.html"&gt;Massage Therapy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="nutritional.html"&gt;Nutritional Medicine&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="beautytherapy.html"&gt;Natural Beauty Therapy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="mindbody.html"&gt;Mind/Body Medicine&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="musculoskeletal.html"&gt;Musculoskeletal Therapy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="naturopathy.html"&gt;Naturopathy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="remedial.html"&gt;Remedial Massage&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="reflexology.html"&gt;Reflexology&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="tcmremedial.html"&gt;T.C.M. Remedial Massage&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="westernherbal.html"&gt;Western Herbal Medicine&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="aboutus.html"&gt;About Us&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="newstudents.html"&gt;New Students&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="current.html"&gt;Current&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="international.html"&gt;International&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="alumni.html"&gt;Alumni&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="clinic.html"&gt;Clinic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="beauty.html"&gt;Beauty&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div id="banner"&gt;&lt;img name="front_image" src="images/new pictures/front-header-pic.jpg" width="980" height="160" alt="" /&gt;&lt;/div&gt;
&lt;div id="slogan"&gt;The Centre of Excellence in Natural Medicine Education for more than 30 years &lt;/div&gt;
&lt;/div&gt;
&lt;div id="acnm_content_two"&gt;
&lt;div id="login"&gt;
&lt;h1&gt;ACNM Student Login&lt;/h1&gt;
&lt;form name="form1" method="post" action=""&gt;
&lt;label&gt;Student Number&lt;br /&gt;
&lt;input name="acnm_student_number" type="text" size="12" maxlength="6" /&gt;
&lt;/label&gt;
&lt;label&gt;&lt;br /&gt;
Password&lt;br /&gt;
&lt;input name="acnm_password" type="password" size="12" maxlength="12" /&gt;
&lt;/label&gt;
&lt;label&gt;&lt;/label&gt;
&lt;label&gt;&lt;/label&gt;
&lt;br /&gt;
&lt;input type="submit" name="login" value="login" class="login" /&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;div id="courseinfoseminars"&gt;
&lt;p&gt;&lt;b&gt;Brisbane&lt;/b&gt;&lt;br /&gt;
28 May, 2:00pm&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Gold Coast&lt;/b&gt;&lt;br /&gt;
31 May, 6:30pm&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Melbourne&lt;/b&gt;&lt;br /&gt;
28 May, 2:00pm&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Box Hill&lt;/b&gt;&lt;br /&gt;
31 May, 6:30pm&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Perth&lt;/b&gt;&lt;br /&gt;
28 May, 2:00pm&lt;/p&gt;
&lt;/div&gt;
&lt;div id="middle"&gt;
&lt;h2&gt;There has never been a better time to study
Natural Medicine &lt;/h2&gt;
&lt;p&gt;ACNM is committed to the future of natural medicine in this
country and internationally. The highest standard of education
and the most informed curriculum ensures that ACNM graduates
become highly-regarded practitioners.The Australian College of
Natural Medicine was the first institution in Australia, private or
public, to offer such a range of natural medicine courses from
Certificate through to Bachelor level programs.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h2&gt;The Spirit of ACNM&lt;/h2&gt;
&lt;p&gt;The reasons why people turn to natural medicine are many.
To some, natural medicine represents a natural and gentle
approach to achieving a positive health outcome, one that doesn’t
include invasive, aggressive or harmful treatments.
To others, the appeal of natural medicine is that it acknowledges
more than just the physical aspect of illness. For most, however, the
appeal of the natural medicine approach is based on the fact that it
has ‘soul’, something that is largely missing from the conventional
medicine model.&lt;/p&gt;
&lt;/div&gt;
&lt;div id="right"&gt;
&lt;h2&gt;Important News&lt;/h2&gt;
&lt;h2&gt;&lt;strong&gt;FEE-HELP&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt; FEE-HELP now available for ACNM students&lt;/p&gt;
&lt;h2&gt;&lt;strong&gt;FEE-HELP&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt; FEE-HELP now available for ACNM students&lt;/p&gt;
&lt;h2&gt;&lt;strong&gt;FEE-HELP&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt; FEE-HELP now available for ACNM students
&lt;/p&gt;
&lt;/div&gt;
&lt;div id="right_cnb"&gt;
&lt;p&gt;&lt;a href="beauty_therapy_home.html"&gt;CLICK HERE&lt;/a&gt; to find
out &lt;br /&gt;
what's on offer
at&lt;br /&gt;
The College of
Natural Beauty &lt;br /&gt;
Brisbane Campus&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="footer"&gt;
&lt;p&gt;&lt;img src="images/new pictures/bottom-leaf2.jpg" alt="bottom_leaf" name="bottom_leaf" width="980" height="22" id="bottom_leaf" /&gt;&lt;br/&gt;
© Australian College of Natural Medicine 2007, Australia.
Registered Training Organisation #31489. CRICOS Provider # &lt;a href="cricos.dest.gov.au/Institution/InstitutionDetails.aspx?ProviderID=231" target="_blank"&gt;QLD 00231G&lt;/a&gt; | &lt;a href="cricos.dest.gov.au/Institution/InstitutionDetails.aspx?ProviderID=1399" target="_blank"&gt;VIC 01534F&lt;/a&gt; | &lt;a href="cricos.dest.gov.au/Institution/InstitutionDetails.aspx?ProviderID=2492" target="_blank"&gt;WA 02492C&lt;/a&gt; &lt;br /&gt;
Home | Courses | About Us | New Students | Current Students| International Students| Alumni | Public Clinic | Enrol | Contact Us | Disclaimer | Privacy Policy&lt;/p&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
Replied 20 Jun 2007 22:12:50
20 Jun 2007 22:12:50 Alan C replied:
Hi,
aah , I was looking at your other post earlier, the one about the page looking different in browsers - looked at in Opera, FF and IE7 yes there are differences but I couldn't see why, but now I understand - there are lots of unclosed tags that are throwing the browsers off.
Can I suggest that you get FF and install the developer's toolbar, then you can look at the code with view source and all the errors will be shown and you can tell it to clean up the code for you.

here are a couple of examples . . .

there is no document type at the top - so the browser doesn't know how to parse the file correctly and has to guess, try putting <pre id=code><font face=courier size=2 id=code> &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;</font id=code></pre id=code> at the top

immediately after that you need <pre id=code><font face=courier size=2 id=code> &lt;html&gt;</font id=code></pre id=code> you have the corresponding <pre id=code><font face=courier size=2 id=code>&lt;/html&gt;</font id=code></pre id=code> at the end of the file though

I looked at the rest and it looks like the tags are now closed fine, there is a footer that looks a bit odd and stays in position while the rest of the page scrolls, that happens with the original code and the cleaned code.

Another thing you can try is pushing it through the W3C validator -

validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.development.acnm.edu.au%2Flatest%2Fhome_page.html

that will show you what errors are present and give suggestions for getting rid of them, also try the css validator at

jigsaw.w3.org/css-validator/validator?profile=css2&warning=2&uri=http%3A%2F%2Fwww.development.acnm.edu.au%2Flatest%2Fhome_page.html

hope that helps
Replied 21 Jun 2007 02:15:59
21 Jun 2007 02:15:59 Kylie Jensen replied:
Hi
I ended up putting that little bit of code back (doctype) in at the very top of the page before you suggested it as I saw somewhere else suggesting that all websites should have it. I find though that the margins of my divs didnt turn out well in the differnet browsers, but somehow I think its ok now. I especially found it hard when you put borders on tables. They showed up completly different in all the different browsers so now Im trying to just use cell spacing.

I dont know coding at all, so to make sure a piece of code is closed I dont know what to do.

Also I did try puting it through that validator but not sure what it does or what to do with it.

By the way the footer is not meant to scroll.

Thanks for replying. All this is a bit tricky.
Replied 21 Jun 2007 15:19:17
21 Jun 2007 15:19:17 Alan C replied:
HI
I think CSS has made life more difficult for newcomers to web design, because it introduces a new level of things you have to learn about before you can really start getting pages to look right. It does produce better pages but there is a price to pay - like you say, it's not easy to get going.

The tags business is not too bad, you have to close tags and do it in the right order, so if you want something bold and italic you might open the bold tag, then open the italic tag, when you close them you have to do it in the right order, so you would close the italic first, then the bold. When you're programming most of the languages can tell you that you've done something wrong and give you some indication of where it is in the line, but when it comes to the browsers there's not really a lot that they tell you. So they just don't do what you expect. That really makes life hard because you don't know where to look when things don't do what you expect.

Don't give up on it though, I struggle with a lot of things and have to work around them until eventually I get the thing to work how I want it. What my customers and others don't see is the hours I spend trying to get it right <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Replied 22 Jun 2007 02:32:08
22 Jun 2007 02:32:08 Kylie Jensen replied:
Thankyou... yes its a bit of trial and error.
I appreciate the help and advce.
Replied 29 Jun 2007 10:49:04
29 Jun 2007 10:49:04 alin canbas replied:
you dont have to close tags like &lt;br&gt; or &lt;p&gt;... dont worry <img src=../images/fwzone/forum/icon_smile.gif border=0 align=middle>

www.findindirectory.com/fallin.aspx?pr=Computers/Internet/Web_Design_and_Development/

Reply to this topic