CSS left div fixed, right div adaptive_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:27:05
Original
1210 people have browsed it

Sometimes we have such needs, as shown in the picture, aside is the navigation or some links, the main on the right is to display important content, the width on the left needs to be fixed, and the main on the right can adapt to the rest. Width:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>    <title>test</title>    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    <meta http-equiv="Content-Language" content="zh-CN" />    <meta name="Keywords" content="" />    <meta name="Description" content="" />    <!-- <link rel="stylesheet" href="style/.css" type="text/css" /> -->    <style type="text/css">        *{margin:0; padding:0;}        /* div{border:1px solid #CCC;} */        .home{width:70%; min-width:270px;margin:0 auto;}        .header{height:80px; width:100%; background:#CCC}        .nav{height:50px; width:100%; background:#bbb}        .content{}        .content .aside{width:260px; height:400px; float:left; background:#999}        .content .main{height:400px; margin-left:260px; overflow:hidden;zoom:1; background:#eee}        .footer{height:80px; background:#888;}    </style></head><body>    <div class="home">        <div class="header">            header        </div>        <div class="nav">            nav        </div>        <div class="content">            <div class="aside">aside</div>            <div class="main">main</div>        </div>        <div class="footer">            footer        </div>    </div></body></html>
Copy after login

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!