...

View Full Version : Resolved Validation Problem



EricaL
12-23-2009, 07:57 PM
Hi all,

I've been trying to validate my page and keep running into the following errors:

Error Line 138, Column 6: end tag for element "div" which is not open

</div>

Line 138, Column 6: XML Parsing Error: Opening and ending tag mismatch: body line 21 and div

</div>

Line 143, Column 7: XML Parsing Error: Opening and ending tag mismatch: html line 3 and body

</body>

I know it is related to my Javascript (when it's removed, the document is valid) but I'm not sure how to go about fixing it. I read something about CDATA sections, however I'm unsure as to how they work and how to input them into my document, or if it is even related to my issue.

Below is my code.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>EricaFTW</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script language="JavaScript1.2" src="js/main.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="css/contentslider.css" />

<script type="text/javascript" src="js/contentslider.js">

/***********************************************
* Featured Content Slider- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

</script>
</head>
<body>
<div id="TipLayer" style="visibility:hidden;position:absolute;z-index:1000;top:100;"></div>
<script language="JavaScript1.2" src="js/style.js" type="text/javascript"></script>

<div id="container">

<div id="header">
<img src="images/logo.png" id="logo" alt="" border="0" />
</div>

<div id="nav">
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="about.php">About</a></li>
<li><a href="portfolio.php">Portfolio</a></li>
<li><a href="writing.php">Writing</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</div>

<div id="updates">
<object type="application/x-shockwave-flash"
data="flash/slider.swf"
width="500" height="140">
<param name="movie" value="flash/slider.swf" />
<param name="quality" value="high"/>
</object>
</div>

<div id="wrap">
<div id="sidebar">
<?php include("sidebar.php"); ?>
</div>
<div id="content">
<?php

// FanUpdate 2.2.1 blog
// subject: all posts

$main_limit = 2;

require_once('/homepages/13/d263949804/htdocs/erica/FanUpdate/show-blog.php');

?>
</div>
</div>

<div id="footer">
<?php include("footer.php"); ?>
</div>
</div>

<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/ericaftw.json?callback=twitterCallback2&amp;count=1"></script>

</body>
</html>

Validation (http://validator.w3.org/check?uri=http%3A%2F%2Fericaftw.com%2Fv3%2F&charset=(detect+automatically)&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.654)
Direct link to the site (http://ericaftw.com/v3)

Thanks in advance,
Erica.

SB65
12-23-2009, 08:28 PM
The code you've posted above is fine and doesn't have mismatched div tags.

However, the code on the page you link to does have a mismatch - see indented code below. My guess is it's this:


</div><!-- END .archivelink -->

which has no corresponding opening div tag.

I don't think it's javascript related.



<div id="container">

<div id="header">
<img src="images/logo.png" id="logo" alt="" border="0" />
</div>

<div id="nav">
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="about.php">About</a></li>
<li><a href="portfolio.php">Portfolio</a></li>
<li><a href="writing.php">Writing</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</div>

<div id="updates">
<object type="application/x-shockwave-flash"
data="flash/slider.swf"
width="500" height="140">
<param name="movie" value="flash/slider.swf" />
<param name="quality" value="high"/>
</object>
</div>

<div id="wrap">
<div id="sidebar">
<img src="images/sidebar_border.png" alt="" /><br />
<h2>About:</h2>
Hi, I'm Erica. I'm a 16 year old girl aspiring to be a journalist. Not only am I a freelance writer, but I also use my spare time to pursue graphic and web design. <a href="about.php">Want to know more?</a>
<br /><br />
<img src="images/sidebar_border.png" alt="" /><br />
<h2>Blogroll:</h2>
<ul>
<li><a href="http://runawayriot.com/">Colin's Blog</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
<br /><br />
<img src="images/sidebar_border.png" alt="" /><br />
<h2>Twitter Feed:</h2>
<div id="twitter_div">
<a href="http://twitter.com/ericaftw"><img src="images/twitter_bird.png" alt="Follow me!" title="Follow me!" border="0" align="right" /></a>
<span id="twitter_update_list"></span>
</div>
</div>
<div id="content">
<div id="fanupdate">
<div id="post10" class="post">
<div style="text-align: left; border-bottom: 2px solid #4E9CAA;"><h2 style="margin-bottom: 1px;">New theme</h2>
</div>

<div style="text-align: left; font-size: 8pt;">
<p class="catfile"><i>Posted <b>Oct 4, 2009</b>. Filed under <b><a href="/v3/index.php?c=2" title="all posts about Site">Site</a>.</b></i></p>
</div>

<div style="text-align:justify; padding:3px; margin-top:3px; margin-bottom:5px;">
<p>Hey yíall.</p>
<p>I finally updated the layout of this site. Yeah, of course I loved my little birdie logo and my wood background, but Iím going from something a little more simple looking. This summer Iím going to be doing some freelance writing to get my work published (for my applications portfolio to Ryerson). Iím kind of enjoying the green right now, but it can always be changed just in case I decide I hate it.</p>
<p>Since school has started, I realized I made some mighty fine course selections. Although I thought I was going to regret taking American History, Iíve come to somewhat enjoy it. Mr.McKay gives a lot of assignments, which gives me the chance to work on my writing a lot more than I would have in any other class. Iím also taking Web Design this year, and I have to admit that I LOVE it. Weíre going to completely revamp the school website. At the moment, weíre working on Wordpress themes; they give people a chance to become more comfortable with CSS, so it should be fun. The only class Iím dreading is Entrepreneurship. I hate that I got stuck in it. Itís one of those ďjokeĒ classes, and itís really not my ~thing.</p>
<p>Once I get my <a href="http://erical nti.wordpress.com/2009/10/03/wordpress-theme-wip/">Wordpress Theme</a> done, Iíll start to update my portfolio more. Iím going to be joining the Newspaper club as well, so thatís when Iíll begin adding work to the ďwritingĒ section.</p>
<p>Hope everyone is doing well. I know I am :]!</p>
<p>Love always,<br />
Erica.</p>
<br />
<p align="right"><a href="/v3/index.php?id=10" title="permanent link to this post"><i>Permalink</i></a></p>
</div>
</div><!-- END .post -->
<div id="post9" class="post">
<div style="text-align: left; border-bottom: 2px solid #4E9CAA;"><h2 style="margin-bottom: 1px;">Those poor astronautsÖ</h2>
</div>

<div style="text-align: left; font-size: 8pt;">
<p class="catfile"><i>Posted <b>Aug 3, 2009</b>. Filed under <b><a href="/v3/index.php?c=2" title="all posts about Site">Site</a>.</b></i></p>
</div>

<div style="text-align:justify; padding:3px; margin-top:3px; margin-bottom:5px;">
<p>This morning, when I woke up, my oma (grandmother in German) decided to enlighten my mother and I on the subject of space. She informed us that what we think are stars in the night sky are actually astronauts that explode in space. Yes.. <em>astronauts</em>. </p>
<p>Foreign grandparents seem to have a knack for all things scientific, which probably explains my omaís dire need to watch the Discovery Channel every night before bed. </p>
<p>Itís a good thing that both my mother and I are educated enough in science to assume she was talking about <em>asteroids</em>, or else we might be ****ting some bricks over those poor astronauts dying.</p>
<p>On a lighter note, the site seems to be going well. I think Iím going to start hunting for some affiliates one of these days, and hopefully add some more content whenever I get a free moment. Other than that, things are looking good <img src="http://ericaftw.com/FanUpdate/img/" alt=":)" /></p>
<p>Now, if youíll excuse me, Iím going to try and decipher my omaís tale of some white horse biting people in the US..</p>
<p>Erica xo</p>
<br />
<p align="right"><a href="/v3/index.php?id=9" title="permanent link to this post"><i>Permalink</i></a></p>
</div>
</div><!-- END .post -->
<p class="paginate"><a href="/v3/?p=2" class="next">ę Previous page</a></p><!-- END .paginate --><div class="archivelink" align="center">
<form action="/v3/index.php" method="get">
<p>
<a href="/v3/index.php">main</a> &middot;
<a href="/v3/index.php?view=archive">archive</a> &middot;
<a class="rss" href="http://ericaftw.com/FanUpdate/rss.php">feed</a> &middot;
<input type="text" name="q" value="" />
<input type="submit" value="Search" class="button" />
</p>
</form>
</div><!-- END .archivelink -->

<div class="credit" align="center">
<p>Powered by <a href="http://prism-perfect.net/fanupdate" class="ext">FanUpdate 2.2.1</a></p>
</div><!-- END .credit -->
</div><!-- END #fanupdate -->
</div>
</div>

<div id="footer">
<span id="buttons">
<a href="http://www.facebook.com/ericalenti" onmouseover="stm(Text[0],Style[0])" onmouseout="htm()"><img src="images/buttons/facebook.png" alt="" border="0" /></a>
<a href="http://ericaftw.livejournal.com" onmouseover="stm(Text[1],Style[1])" onmouseout="htm()"><img src="images/buttons/livejournal.png" alt="" border="0" /></a>
<a href="http://www.myspace.com/junkie87" onmouseover="stm(Text[2],Style[2])" onmouseout="htm()"><img src="images/buttons/myspace.png" alt="" border="0" /></a>
<a href="http://www.twitter.com/ericaftw" onmouseover="stm(Text[3],Style[3])" onmouseout="htm()"><img src="images/buttons/twitter.png" alt="" border="0" /></a>
<a href="http://www.last.fm/user/ericaftw" onmouseover="stm(Text[4],Style[4])" onmouseout="htm()"><img src="images/buttons/lastfm.png" alt="" border="0" /></a>
<a href="http://ericalenti.wordpress.com" onmouseover="stm(Text[5],Style[5])" onmouseout="htm()"><img src="images/buttons/wordpress.png" alt="" border="0" /></a>
<a href="http://www.youtube.com/user/ericaftw" onmouseover="stm(Text[6],Style[6])" onmouseout="htm()"><img src="images/buttons/youtube.png" alt="" border="0" /></a>
</span>
<span id="copyright">website design by erica lenti / <a href="#">xhtml</a> &amp; <a href="#">css</a> / <a href="credits.php">credits</a></span> </div>
</div>
</div>

EricaL
12-23-2009, 10:33 PM
Thanks for your response.

I neglected the fact that I am using a content management system and that's where the error is, apparently. However, I don't think the archive link is the problem - it has an opening tag:


<div class="archivelink" align="center">
<p>
<a href="/v3/index.php">main</a> &middot;

<a href="/v3/index.php?view=archive">archive</a> &middot;
<a class="rss" href="http://ericaftw.com/FanUpdate/rss.php">feed</a> &middot;
<input type="text" name="q" value="" />
<input type="submit" value="Search" class="button" />
</p>
</form>
</div><!-- END .archivelink -->

SB65
12-24-2009, 10:38 AM
You're right, there is an opening div tag for that.

I just think you've got one too many closing div tags right at the end of your html.

EricaL
12-24-2009, 07:26 PM
I found the error. In my footer.php page, there was a closing div tag (I must have forgotten to remove it during editing) with no corresponding opening tag.

Thanks for your help.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum