zoukankan      html  css  js  c++  java
  • 修改浏览器选中文字的默认背景

    css3开始可以定制更多个性化的页面效果了,现在选中文字也可以把默认的蓝色背景换成喜欢的各种颜色,下面是一个小示例:

    <html>
    <head>
    <style>
    .miaov {color: green;}
    .miaov::selection {background: maroon; color:#fff;}
    
    .miaov::-moz-selection {background:green; color:#fff;}
    .miaov::-webkit-selection {background:green; color:#fff;}
    </style>
    </head>
    
    <body>
    <p class="miaov"> 选中这段文字就会看到效果啦!</p>
    </body>
    </html>

     点击这里查看效果。

  • 相关阅读:
    「CodeForces
    「POJ
    「CodeForces
    「CodeForces
    【CodeForces 717C】Potions Homework
    【CodeForces 730H】Car Repair Shop
    【CodeForces 730H】Delete Them
    【Gym 100947I】What a Mess
    j
    PDE工具箱的简单使用
  • 原文地址:https://www.cnblogs.com/waylen/p/3248399.html
Copyright © 2011-2022 走看看