css樣式使用執行個體

來源:互聯網
上載者:User

//css樣式的書寫
//元素ID
#tb1{width:100%;height:80px;background-color:#FFD700;padding:4px;font-family:verdana,tahoma;font-weight:bold;}
#tb2{width:100%;padding:4px;font-family:verdana,tahoma;margin:12px 0px 0px 0px;background-color:#EEEEEE;font-weight:bold;}
//類
.test{cursor:hand;
    border-right: white thin inset;
    border-top: black thin inset;
    border-left: black thin inset;
    border-bottom: white thin inset;  
    }
.post1
{
 cursor:move; background:red; color:Navy; border-right: black thin inset;
}
//元素
body
{
 background-color:Gray:
}

//css樣式的運用
<html>
<head runat="server">
    <title>無標題頁</title>
    //引入css樣式檔案
    <link type ="text/css" rel = "stylesheet"  href = StyleSheet.css />
</head>
//樣式元素的應用,元素名字相同自動套用
<body>
    <form id="form1" runat="server">
    <div>
        //樣式元素ID的應用
        <table id = "tb1" border = 1; type = "font-size;13pt; align;center;">
            <tr>
                //自己使用css樣式style=樣式
                <td style="width: 134px; height: 19px">dsfdf</td>
            </tr>
        </table>
    </div>
        <table id = "tb2" style="width: 168px">
            <tr>
                //樣式類的應用
                <td class = "post1">啊啊啊啊啊啊啊啊</td>
            </tr>     
        </table>
    </form>
</body>
</html>

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.