SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2011
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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>&nbsp;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

  2. #2
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,171
    Mentioned
    264 Post(s)
    Tagged
    5 Thread(s)
    Yes. Although that code looks fine above, what you actually have is this:

    Attachment 59827

    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.

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2011
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TechnoBear View Post
    Yes. Although that code looks fine above, what you actually have is this:

    Attachment 59827

    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!

  4. #4
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,171
    Mentioned
    264 Post(s)
    Tagged
    5 Thread(s)
    They showed up squinty when I copied/pasted your code into my editor.

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

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2011
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TechnoBear View Post
    Yes. Although that code looks fine above, what you actually have is this:

    Attachment 59827

    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.
    Quote Originally Posted by TechnoBear View Post
    They showed up squinty when I copied/pasted your code into my editor.

    I noticed, too, that the CSS contains #h1. That implies that something has id=h1; I suspect it should just read h1.
    mate, you are truly a 'geezer' 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

  6. #6
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,171
    Mentioned
    264 Post(s)
    Tagged
    5 Thread(s)
    Excellent. Nothing like getting two problems solved for the price of one. Glad I could help.

  7. #7
    SitePoint Enthusiast
    Join Date
    Mar 2011
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TechnoBear View Post
    Excellent. Nothing like getting two problems solved for the price of one. 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...!

  8. #8
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,171
    Mentioned
    264 Post(s)
    Tagged
    5 Thread(s)
    Quote Originally Posted by confusedone View Post
    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?
    I most certainly would, although I may be just a wee bit biased. 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.
    Quote Originally Posted by confusedone View Post
    Sorry to derail thread a bit...!
    As it's your thread, I doubt anyone will complain too much.

  9. #9
    SitePoint Enthusiast
    Join Date
    Mar 2011
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok looking at your avi I can see the bias I'll kick around for a bit and see what is what !


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •