css selector-class

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
	    <title>selector-class.html</title>
		
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
	    <meta name="keywords" content="keyword1,keyword2,keyword3">
	    <meta name="description" content="this is my page">
	    <meta name="content-type" content="text/html; charset=UTF-8">
	    
		<!--<link rel="stylesheet" type="text/css" href="styles.css">-->
		<!-- CSS 类选择器:在 CSS 中,类选择器以一个点号显示
			类选择器允许以一种独立于文档元素的方式来指定样式。类选择器可以单独使用,也可以与其他元素结合使用。
			只有适当地标记文档后,才能使用这些选择器,所以使用这两种选择器通常需要先做一些构想和计划。
			要应用样式而不考虑具体设计的元素,最常用的方法就是使用类选择器。
			为了将类选择器的样式与元素关联,必须将 class 指定为一个适当的值。
			
			和 id 一样,class 也可被用作派生选择器:
			.center {text-align: center}
			td.fancy {
	color: #f60;
	background: #666;
	}
	
	.fancy td {
	color: #f60;
	background: #666;
	}
		 -->
		 <style type="text/css">
		.important {font-weight:bold;}
		.warning {font-style:italic;}
		.important.warning {background:silver;}
		</style>
    </head>
	<body>
		<p class="important">This paragraph is very important.</p>
		
		<p class="warning">This is a warning.</p>
		
		<p class="important urgent warning">This paragraph is a very important warning.</p>
		
		<p>This is a paragraph.</p>
		
		<p>...</p>

	</body>
</html>

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值