<form>
<!-- 补全代码 -->
<input type="password" value="nowcoder"></input>
<input type="checkbox" checked></input>
</form>
<table>
<caption>nowcoder</caption>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<img alt="" title=""></img>
<a href="#" target="_blank">FF</a>
<dl>
<!-- 补全代码 -->
<dt>nowcoder</dt>
<dd>nowcoder</dd>
</dl>
<dl>
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>
<p><strong>牛客网</strong>,程序员必备求职神器</p>
-加粗strong
<header>
<nav></nav>
</header>
<!--header头部标签,nav导航标签
<p>一行文字</p>
<span>一行文字</span>
如上代码,p 标签与 span 标签都区别之一就是,p 标签的含义是:段落。而 span 标签责没有独特的含义。
代码结构清晰,方便阅读,有利于团队合作开发。 方便其他设备解析(如屏幕阅读器、盲人阅读器、移动设备)以语义的方式来渲染网页。有利于搜索引擎优化(SEO)
<header>:页眉通常包括网站标志、主导航、全站链接以及搜索框。
<nav>:标记导航,仅对文档中重要的链接群使用
<audio src="" controls autoplay loop ></audio>
<video src="movie.ogg" onerror="myFunction()" controls="controls">
抱歉,加载视频失败
</video>
<!-- onerror执行某个方法,这里的方法可以自己定义-->
<html>
<head>
<meta charset=utf-8>
<style type="text/css">
/*补全代码*/
div{
color:rgb(255, 0, 0);
font-size:20px;
}
#black{
color:rgb(0, 0, 0);
}
.green{
color:rgb(0, 128, 0);
}
</style>
</head>
<body>
<div>红色</div>
<div class='green'>绿色</div>
<div id='black'>黑色</div>
</body>
</html>
<html>
<head>
<meta charset=utf-8>
<style type="text/css">
/*补全代码*/
ul li:nth-child(2),ul li:nth-child(4){
background-color:rgb(255,0,0);
}
</style>
</head>
<body>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
</body>
</html>
<html>
<head>
<meta charset=utf-8>
<style type="text/css">
/*补全代码*/
div::after{
content: "";
width:20px;
height:20px;
background-color:rgb(255, 0, 0);
display:block;
}
</style>
</head>
<body>
<div></div>
</body>
</html>
<html>
<head>
<meta charset=utf-8>
<style type="text/css">
/*补全代码*/
div{
border: 1px solid black;
width:100px;
height:100px;
border-radius:50px;
}
</style>
</head>
<body>
<div></div>
</body>
</html>
<html>
<head>
<meta charset=utf-8>
<style type="text/css">
/*补全代码*/
.box{
width:100px;
height:100px;
margin:10px;
padding:20px;
}
</style>
</head>
<body>
<div class="box">
</div>
</body>
</html>
<html>
<head>
<meta charset=utf-8>
<style type="text/css">
.wrap {
/*补全代码*/
overflow:hidden;
}
.left {
width: 100px;
height: 100px;
/*补全代码*/
float:left;
}
.right {
width: 100px;
height: 100px;
/*补全代码*/
float:left
}
</style>
</head>
<body>
<div class='wrap'>
<div class='left'></div>
<div class='right'></div>
</div>
</body>
</html>
<html>
<head>
<meta charset=utf-8>
<style type="text/css">
.box {
width: 100px;
height: 100px;
/*补全代码*/
position:fixed;
top:0px;
left:0px;
}
</style>
</head>
<body>
<div class='box'></div>
</body>
</html>
<p>牛客网是一个专注于程序员的学习和成长的专业平台。</p>
<p >欢迎来到牛客网</p>
<p>在这里,我们为你提供了IT名企的笔试面试题库</p>
<p>在这里,我们以题会友</p>
<style>
p{
color:red
}
</style>
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<style type="text/css">
.topbranch {
width: 0px;
height: 0px;
/*
* TODO: 上枝叶效果
*/
float: left;
border-bottom: 100px solid green;
border-top: 100px solid transparent;
border-left:100px solid transparent;
border-right:100px solid transparent;
margin-left: 100px;
}
.middleBranch {
width: 0px;
height: 0px;
/*
* TODO: 中枝叶效果
*/
border-top: 200px solid transparent;
border-bottom: 200px solid green;
border-left:200px solid transparent;
border-right:200px solid transparent;
}
.base {
/*
* TODO: 树干效果
*/
height: 200px;
width: 70px;
background-color: gray;
margin-left: 165px;
}
</style>
</head>
<body>
<section class="topbranch"></section>
<section class="middleBranch"></section>
<section class="base"></section>
</body>
</html>
<html>
<head>
<meta charset=utf-8>
<style type="text/css">
.box {
/*补全代码*/
width: 4em;
height: 4em;
}
</style>
</head>
<body>
<div class='box'></div>
</body>
</html>
在css中单位长度用的最多的是px、em、rem,这三个的区别是: