Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Mar 2013
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Why won't my heading work?

    In the head tag, I have...

    Code:
    <style type="text/css">
    h1 {
    text-decoraction:underline;
    font-size:200%;
    font-color:blue;
    }
    </style>
    In the body I have...

    Code:
    <h1>lorem ipsum</h1>
    The font-size works, the h1'd text is larger, but the underline and color don't work.

  • #2
    Banned
    Join Date
    Mar 2013
    Posts
    139
    Thanks
    0
    Thanked 9 Times in 9 Posts
    You need a new proof-reader for your code

    This is what it should be

    Code:
            <style type="text/css">
                h1 {
                    text-decoration:underline;
                    font-size:200%;
                    color:blue;
                }
            </style>

  • #3
    New Coder
    Join Date
    Mar 2013
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I don't get it -- the only difference is the use of whitespace. Do you HAVE to use whitespace like that when using CSS?

  • #4
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,957
    Thanks
    9
    Thanked 727 Times in 721 Posts
    If you look closer, you have a typo, and are using an incorrect property:

    Code:
    h1 {
    text-decoraction:underline;
    font-size:200%;
    font-color:blue;/*should be color*/
    }
    The css validator - see my sig - is useful for picking up this sort of thing.
    Use the W3C HTML Validator and CSS Validator to check your code and Firebug to see what css is applied to an element
    Read Steve Krug's book Don't Make Me Think - essential reading on web usability
    I don't recommend much, but I do recommend Clook for UK web hosting

  • #5
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,748
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    Hello SomethingFunny,
    No, you don't need to use any whitespace at all. This would be perfectly valid - h1{text-decoration:underline;font-size:200%;color:blue;}

    There is also a validator for your markup ... see my or SB's sig.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #6
    New Coder
    Join Date
    Mar 2013
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Whoops, didn't see the typo. Thanks ^_^


  •  

    Posting Permissions

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