内嵌样式
样式定义:用于辅助美化HTML,使得网页效果色彩性更高,更容易吸引用户。 样式能够为网页设置颜色、背景、排版等丰富的属性。code
标签中的style属性用于帮助标签订义内嵌样式,内嵌样式格式以下例所示, 使用style做为标记,在内部写入格式如: key:value; 的数据对象来表示 具体的样式。对象
<div style="color: red;"> Hello World ! </div>
可是在标签不少的状况下,若是大量在页面中堆叠内嵌样式,则会使得页面臃肿 冗余,以下例:引用
<div style="width: 100px; height: 100px; color: red; background-color: green; font-size: 20px; font-weight: bold; line-height: 20px; text-align: center;"> 大量堆积内嵌样式 </div>