博客列表 >2019.4.25作业

2019.4.25作业

关超的博客
关超的博客原创
2019年04月25日 23:08:22530浏览
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CSS中的常用选择器</title>
<style type="text/css">
	.div1{width:80px ; height:80px; background-color:#ccc;}  
	#div2{width:80px ; height:80px; background-color:pink;}
	p{ background-color:green;}
	p[id="divid"]{ background-color:red;}
	.div3{width:80px ; height:80px; background-color:yellow;}
	.div3 span{ background-color:#ff6700;}
	h3:first-of-type{ background-color:lightblue;}
	h3:last-of-type{background-color:lightgreen;}
	h4:nth-child(4){ background-color:lightgreen;}
	.div5{ background-color:#ccc;}
	li:nth-of-type(3){ background:wheat;}
</style>
</head>

<body>
    <div class="div1">
    </div>
    <div id="div2">
    	<p>我是P元素</p>
        <p id="divid">我是P元素</p>
    </div>
    <div class="div3">
    	<span >1</span>
        <span>2</span>
        <span>3</span>
    </div>
	<h3>1</h3>
	<h3>2</h3>
	<h3>3</h3>
	<div class="div4">
        <h4>1</h4>
        <h4>2</h4>
        <h4>3</h4>
        <h4>4</h4>
        <h4>5</h4>
    </div>
    <div class="div5">
    	<ul>
        	<li>1</li>
        	<li>2</li>
        	<li>3</li>
        	<li>4</li>
        	<li>5</li>                                                
        </ul>
    </div>
</body>
</html>

QQ图片20190425230652.png

声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议