当前位置: 首页 > news >正文

CSS学习11--版心和布局流程以及几种分布的例子

版心和布局流程

  • 一、版心
  • 二、布局流程
  • 三、一列固定宽度且居中
  • 四、两列左窄右宽
  • 五、通栏平均分布型

一、版心

版心:是指网页主题内容所在的区域。一般在浏览器窗口水平居中位置,常见的宽度值为960px、980px、1000px、1200px等。

二、布局流程

为了提高网页制作的效率,布局时需要遵守一定的布局流程,具体如下:

  • 确定页面版心
  • 分析页面中的行模块,以及每个行模块中的列模块
  • 制作HTML结构
  • CSS初始化,然后开始运用盒子模型的原理,通过CID+CSS布局来控制网页的各个模块

三、一列固定宽度且居中

<html><head><style>* {padding: 0;margin: 0;}.top,.banner,.main,.footer {width: 960px;margin: 10px auto;text-align: center;}.top {height: 100px;background-color: pink;}.banner {height: 120px;background-color: skyblue;}.main {height: 500px;background-color: red;}.footer {height: 150px;background-color: #ccc;}</style></head><body><div class="top">top</div><div class="banner">banner</div><div class="main">main</div><div class="footer">footer</div></body>
</html>

四、两列左窄右宽

<html><head><style>* {padding: 0;margin: 0;}.top,.banner,.main,.footer {width: 960px;margin: 10px auto;text-align: center;}.top {height: 100px;background-color: pink;}.banner {height: 120px;background-color: skyblue;}.main {height: 500px;background-color: red;}.footer {height: 150px;background-color: #ccc;}.main .left {width: 360px;height: 500px;float: left;background-color: white;}.main .right {width: 590px;height: 500px;margin-left: 10px;float: left;background-color: white;}</style></head><body><div class="top">top</div><div class="banner">banner</div><div class="main"><div class="left">left</div><div class="right">right</div></div><div class="footer">footer</div></body>
</html>

五、通栏平均分布型

<html><head><style>* {padding: 0;margin: 0;}ul {list-style: none;}.top,.banner,.main,.footer {width: 960px;margin: 10px auto;text-align: center;}.top {height: 100px;background-color: pink;}.banner {height: 120px;background-color: skyblue;}.main {height: 500px;background-color: red;}.footer {height: 150px;background-color: #ccc;}.main ul li:nth-child(odd) {width: 240px;height: 240px;background-color: deeppink;float: left;}.main ul li:nth-child(even) {width: 240px;height: 240px;background-color: hotpink;float: left;}</style></head><body><div class="top">top</div><div class="banner">banner</div><div class="main"><ul><li>1</li><li>2</li><li>3</li><li>4</li></ul></div><div class="footer">footer</div></body>
</html>
http://www.lryc.cn/news/432049.html

相关文章:

  • NetSuite AI 图生代码
  • Java - BigDecimal计算中位数
  • Tensorflow2如何读取自制数据集并训练模型?-- Tensorflow自学笔记13
  • JVM系列(七) -对象的内存分配流程
  • Apache Ignite 在处理大规模数据时有哪些优势和局限性?
  • 怎么利用NodeJS发送视频短信
  • WebAPI(三)、 DOM 日期对象Date;获取事件戳;根据节点关系查找节点
  • 012.Oracle-索引
  • SSL 证书 | 免费获取与自动续期全攻略
  • 达梦数据库管理员常用SQL(一)
  • HttpUtils工具类(三)OKHttpClient使用详细教程
  • 重生奇迹MU老大哥剑士职业宝刀未老
  • 关于Netty详细介绍,Netty原理架构解析
  • 在Unity环境中使用UTF-8编码
  • 零工市场小程序:自由职业者的日常工具
  • 【Http 每日一问,访问服务端的鉴权Token放在header还是cookie更合适?】
  • vue2+ueditor集成秀米编辑器
  • [网络]HTTP协议 Cookie与Session
  • 安宝特科技 | AR眼镜在安保与安防领域的创新应用及前景
  • 2024 第十二届重庆国际植保双交会暨新型肥料农药产业博览会
  • 用“说”智能控制灯具开关语音识别芯片NRK3603
  • APS开源源码解读: 排程工具 optaplanner
  • AMEYA360:村田量产用于汽车市场的高可靠性0603M铜电极负温度系数NTC热敏电阻
  • 代码随想录第十天|150.逆波兰表达式求值 239.滑动窗口的最大值 347.前K个高频元素
  • [阅读笔记]《解读基金—我的投资观与实践》— 季凯帆
  • 2.3之前
  • 处理器基础知识——cache
  • 操作系统的运行环境
  • 如何在 Selenium 中获取网络调用请求?
  • IP学习——oneday