0
点赞
收藏
分享

微信扫一扫

css样式属性

凯约 2022-03-11 阅读 72

1.颜色:

   关键字 red blue yellow
   16进制 #0000000
   rgh函数 rgh(0-255,0-255,0-255) 光学三原色 红绿蓝   颜料三原色 红黄蓝
   rgba函数 rgba[0-255,0-255,0-1]透明度
   HSL HSLA H 色调0-360 s 饱和度 0%-100% 亮度 0%-10% A 透明度
   apacity 透明度 0-1


2.长度:

   绝对单位: px 像素
   相对单位: 
       em   相对当前元素的字体大小 比如当前字体为24px 那么1em=24px
       rem 相对于html级元素上的大小  浏览器默认字体大小16px
       %  百分比


3.样式:

    3.1.文本相关的样式:(可以被继承的)

        color:    设置文字颜色
        font-size:  设置字体的大小
        font-family:  设置字体,宋体    必须是浏览器可以访问到的字体,  
                font-family:仿宋,楷书,隶书;     字体栈,第一个字体有的话就用第一个,没有就下一个  
        font-style:   设置字体是否倾斜
        font-weight:   设置字体的粗细   400 = normal默认粗细    700 = bold 加粗   100-900
        text-align:    文本水平对齐方式    center 居中  left 左对齐   right 右对齐
        text-decoration:  对本进行修饰    line  style  color

         text-transform:   设置字体进行变形   

        text-shadow:  设置文本的阴影   h-shadow 水平阴影的位置  v-shadow 垂直阴影的位置  blur 模糊度  color 颜色

 <style>
body{
overflow: scroll;
height: 100px;
}
.one{
/* 设置文本颜色
color: red; */

/* 设置文本大小
font-size: 20px; */

/* 设置文本字体
font-family: '宋体', "楷体", "隶书"; */

/* 字体斜体 */
/* font-style: normal;
font-weight:bold;
font-weight:lighter; */

/* border: 1px solid red; */
/* height: 200px; */
/* line-height: 20px; */
/* 设置文本水平对齐方式 */
text-align: center;
/* vertical-align: middle; */
/* overflow: scroll; */
/* text-decoration-line: line-through; */
/* text-decoration-line: underline; */
text-decoration-style:dotted ;

}
a{
text-decoration-line: none;
}
</style>


   3.2. 列表相关样式:ol  ul 

   3.3. 光标的样式:cursor

           cursor: pointer 小手  move 移动  
            default  默认,箭头  auto 保持浏览器默认的样式 crosshair 十字架样式 
            help 帮助  wait 等待

   3.4.溢出样式:overflow

  3.5.  显示和隐藏:

   页面初始化:

 *{
padding:0;
margin:0
}
a{
text-decoration:none
}
ul,ol {
list-style:none
}


    

举报

相关推荐

0 条评论