I am taking an entry level HTML class online for school, pretty basic stuff (but new to me). So, i write up my pages, and periodically save my work and then open it my browser (Mozilla FireFox, which happens to be the browser the school uses exclusively and recomends all students use for everything) and everything appears fine and there are no errors, everything works and displays perfectly. I email my asingments in, and my teacher emailes me back saying that I am recieveing no credit at all because when she opens my page, she sees nothing and tells me there are errors on it, and that I am missing a lot of tags, blah blah blah.
now, would someone please explain to me why when i open my page in a browser, everything works and displays correctly and there is essentailly nothing visibly wrong with the page, yet the teacher cannot even view it and tells me about all these erros in my code that are making it not display? its just a very short 1 page assingment, and if someone would like i will post my code up so they can tell me what I am doing wrong. I sent the teacher back and e-mail contesting the grade and included a screan shot of what i see when I open the page in my browser.
well, I cant exactly post a link to the page, because it isnt online anywhere, but heres the code, and below that is a screen shot of what I see when i open it in my browser:
<html>
<title>Traveling The World</title>
<body text=“#000000” bgcolor=“#c0c0c0”>
<h1 align=“center”>
<font color=“maroon” face=“arial”>My Travels Of 2006: Photos</font></h1>
<hr width=“80%” noshade=“noshade” color=“maroon”/>
<h2 align=“left”><i>Cities In the US</i></h2>
<ul>
<ul type="circle>
<li>New York City</li>
<li>Chicago</li>
<li>Boston</li>
<li>Miami</li>
</ul type=“circle”>
<p> </p>
<h3>
New York City
</h3>
well now im really confused because thw W3C validator thing is telling me that i cant have all this stuff in there that the textbook says i need in there.
i am not sure which browser she is using. does it make a difference? and if my code is ‘wrong’ according to her, then why does it display ok FF and not in another borwser (assuming she is using IE or something else).
and how would I go about doing coding with a style tag?
You should only use tables for tabular data, not for displaying normal content. That should be done with span and div tags.
And yes, your code will not pass the validator. I’d imagine it may look fine on internet explorer, but on other browsers such as firefox, that are more strict with coding standards, it would fail. That is most likely your teachers problem.
Dont use <p></p> just to add spacing. Paragraph tags should be used as block level elements to hold content. If you just need to add spacing, use line break tags like this:
<br />
Also, your <ul></ul> tags should not contain the text “type=circle”. If for some reason you need it in the opening tag, you do not also need it in the closing tag. Closing tags shoudl always just be the slash and the tag.
Sometimes you have to use for multiple spaces. HTML only can see one space at a time, so if for some reason you need too show more then one space, that works very well. There is a large list of web-compliant codes, and one of them is that non-breaking space character.
depending upon the browser…some are more forgiving than others.
the style related things that others are talking about will not make or break a page. (like the table versus <p> tags, head tag…whatever). at worst, something like ff might not render a box in a table with a decent amount of width if it is empty…but that won’t ‘break’ anthing.
however, depending upon how persnickity the instructors code viewer is you have a pretty glaring non-compliant HTML structure.