css

css的三种形式

oveflow :hidden超出部分隐藏

oveflow :scroll内容溢出添加滚动条

span标签可以设置水平方向的margin值,不能设置垂直方向的

display:block块状元素,内联元素转块状

display:inline内联元素,块状元素转内联元素

display:inline-block内联块状的结合,两方都具备,可设置宽高,不独占一行

display:none;隐藏

1.<link rel="stylesheet" type="text/css" href="./css/01.css"/>引入外部css文件

2.<style type="text/css">

p{
font: 30px;
}
#id名{  }

.class名{  }

正常标签{  }
</style>

3.<div class="" style="color:red">
<img src="img/002.jpg" >
</div>



css页面

span{
color: aqua;                     设置span标签内部的样式
background-image: url();/* 背景图片 */
background-repeat: no-repeat;/* 背景平铺 */
background-attachment: fixed;/* 滚动页面时图片不动 */
background-position: 10px,10px;/* 背景图位置*/
overflow: scroll;/* 滚动,超出框后会隐形 */
}
#wan{
color: red;
background-size: cover;/*cover 全覆盖, contain扩展到最大尺寸*/
background-repeat-x: inherit;
}
[type="text"]{                 文本框打出字后的颜色
color: blue;
}

font-family: "microsoft yahei,simsun,simhei";

/* 字体,微软雅黑 ,常用*/


font-size: 14px;/* 字体大小 */
font-weight: bold;/* 字体加粗,bolder更粗,lighter更细,100=normal,700=hold */
font-style: normal;/* 正常,斜体italic,倾斜oblique */
color: rgba(255,255,255,0.8);/* 颜色,最后一个值是透明度 */
color: blue;

text-indent:50px ;/* 首行缩进 */
text-align: center;/* 对齐方式,居中 */
text-decoration: overline;/* 上划现 underline下划线与使用u标签一样*/
text-decoration: line-through;/* 删除线,相当于s */
line-height: 30px;/* 行高 */
word-break: break-all;/* 单词很长时不换行,自动换行 */

white-space: normal;/* 文字不换行 */
overflow: hidden;/* 超出的时候隐藏 */
text-overflow: ellipsis;/* 省略,三条一起用显示省略号 */

原文地址:https://www.cnblogs.com/111wdh/p/12703297.html