一,可继承属性<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>CSS的可继承属性</title> <style> body { color: red; font-size: 30px; } </style></head><body> <div>我是块级标签</div> <span>我是行内标签</span> <button>我是行内-块级标签</button></body></html> 二。不可继承属性
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>CSS不可继承属性</title> <style> #main { font-weight:bold;">yellow; width: 100px; height: 200px; } .text1 { font-weight:bold;">rebeccapurple; } </style></head><body> <div id="main"> <div class="text1">我是里边的</div> </div></body></html> 三。一些常用的属性
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>CSS的一些常用的属性</title> <style> div { font-weight:bold;">rebeccapurple; width: 200px; height: 100px; /*属性规定元素是否可见*/ /*visibility: hidden;*/ /*display: none;*/ /*规定显示光标的类型(形状)*/ cursor: help; font-family: "sans-serif"; font-weight: bolder; } p { font-weight:bold;">yellow; } </style></head><body> <div>我是div标签</div> <p>我是段落标签</p></body></html>
时间: 2024-10-22 22:43:19