• css关系选择符


    <!Doctype html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>testcss3</title>
    
    <script type="text/javascript" >
    
    </script>
    <style>
    	div{
    		text-align: center;
    		border: 2px solid #a1a1a1;
    		padding: 10px 40px;
    		background: #dddddd;
    		 350px;
    		border-radius: 25px;
    		box-shadow: 10px 10px 5px #dddddd;
    	}
    /*	相邻兄弟选择器 h1和p相邻 的p*/
    	.div2 h1 + p{background-color: aqua;}
    /*	子元素选择器*/
    	h1 > strong {color: red;}
    /*	伪类*/
    	a:link {color: #FF0000}		/* 未访问的链接 up*/
    	a:visited {color: #00FF00}	/* 已访问的链接 */
    	a:hover {color: #FF00FF}	/* 鼠标移动到链接上 over*/
    	a:active {color: #0000FF}	/* 选定的链接 down */
    	
    	.div3 p:first-child{font-weight: bold;}
    	.div3 li:first-child{text-transform:uppercase;}
    	.div4 p:first-child i{color: blue;}
    	
    	.div2 h1:before{content: "hello";}
    </style>
    </head>
    <body>
    	<div>border-radius 属性允许您向元素添加圆角</div>
    	
    	<div class="div2">
    		<h1>This is a heading.</h1>
    		<p>This is paragraph.</p>
    		<p>This is paragraph.</p>
    		<p>This is paragraph.</p>
    		<p>This is paragraph.</p>
    		<p>This is paragraph.</p>
    	</div>
    	
    	<h1>This is <strong>very</strong> <strong>very</strong> important.</h1>
    	<h1>This is <em>really <strong>very</strong></em> important.</h1>
    	
    	<div class="div3">
    		<p>These are the necessary steps:</p>
    		<ul>
    		<li>Intert Key</li>
    		<li>Turn key <strong>clockwise</strong></li>
    		<li>Push accelerator</li>
    		</ul>
    		<p>Do <em>not</em> push the brake at the same time as the accelerator.</p>
    	</div>
    	<div class="div4">
    		<p>some <i>text</i>. some <i>text</i>.</p>
    		<p>some <i>text</i>. some <i>text</i>.</p>
    	</div>
    </body>
    </html>
    

    http://www.w3school.com.cn/css/css_selector_child.asp

    .reveal *{display: none;}
    /*reveal 的子元素都不显示 没有*的话就是本身加子元素都不显示*/
    .reveal *.handle{display: block;}
    /*除了class="handle"的元素*/

    css 关系选择符:

    1:包含选择符 E F(sRules)

    2:子选择符 E>F(sRules)

    3.相邻选择符(E+F)

    4.兄弟选择符(E~F)

  • 相关阅读:
    Json-lib使用 转载
    利用PinYin4j 实现List中的对象按数字,字母, 汉字排序
    web 模板 类似京东左侧的导航栏
    常见挂马方式
    JS挂马攻防
    代码中的202.102.100.100
    利用Jquery获取、设置iframe中元素
    [PHP]基本排序(冒泡排序、快速排序、选择排序、插入排序、二分法排序)
    js验证输入的金钱格式
    js获取当前对象的颜色判断改变颜色
  • 原文地址:https://www.cnblogs.com/as3lib/p/4668182.html
Copyright © 2020-2023  润新知