加入收藏 | 设为首页 | 会员中心 | 我要投稿 焦作站长网 (https://www.0391zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 系统 > 正文

CSS实现页面两列布局与三列布局的方法示例

发布时间:2020-03-13 21:19:39 所属栏目:系统 来源:站长网
导读:这篇文章主要介绍了CSS实现页面两列布局与三列布局的方法示例,包括宽度与高度的自适应的示例,需要的朋友可以参考下

                height:50px;     

            }     

        #middle {     

            position:absolute;     

            width:100%;     

            height:auto;     

            top100px;     

            bottombottom:50px;                       

        }     

        .left {     

            width: 15%;    /*这里是百分比或者像素值,对应下面的center就是百分比或者像素值*/     

            backgroundred;     

            floatleft;     

            height:100%;     

        }     

        .rightright {     

            width: 15%;  /*这里是百分比或者像素值,对应下面的center就是百分比或者像素值*/     

            height: 100%;     

            background: pink;     

            floatrightright;     

        }     

        .center {     

            height: 100%;     

            backgroundgreen;     

            /*两种方式均可(一)margin(二)margin-left、margin-right*/     

            /*(一)、用这种方式上面的left和right中的width是百分比或者像素值都可以*/     

            marginauto;         

            /*(二)、这里是百分比或者像素值,对应上面的left、right中的width就是百分比或者像素值*/     

            /*margin-left:15%;        

            margin-right:15%;*/     

        }     

        #footer {     

            backgroundblue;     

            height50px;     

            width: 100%;     

            positionabsolute;     

            bottombottom: 0;     

        }     

    </style>     

</head>     

<body>     

    <form id="form1" runat="server">     

        <div>     

            <div id="header">     

                上       

(编辑:焦作站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

推荐文章
    热点阅读