这篇文章将为大家详细讲解有关HTML怎么制作一个简单的面页布局,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
互联网多数的网页都是由html编写的,html配合css布局做成一个简单的漂亮网页。
代码示例
<!DOCTYPE html>
<html>
<head>
<title>css网页布局 </title>
<meta charset="utf-8">
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
}
.header {
background-color: #f1f1f1;
}
.topnav {
overflow: hidden;
background-color: #f61137;
}
.topnav a {
float: left;
color: #0017f9;
padding: 10px 100px;
text-decoration: none;
}
.topnav a:hover {
background-color:#7efe51;
</style>
</head>
<body>
<div class="responsive">
<div class="img">
<a target="_blank" href="//static.runoob.com/images/demo/demo1.jpg">
<img src="//static.runoob.com/images/demo/demo1.jpg" alt="#" width="800" height="100">
</a>
</div>
</div>
<div class="topnav">
<a href="#">图片</a>
<a href="#">视频</a>
<a href="#">关于</a>
</div>
<div class="responsive">
<div class="img">
<a target="_blank" href="//static.runoob.com/images/demo/demo4.jpg">
<img src="//static.runoob.com/images/demo/demo4.jpg" alt="#" width="800" height="500">
</a>
</div>
</div>
</body>
</html>
代码效果图如下:
代码步骤:
1、开始HTML 源码,<html>
标签语言有【开始标签】和【结束标签】,中间为标签的内容,先我们输入头和尾。
<html>
</html>
2、一个简单的 HTML 文档,<head>
带有最基本的必需的元素。在中间加入标题<title>
标签,在title标题中加入网页标题名:css面页布局,可以不写。
<html>
<head>
<title>css网页布局 </title>
</head>
</html>
3、网页布局<style>
标签用于为 HTML 文档定义样式信息,创建高级的布局非常耗时,使用模板是一个快速的话,搜索引擎可以找到很多免费的网站模板。
<html>
<head>
<title>css网页布局 </title>
</head>
<style>...网页布局...
</style>
</html>
4、<body>
元素包含文档的所有内容,比如:文本、超链接、图像、表格和列表等。
<html>
<head>
<title>css网页布局</title>
</head>
<body>
<p>body 元素的内容会显示在浏览器中。</p>
<p>title 元素的内容会显示在浏览器的标题栏中。</p>
</body>
</html>
关于“HTML怎么制作一个简单的面页布局”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。