码迷,mamicode.com
首页 > Web开发 > 详细

CSS3 auto revolution practitioner!

时间:2016-07-25 16:18:28      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:

1.html

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="utf-8" />
    <link href="styles/autoresolution.css" rel="stylesheet" />
</head>
<body>
    <div class="page">
        <div class="left">
            left
        </div>
        <div class="right">
            right
        </div>
        <div class="clear">

        </div>
        <div class="bottom">
            bottom
        </div>

    </div>
</body>
</html>

  2.style sheet

body {
    width: 100%;
}

/*basic universal settings for page main parts*/
.page {
    background-color: #fff;
}

    .page > .left {
        background-color: #f00;
        float: left;
    }

    .page > .right {
        background-color: #f0f;
        float: right;
    }

    .page > .bottom {
        background-color: #00f;
        width: 100%;
    }

.clear {
    clear: both;
}


/*page width bigger than 1024 strategy*/
@media screen and (min-width:1024px) {
    .left {
        width: 40%;
    }

    .right {
        width: 60%;
    }
}

@media screen and (max-width:1024px) {
    .left {
        width: 100%;
    }

    .right {
        width: 100%;
    }
}

  

CSS3 auto revolution practitioner!

标签:

原文地址:http://www.cnblogs.com/hualiu0/p/5703784.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!