• We experienced a brief downtime due to a Xenforo server configuration update. This was an attempt to limit bot traffic. They have rolled back and the site is now operating normally. Apologies for the inconvinience.

Why is my header not centering? (HTML 5, CSS)

Sundancer

Cynicist
Joined
Feb 16, 2004
Messages
3,208
Reaction score
198
Points
73
Here is the code below in HTML 5. I'm also trying to figure out why my browser (Firefox) isn't adding margins.

<!DOCTYPE html>
<html lang="en">
<head>
<title>HTML Example</title>
<meta charset="utf-8">
<style>

body { background-color:#d1affe;
font-family:Arial, Verdana, sans-serif
margin-left: auto
margin-right:auto;
)

p { font-size:.90em;
text-indent: 3em;

h1 {text-align: center;
font-family:Georgia, "Times New Roman", serif;
}

h2 {text-align: center;}

</style>
<body>
<h1>John Smith</h1>
<br>
<p>Welcome to my demonstration of HTML format! Knowing basic HTMl and formatting for
Web pages is essential for many librarians. I have had several library positions though I have yet to be in one in which I create
Web content. That is a reason to learn. Libraries now thrive on technology for communication, providing information and outreach
purposes. Here are the library titles I've held over the years:</p>
</body>





I found a similar code that does work. I don't see the difference.



<!DOCTYPE html>
<html lang="en">
<head>
<title>Trillium Media Design</title>
<meta charset="utf-8">
<style>
body { background-color:#E6E6FA;
color:#191970;
font-family:Arial, Verdana, sans-serif;
}
h1 { background-color:#191970;
color:#E6E6FA;
line-height: 200%;
font-family:Georgia, "Times New Roman", serif;
}
h2 { background-color:#AEAED4;
color:#191970;
font-family:Georgia, "Times New Roman", serif;
text-align: center;
}
p { font-size:.90em;
text-indent: 3em;
}
ul {font-weight:bold;
}
</style>
</head>
<body>
<h1>&nbsp;Trillium Media Design</h1>
<div><a href="index.html">Home</a> <a href="services.html">Services</a> <a href="contact.html">Contact</a></div>
<h2>New Media and Web Design</h2>
<p>Trillium Media Design will bring your company's Web presence to the next level.
We offer a comprehensive range of services: </p>
<ul>
<li>Website Design</li>
<li>Interactive Animation</li>
<li>E-Commerce Solutions</li>
<li>Usability Studies</li>
<li>Search Engine Optimization</li>
</ul>
<h2>Meeting Your Business Needs</h2>
<p>Our expert designers are creative and eager to work with you.
Take advantage of the power of Web 2.0!</p>
<div>Copyright &copy; 2012 Your Name Here</div>
</body>
</html>
 
Last edited:

Users who are viewing this thread

Staff online

Latest posts

Forum statistics

Threads
200,632
Messages
21,776,981
Members
45,615
Latest member
TheCat
Back
Top
monitoring_string = "afb8e5d7348ab9e99f73cba908f10802"