CSS problems with I.E

Discussion in 'CSS' started by emcharl, Aug 23, 2006.

  1. #1
    Hi,

    First of all im a newbie when it comes to css so please be patient with me!
    Im working with external css.

    My main problem is that the CSS works perfectly in Firefox but in I.E it just doesnt work.

    I have used the W3C CSS Validator and its fine, no warnings or errors. Also my html validates apart from where i have some style errors where ive messed up in the stylesheet i guess.

    Problem 1.

    I want my links to align left (fine in FF) but they are centered in I.E, heres what i have -

    a:link {font-weight:bold;
    font-size:17px;
    font-family: "Times New Roman", sans-serif;
    color:#462D44;
    background-color:#9DAF72;
    }

    Problem 2.

    My different styles. I need like 5 different sizes of content, at the moment ive written them like this - Again fine in FF not working in I.E. In the html i have something like - <style1>Emele Website</style1> in the html.
    Ive read about P tags but then i wasnt sure how i defined more than 1 style using that.... I realise i have totally messed up on this style/content part! Ive read lots of info but i just cant get my head around it all.......


    style1 {font-family:"Times New Roman", sans-serif;
    font-size:36px;
    color:#000000;
    background-color:#CCCCCC
    }

    style2 {font-family:Arial, sans-serif;
    font-size:12px;
    color:#FF0033;
    background-color:#FFFFFF
    }

    style5 {font-weight:bold;
    font-size:16px;
    font-family:"Times New Roman", sans-serif;
    color:#000000;
    background-color:#9DAF72;
    text-align:left
    }

    All help appreciated + pointers in the right direction.

    Emily
     
    emcharl, Aug 23, 2006 IP
  2. Gordaen

    Gordaen Peon

    Messages:
    277
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    For the first question, your links will default to whatever alignment their parent element has. If they are in a P tag that is centered, they will be centered.

    For the second question, you should learn about classes. You would use them something like this:

    CSS:
    p.style1 {font-family:"Times New Roman", sans-serif;
    font-size:36px;
    color:#000000;
    background-color:#CCCCCC
    }

    HTML:
    <p class="style1">This stuff is styled like style1</p>

    I'd also recommend not using pixels to specify font sizes. Instead, try using em units.
     
    Gordaen, Aug 23, 2006 IP
  3. emcharl

    emcharl Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks, I will play around with it. :)
     
    emcharl, Aug 24, 2006 IP