Tuesday, March 12, 2013

CSS precedence

what will happen here?

<head runat="server">
    <title>Untitled Page</title>
    <style type ="text/css"  >
        .testClass{color:red ; font-family:Calibri;background-color:Purple; font-size:xx-small  }
        #testID{color:blue ; font-size:x-large  }
        p {color:Green  ; background-color:Gray; font-size:small }
        html { font-size :xx-large  }  
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <p  class ="testClass"  id = "testID"   >
    dsfsdfdsf<br/>
    sdfsdf<br/>
    </p>
    </div>
    </form>
</body>
</html>

Style overrides ID that  overrides class that overrides element

No comments:

Post a Comment