I am currently trying to learn HTML5, following smashing html5 book. they provide this code-
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8”>
<style type=”text/css”>
body {
background-color:#fbf7e4;
font-family:Verdana, Geneva, sans-serif;
margin-left:20px;
color:#8e001c;
}
#h1 {
background-color:#8E001C;
color:#e7e8d1;
font-family:”Arial Black”, Gadget, sans-serif;
text-align:center;
}
h2 {
background-color:#424242;
color:#d3ceaa;
font-family:”Trebuchet MS”, Arial, Helvetica, sans-serif;
margin-left:5px;
}
</style>
<title>CSS3-Embedded Stylesheet</title>
</head>
<body>
<h1>This Is the Big Head</h1>
<h2> Here Is the Second Head</h2>
The body text is styled for a bit of a eft margin and picks up the color of the body
along with its font. Notice that the background of the heads extends all the way
across the page. Also notice that a space (& nbspgives the h2 text a ittle
indent so that it stays “within” the background. That’s not a problem with the h1
head because it’s centered.
</body>
</html>
when i put it in a text editor, it does not have any styling. Anyone help me out?
Alan



gives the h2 text a ittle
Reply With Quote



Although that code looks fine above, what you actually have is this:
Glad I could help.
Bookmarks