...

View Full Version : Why is HTML presented in this way...?



BabyJack
05-21-2008, 12:14 PM
...
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb">
<head>
<title>Semantically Rich Document Example</title>
</head>
<body>
<div id="banner"><h1>Semantically Rich Document Example</h1></div>

<div id="navigation">
<ul>
<li>Home</li>
<li>About</li>
<li>Contact</li>
</ul>
</div>

<div id="content">
<h2>Lorem Ipsum Dolor Sit Amet</h2>
<p>Lorem ipsum dolor sit amet</p>

<h2>Lorem Ipsum Dolor Sit Amet</h2>
<p>Lorem ipsum dolor sit amet</p>
</div>

</body>
</html>

Usually, my HTML code is like this:

<!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 name="generator" content="HTML Tidy for Linux (vers 1 September 2005), see www.w3.org" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link href="styles.css" rel="stylesheet" type="text/css" />

<link href="EA.ico" rel="Shortcut Icon" />

<body onLoad="goforit()">

<div id="logo"><div id="clock"><script>

var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")

var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")



function getthedate(){

var mydate=new Date()

var year=mydate.getYear()

if (year < 1000)

year+=1900

var day=mydate.getDay()

var month=mydate.getMonth()

var daym=mydate.getDate()

if (daym<10)

daym="0"+daym

var hours=mydate.getHours()

var minutes=mydate.getMinutes()

var seconds=mydate.getSeconds()

var dn="AM"

if (hours>=12)

dn="PM"

if (hours>12){

hours=hours-12

}

if (hours==0)

hours=12

if (minutes<=9)

minutes="0"+minutes

if (seconds<=9)

seconds="0"+seconds

//change font size here

var cdate="<small><font color='000000' face='Century Gothic' weight='normal'><b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+":"+seconds+" "+dn

+"</b></font></small>"

if (document.all)

document.all.clock.innerHTML=cdate

else if (document.getElementById)

document.getElementById("clock").innerHTML=cdate

else

document.write(cdate)

}

if (!document.all&&!document.getElementById)

getthedate()

function goforit(){

if (document.all||document.getElementById)

setInterval("getthedate()",1000)

}



</script></div>

<span id="clock"></span></div>



<title>Wifeeee! Sensational Simming Summer</title>



<style type="text/css">

/*<![CDATA[*/

div.c2 {text-align: center}

div.c1 {clear:both;}

/*]]>*/

</style>

</head><body>

<body onload="new Accordian('basic-accordian',5,'header_highlight');">



<div id="thanks"><div id="official">Employee? Log in <a href="Employees.php">here</a>!</div><form id="login"> Username: <input type="text" class="theInput" name="user" value="Username" onClick="reset" />

Password: <input type="password" class="theInput" name="password" value="password" />

<input type="submit" name="Submit" class="theSubmit" value="Login!" />

</form>

</div>

<div id="wrapper">

<div id="nav">
<h1>Main Navigation</h1>

<a href="/index.php">Home :)</a><br />

<a href="/downloads/index.php">Downloads</a><br />

<a href="/tutorials/index.php">Tutorials</a><br />

<a href="/information/info.php">Information</a><br />

<a href="/media/index.php">Media</a><br />

<a href="/misc/upcoming.php">Upcoming</a><br />



<h1>Resources Navigation</h1>

<a href="/resources/avatars">Avatars</a><br />

<a href="/resources/blends">Blends</a><br />

<a href="/resources/icons">Icons</a><br />

<a href="/resources/templates">Templates</a><br />

<a href="/resources/guides">Guides</a><br />



<h1>Community</h1>

<a href="/community/forums">Wifee Forums</a><br />

<a href="/community/guestbook">Guestbook</a><br />

<a href="/community/chatroom">Chatroom</a><br />

<a href="/community/competitions">Competitions</a><br />

<h1>Miscellaneous</h1>

<a href="/misc/site_history.php">Site History</a><br />

<a href="/misc/games.php">Games</a><br />

<a href="/misc/books.php">Books and Poetry</a><br />

<a href="/misc/movies.php">Movies</a><br />

<a href="/misc/music.php">Music</a><br />



<h1>Site Stats</h1>

<strong>Webmaster</strong> - BabyJack<br />

<strong>Forum Status</strong> - Offline<br />

<strong>Online Users</strong> - <script type="text/javascript" src="http://freeonlineusers.com/on1.php?id=94654"> </script> Simmers Online


<h1>Partner Sites & Affiliates</h1>
<a href="http://simsmad.co.uk" target="_blank">Simsmad.co.uk<br />
</a><a href="http://www.missingstudios.com" target="_blank">Missing Studios</a>
</div>

<div id="content">





<div style="width:420px; margin-bottom:30px;">
<div><strong>Exclusive Screenshot!</strong></div>

<div style="text-align:justify; padding:3px; margin-top:3px; margin-bottom:5px; border-top:1px solid #D3D3D3;">Today, an image from MySims Kingdom was handed down to my sister, from EA.<br />Here is the image:<br /><img src="/media/images/Kingdom1.jpg"></div>

<div style="float: right;"><!-- no full story--> <a href="/index.php?subaction=showcomments&amp;id=1211361041&amp;archive=&amp;start_from=&amp;ucat=&amp;">0 Comments</a></div>

<div><em>Posted on 21 May 2008 by <a href="mailto:baby-jack@live.co.uk">Wifee</a></em></div>
</div><div style="width:420px; margin-bottom:30px;">
<div><strong>New Ford Download</strong></div>

<div style="text-align:justify; padding:3px; margin-top:3px; margin-bottom:5px; border-top:1px solid #D3D3D3;">New from TheSims2.com, comes the latest model of The Ford Escape Hybrid. This new model will bring a whole look into helping the environment for your Sims - equipped with the latest hybrid technology. The new download is obtainable from The Sims 2 Exchange.<br /><a href="http://thesims2.ea.com/getcoolstuff/ford/index.php" target="_blank">:: Download</a><br /><img src="/media/images/Car_Ford.jpg"></div>

<div style="float: right;"><!-- no full story--> <a href="/index.php?subaction=showcomments&amp;id=1211360565&amp;archive=&amp;start_from=&amp;ucat=&amp;">0 Comments</a></div>

<div><em>Posted on 21 May 2008 by <a href="mailto:baby-jack@live.co.uk">Wifee</a></em></div>
</div><div style="width:420px; margin-bottom:30px;">
<div><strong>All aboard!</strong></div>

<div style="text-align:justify; padding:3px; margin-top:3px; margin-bottom:5px; border-top:1px solid #D3D3D3;">With just a month left until the release of the SimCity Societies Expansion, Destinations, the first Hands On from IGN takes a look at some of the new features that we be accompanied with the new expansion - including the new island resort feature,<br /><br /><i>The new expansion tasks players with creating a five-star resort city that attracts a wide range of travelers and the disposable cash in their pockets. There are a number of different resorts you can build in your city, and you'll want to place them carefully because you can only have one of each kind.</i><br /><br /><br />There has also been a release of 19 new screenshots from IGN & GameSpot.<br />All images can be viewed in our SimCity Societies Destinations Gallery:<br /><br /><img src="http://www.infinitesims.com/mambots/content/multithumb/thumbs/b.100.100.16777215.0.stories.zoom.INSGPT.viewsize.026.jpg"><img src="http://www.infinitesims.com/mambots/content/multithumb/thumbs/b.100.100.16777215.0.stories.zoom.INSGPT.viewsize.022.jpg"></div>

<div style="float: right;"><!-- no full story--> <a href="/index.php?subaction=showcomments&amp;id=1211360522&amp;archive=&amp;start_from=&amp;ucat=&amp;">0 Comments</a></div>

<div><em>Posted on 21 May 2008 by <a href="mailto:baby-jack@live.co.uk">Wifee</a></em></div>
</div><div style="width:420px; margin-bottom:30px;">
<div><strong>Wifee Breakdown</strong></div>

<div style="text-align:justify; padding:3px; margin-top:3px; margin-bottom:5px; border-top:1px solid #D3D3D3;">Today, Wifee's main focus is the forums.<br />Ryan, from simsmad, is kindly helping us install a cool template. <br />We have ebolished the idea of integrating it into the site.<br /><br />Because you have been waiting for a while now, we have a surprise for you later on tomorrow =]<br /><br /><br />Until then, See you soon (even though the impossibility seeing you via the web is huge), BabyJack <img style="border: none;" alt="laughing" src="http://wifee.missingstudios.com/cutenews/data/emoticons/laughing.gif" /></div>

<div style="float: right;"><!-- no full story--> <a href="/index.php?subaction=showcomments&amp;id=1211214879&amp;archive=&amp;start_from=&amp;ucat=&amp;">0 Comments</a></div>

<div><em>Posted on 19 May 2008 by <a href="mailto:baby-jack@live.co.uk">Wifee</a></em></div>
</div><div style="width:420px; margin-bottom:30px;">
<div><strong>New Sims 3 Preview</strong></div>

<div style="text-align:justify; padding:3px; margin-top:3px; margin-bottom:5px; border-top:1px solid #D3D3D3;">PCGZine has posted a new Sims 3 Preview. Not much information is given off, but it covers the brief, in depth.<br /><br />Download: <a href="http://www.gamerzines.com/downloading-pcgzine_17.html" target="_blank">View (DOWNLOAD)</a><br /><br /></div>

<div style="float: right;"><!-- no full story--> <a href="/index.php?subaction=showcomments&amp;id=1211179315&amp;archive=&amp;start_from=&amp;ucat=&amp;">0 Comments</a></div>

<div><em>Posted on 19 May 2008 by <a href="mailto:baby-jack@live.co.uk">Wifee</a></em></div>
</div><p align="center"><< Previous <strong>1</strong> <a href="/index.php?start_from=5&amp;ucat=&amp;archive=&amp;subaction=&amp;id=&amp;">2</a> <a href="/index.php?start_from=5&amp;ucat=&amp;archive=&amp;subaction=&amp;id=&amp;">Next >></a></p><!-- News Powered by CuteNews: http://cutephp.com/ -->


</div>

<div class="c1"></div>

</div>

<div class="c2" id="footer">Copyright Wifee 2008 - Some Rights Reserved - Partly coded & Banner partly made by <a href="http://www.simsmad.co.uk" target="_blank"><em>Simsmad</em></a> - Design by Me. Hosted by <a href="http://www.missingstudios.com" target="_blank">Missing Studios</a></div>

</body>

</html>

VIPStephan
05-21-2008, 12:21 PM
What do you mean? The tab indents? That’s for better readability. You see much easier where an element is opened an closed if the contents of elements are indented than if it were in the same column.

It doesn’t matter to the browser, though, and will be interpreted the same with or without proper formatting (at least in most cases).

technica
05-21-2008, 12:22 PM
Are you getting any problem in this HTML or you just want to learn HTML structure?

BabyJack
05-21-2008, 12:23 PM
Thanks VIPStephan.

To technica: I was just wondering.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum