HTML5 question from a newbie

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 (& nbsp;) gives 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

Yes. :slight_smile: Although that code looks fine above, what you actually have is this:

Instead of “normal” quotation marks, you have some weird slanting quotation marks (which no doubt have a proper technical name :)). Replace them and you’re good to go.

Fantastic thanks!!! How did you even spot that? i am pretty newish to web design and was looking at it thinking, well there are only 3 ways to add css, and i’m following all the rules, all the tags are in place etc…

Many many thanks!

[FONT=Verdana]They showed up squinty when I copied/pasted your code into my editor. :slight_smile:

I noticed, too, that the CSS contains #h1. That implies that something has id=h1; I suspect it should just read h1.[/FONT]

mate, you are truly a ‘geezer’ :slight_smile: I was just looking at the header wondering why it is the only element that hasn’t been styled -i forgot, when i was trying to work out why it wasn’t getting styled i changed the <h1> to div tags and see what was going on. Forgot to delete the hash tag, doh!

Kind regards, Alan

Excellent. Nothing like getting two problems solved for the price of one. :lol: Glad I could help.

And argyll too, nice to meet someone from the UK! To be honest i haven’t been that active on this forum and have been looking for a decent and active forum that is more web-related. would you recommend this forum? Sorry to derail thread a bit…!

I most certainly would, although I may be just a wee bit biased. :lol: Seriously, there are a lot of knowledgeable folk around here and I’ve learned a good deal, so yes, I’d say stick around - it’s well worth it.

As it’s your thread, I doubt anyone will complain too much. :slight_smile:

Ok looking at your avi I can see the bias :slight_smile: I’ll kick around for a bit and see what is what !