jQuery技术:为什么会:奇怪的画出来之后?

这是我的代码:

.specific_tag_cases a:after{ position: absolute; font-family: Arial; background-color: #c1c1c1; color: white; content: "×"; padding: 0px 3px; margin-top: 6px; margin-right: 4px; font-size: 11px; border-radius: 50%; } 

这是输出:

为什么会:奇怪的画出来之后?

好的,一切都很好。


但有时突然看起来像这样页面重新加载:

为什么会:奇怪的画出来之后?

它的背后没有任何具体的逻辑。 我的意思是我不知道什么时候会被奇怪地画出来。 任何时候它都可以发生。

为什么? 我该如何解决这个问题?

    请为标签定义heightwidth

    您正在使用border-radius:50%; 但是你没有指定widthheight ,如果你需要一个圆形框,你必须指定相等的widthheight

    如下

     .specific_tag_cases a:after{ position: absolute; font-family: Arial; background-color: #c1c1c1; color: white; content: "×"; padding: 0px 3px; margin-top: 6px; margin-right: 4px; font-size: 11px; border-radius: 50%; width:8px; /*Add this*/ height:8px; /*Add this*/ } 

    包含工作示例。 在这个例子中,我删除了position和更改margin属性,因为我不需要它。

     a { background: tomato; padding: 10px; color: #fff; text-decoration: none; } a:after { font-family: Arial; background-color: #c1c1c1; color: white; content: "×"; padding: 0px 3px; margin-top: 6px; margin-left: 5px; /*I changed margin-right to left*/ font-size: 11px; border-radius: 50%; width: 8px; height: 8px; } 
     Home 

      以上就是jQuery教程分享为什么会:奇怪的画出来之后?相关内容,想了解更多jQuery开发(异常处理)及jQuery教程关注计算机技术网(www.ctvol.com)!)。

      本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

      ctvol管理联系方式QQ:251552304

      本文章地址:https://www.ctvol.com/jquerytutorial/558610.html

      (0)
      上一篇 2021年1月27日
      下一篇 2021年1月27日

      精彩推荐