tft每日頭條

 > 圖文

 > css都有哪些屬性

css都有哪些屬性

圖文 更新时间:2024-08-21 00:20:03

/* *作者:呆萌老師 *☑csdn認證講師 *☑51cto高級講師 *☑騰訊課堂認證講師 *☑網易雲課堂認證講師 *☑華為開發者學堂認證講師 *☑愛奇藝千人名師計劃成員 *在這裡給大家分享技術、知識和生活 *各種幹貨,記得關注哦! *vx:it_daimeng */

顔色

.cls_div1{ color: red; } .cls_div2{ color: #FF4300; /*rgb值的16進制方法 0--FF r:red g:green b:blue*/ } .cls_div3{ color: rgb(17,119,255);/*rgb值的10進制方法 0--255 r:red g:green b:blue*/ } .cls_div4{ color:rgba(17,119,255,0.5); /*設置透明度 0--1 之間 0代表全透明 1 代表完全不透明*/ }

css都有哪些屬性(CSS中常用屬性)1

字體

body{ font-size: 14px; /*設置字體大小 */ font-family: "黑體"; font-weight: bold; /*字體的粗細*/ font-weight: 500; font-style: italic; /*字體樣式 比如傾斜*/ line-height: 25px; /*行高*/ } /*如果對同一個html對象做相同的多個樣式 則采用的就近原則 */ .ul1{ font: 14px/1.5 "宋體",Arial,"微軟雅黑"; /*對字體做整體設置 1.5指的是行高,行高是字體大小的1.5倍*/ } .ul2{ font: 14px/25px "宋體",Arial,"微軟雅黑"; /*對字體做整體設置 25指的是行高*/ }

文本

a{

text-decoration:none; /*文本裝飾 none 去掉下劃線 */

}

a:hover{

text-decoration: underline;/*下劃線*/

}

.price{

text-decoration: line-through; /*删除線*/

}

.info p{

text-indent: 30px; /*首行縮進*/

}

.list li{

width: 150px;

border: 1px solid red;

white-space: nowrap ; /*強制在一行内顯示*/

overflow: hidden; /*溢出的部分 隐藏*/

text-overflow: ellipsis; /*溢出的文本部分 顯示為 ...*/

}

.div_center{

text-align: center; /*文本對齊方式*/

}

列表

列表樣式的處理

​​​​​​​ 去掉list-style

ist-style: none; /*設置列表的樣式為無(去掉默認的 . )*/

css都有哪些屬性(CSS中常用屬性)2

  1. 給li設置背景圖片

css都有哪些屬性(CSS中常用屬性)3

.list2 li{

/*

background-image: url(../img/arrow.gif);

background-repeat: no-repeat;

background-position: left center; */

background: url(../img/arrow.gif) no-repeat left center;

border: 1px solid red;

padding-left: 10px;

}

,

更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!

查看全部

相关圖文资讯推荐

热门圖文资讯推荐

网友关注

Copyright 2023-2024 - www.tftnews.com All Rights Reserved