search

Home  >  Q&A  >  body text

前端 - 集思广益,如何用CSS实现数字上面有一个点

就像简谱一样的那种。css上划线的那种,容易出现很多点或横线,并不适用

ringa_leeringa_lee2767 days ago683

reply all(2)I'll reply

  • 黄舟

    黄舟2017-04-17 11:49:08

    The number that needs to be added is a separate element, and then used before or after pseudo-elements to achieve it.

    <span>5</span>
    <style>
        span {
            position: relative;
            font-weight: 800;
            font-size: 6rem;
        }
        
        span::before {
            position: absolute;
            content: '';
            top: -0.5rem;
            left: 50%;
            margin-left: -0.5rem;
            width: 1rem;
            height: 1rem;
            border-radius: 0.5rem;
            background-color: #000;
        }
    </style>

    reply
    0
  • 黄舟

    黄舟2017-04-17 11:49:08

    To make it simple, just use pictures and then match them to display. There will be no compatibility issues

    reply
    0
  • Cancelreply