美文网首页程序员
让页面的字体变得更清晰(css实现)和使用css样式布局价格划线

让页面的字体变得更清晰(css实现)和使用css样式布局价格划线

作者: 会飞的猪bzy | 来源:发表于2018-03-17 08:59 被阅读0次

    css3属性-webkit-font-smoothing

      对字体进行抗锯齿渲染可以使字体看起来会更清晰舒服。在图标字体成为一种趋势的今天,抗锯齿渲染使用也越来越多。font-smoothing是非标准的CSS定义。它被列入标准规范的草案中,后由于某些原因从web标准中被移除了。但是,我们可以用以下两种定义进行抗锯齿渲染

    Webkit在自己的引擎中支持了这一效果。

    -webkit-font-smoothing它有三个属性值:

    1. none:对低像素的文本比较好
    2. subpixel-antialiased:默认值
    3. antialiased:抗锯齿很好
      具体代码
    .content{
       -webkit-font-smoothing: antialiased;
    }
    

    -moz-osx-font-smoothing: inherit | grayscale;这个属性也是更清晰的作用。

    具体代码

    .content {
       -webkit-font-smoothing: antialiased;
       -moz-osx-font-smoothing: grayscale;
    }
    

    css和html实现样式布局横线

    1. html实现,在HTML标签中可以使用<s></s>删除线实现,可以使用<del></del>标签实现

      <p>优惠价格:100元,原价:<s>200元</s></p>
      <del>186.00</del>
      
    2. css实现,使用text-decoration:line-through

      <p>优惠价格:80元,原价:<span class="huaxian">220元</span></p>
      
       .huaxian{text-decoration:line-through}
      

    相关文章

      网友评论

        本文标题:让页面的字体变得更清晰(css实现)和使用css样式布局价格划线

        本文链接:https://www.haomeiwen.com/subject/clbdqftx.html