CSS 笔记

引用外部CSS。注意是 href,不是src。

<link href=”img/divcss5.css” rel=”stylesheet” type=”text/css” />

float属性似乎对div更有效

<html>
    <head>
        <title>标题</title>
        <style type="text/css">
            body{
                padding:0px;
                margin:0px;
            }
            .container{
                position:relative;
                width:950px;
                margin-left:auto;
                margin-right:auto;
                height:100%;
                background-color:#FF0000;
            }
            .left{
                float:left;
                background-color:#DDD;
                width:80%;
                height:100px;
            }
            .right{
                float:right;
                background-color:#AAA;
                width:20%;
                height:100px;
            }
        </style>
    </head>
    <body>
        <div class="container">
            <div class="left">左边</div>
            <div class="right">右边</div>
        </div>
</body>
</html>

 

“清除”控件高亮色

-webkit-tap-highlight-color:rgba(0,0,0,0);