treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Need Help with my website CSS.

  • Hello, My name is Mena, I'm Learning CSS more and more but i have problems with my website http://tangyandbrightdesigns.com css in IE9, and setting a specified css file for IE9 is kind a problem for me.

    could you help me out how to adjust my current CSS file or resources to help me figure it out right.

    Thank you,
    Mena
  • if you put these conditional comments at the beginning of your page just after the doctype you can use the html class to style for IE

    <!--[if lt IE 7]><html class="ie6"><![endif}-->
    <!--[if IE 7]><html class="ie7"><![endif]-->
    <!--[if IE 8]><html class="ie8"><![endif]-->
    <!--[if IE 9]><html class="ie9"><![endif]-->
    <!--[if (gt IE 9)|!(IE)]><!--><html class=""><!--<![endif]-->


    Just put the class .ie9 before the class or id you want to style

    for example

    .my-margins{
    margin:10px;
    }

    .ie9 .my-margins{
    margin:20px;
    }


    The conditional comments add a class to every html element on you page. If the visitor is using IE7 it adds the .ie7 class. If the visitor is using IE9 it adds the .ie9 class.

    Check out Paul Irish's site for further explanation here.
  • thank you :), will try it.