Creates a style that targets one of more of the classes you have defined. - HTML CSS HTML Global Attribute

HTML CSS examples for HTML Global Attribute:class

Description

Creates a style that targets one of more of the classes you have defined.

Demo Code

ResultView the demo in separate window

<!DOCTYPE HTML>  
<html>  
    <head>      
        <title>Example</title>  
        <style type="text/css">  
            .class2 {  <!-- w  w  w  .ja v a 2s . c  o  m-->
                background-color:red;  
                color:white;  
                padding:5px;  
                margin:2px;  
            }  
            .class1 {  
                font-size:x-large;  
            }  
        </style>  
    </head>  
    <body>  
        <a class="class1 class2" href="http://java2s.com">web site</a>  
        <p/>  
        <a class="class2 otherclass" href="http://w3c.org">W3C web site</a>          
    </body>  
</html>  

Related Tutorials