设为首页 - 加入收藏 ASP站长网(Aspzz.Cn)- 科技、建站、经验、云计算、5G、大数据,站长网!
热搜: 创业者 数据 手机
当前位置: 首页 > 服务器 > 系统 > 正文

20个非常实用的CSS技巧(5)

发布时间:2020-03-15 18:52 所属栏目:52 来源:站长网
导读:border-bottom:5pxsolidtransparent;/*leftarrowslant*/ border-top:5pxsolidtransparent;/*rightarrowslant*/ border-left:5pxsolid#2f2f2f;/*bottom,addbackgroundcolorhere*/ font-size:0px; line-height:0px; }

  border-bottom:5px solid transparent;  /* left arrow slant */  

  border-top:5px solid transparent; /* right arrow slant */  

  border-left:5px solid #2f2f2f; /* bottom, add background color here */  

  font-size:0px;   

  line-height:0px;   

}   

  

17. CSS3 calc() 的使用

calc() 用法类似于函数,能够给元素设置动态的值:

CSS Code复制内容到剪贴板

/* basic calc */  

.simpleBlock {   

  width: calc(100% - 100px);   

}   

    

/* calc in calc */  

.complexBlock {   

  width: calc(100% - 50% / 3);   

  padding: 5px calc(3% - 2px);      margin-left: calc(10% + 10px);   

}   

  

18. 文本渐变

文本渐变效果很流行,使用 CSS3 能够很简单就实现:

CSS Code复制内容到剪贴板

h2[data-text] {   

  position: relative;   

}   

h2[data-text]::after {   

  content: attr(data-text);   

  z-index: 10;   

  color: #e3e3e3;   

  position: absolute;   

  top: 0;   

  left: 0;   

(编辑:ASP站长网)

网友评论
推荐文章
    热点阅读