CSS层叠样式表,简单的说就是来美化页面的 、修饰网页的一门技术
通过CSS可以实现将设置样式的CSS代码和展示数据的HTML代码进行分离。增强网页的展示能力。
css总共有三种标签,非别是div、span、p
这三个元素的区别:
div和p是块级元素,独占一行,而span是行内元素,<!DOCTYPE html>
<html> <head> <meta charset="UTF-8"> <title>css</title> </head> <body> <!-- geox给下面的div/span/p加上css样式 -->
<!--sytle属性:
border:边框 宽度
solid:设置边框颜色
font-size:字体大小
font-family:字体属性
font-style:是否为斜体
font-weight:是否加粗
background:底色
-->
<div id="" style="border: 2px solid red;font-size: 25px; font-family: ‘微软雅黑‘;font-style: italic; font-weight: bolder;"> div111 </div> <div id="" style="border: 2px solid red;font-size: 25px; font-family: ‘微软雅黑‘;font-style: italic; font-weight: bolder;"> div111 </div> <span style="border: 3px solid blue; font-size: 25px;font-style: italic;"> span222 </span> <span style="border: 3px solid blue; font-size: 25px;font-style: italic;"> span222 </span> <p style="background: blueviolet;font-size: 30px; font-style: italic;font-weight: bolder;">p333333</a></p> <p style="background: blueviolet;font-size: 30px; font-style: italic;font-weight: bolder;">p333333</a></p> </body> </html>
原文:https://www.cnblogs.com/gxlaqj/p/11368635.html