Help - Search - Members - Calendar
Full Version: Why isn't this piece of text showing up?
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
DaneClark
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<h1>
<font size="35" face="Arial">
<center>
This is a main header
<link rel="stylesheet" href"main header.css" type "text/css" />
<title>Module 5 assignment
<style type="text/css">
</style>
</head>
<body>
<p>
<font size="24" face="Times"color="red">
<CENTER>
This is the first sub-header
</CENTER>
</font>
</p>






Why isn't the piece of text I have in bold showing up on my page?
Brian Chandler
The first error is on line 4: you can't have <h1> inside <head>.

The rest of the syntax is all jumbled -- start by reading an elementary tutorial on how to write an HTML document.

I can't see "why" the bit in bold doesn't appear -- perhaps "because" you have not closed the <title> tag?
pandy
Yeah, because the closing tag for TITLE is omitted, making the rest of the document part of the title as some browsers may see it.

But as Brian hinted at, you need to start over. Check that all elements that should have a closing tag really have that. Remove the closing slash in the LINK tag. Those slashes are used in XHTML, but are errors in HTML. Study the basic structure of an HTML document and which elements can contain which. The HTML Reference is handy for that. For instance, if you look up P, close to the top you can read what other elements P can contain.


Contents Inline elements


CENTER is a block-level element, so it can't be inside P.

Befriend yourself with the validator. It may seem daunting at first, but it really speeds up your learning. Just ask if there's something you don't understand. smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.