css、html根据class设置颜色、字体、位置属性

class=“file-tip”

.file-tip{
	font-size: 13px;
	color: red;
	padding-left: 5px;
}

页面布局:

<tr>
	 <td colspan="6" class="tHead">
		 <b class="common_font">附件信息<span class="file-tip">(附件格式为PDF且附件大小最大10M)span>b>
	 td>
 tr>

.class

.class
点后跟class值

#id
井号后面跟id值

为 class=“hometown” 的所有

元素设置样式:

p.hometown
{ 
background-color:yellow;
}

星号 * 选择器选取所有元素。

星号 * 选择器也能选取另一个元素中的所有元素:

> 选择所有元素,并设置它们的背景色,
*
{ 
background-color:yellow;
}

> 选取 
元素内部的所有元素: div * { background-color:yellow; } > 选择并设置所有

元素的样式: p { background-color:yellow; }

.classname{
	width: 100%;//宽度
	height:30px;//高度
	background-color: #F2FBFA;//背景颜色
	color: #ffff;//颜色
	display:none;//不显示
	text-align: center;//文本内容位置-center居中
	font-size: 16px;//字体大小
	margin-left: -62px;
  	margin-top: -62px;
	margin:0 auto;
	margin-bottom: 10px;
	border-bottom: 1px dashed #CCC;

}

你可能感兴趣的:(前台,css,html)