html5中怎样分区块?

html5中怎样分区块?,第1张

html5可以将网页分块, 网页分块意味着将一个页面划分为几个独立的部分,包括内容、菜单、头部、底部、链接等, 这些只要使用一些新的标签

1、<header>网站头部标签

2、<nav>导航标签

3、<article>内容标签

4、<section>文章标签

5、<aside> 侧边栏

6、<footer>网站底部标签

可以通过DIV来分块布局,然后通过CSS样式来调整大小,颜色等样式。参考代码如下:

<!DOCTYPE html>

<html>

<head>

<style>

#header {

background-color:black

color:white

text-align:center

padding:5px

}

#nav {

line-height:30px

background-color:#eeeeee

height:300px

width:100px

float:left

padding:5px

}

#section {

width:350px

float:left

padding:10px

}

#footer {

background-color:black

color:white

clear:both

text-align:center

padding:5px

}

</style>

</head>

<body>

<div id="header">

<h1>第一层</h1>

</div>

<div id="nav">

第二层左侧

</div>

<div id="section">

第二层右侧

</div>

<div id="footer">

第三层

</div>

</body>

</html>


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/tougao/11707594.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-18
下一篇 2023-05-18

发表评论

登录后才能评论

评论列表(0条)

保存