自定义属性标签title显示样式

CSS :after伪元素用于向选定的元素之后插入内容
此样式ie浏览器无效
<p class=".tab"  title="自定义显示样式">
<style>
.tab {
  position: relative;
  /* 其他样式 */
}
 
.tab::after {
content: attr(title);
    position: absolute;
    top: 50%;
    left: -25%;
    visibility: hidden;
    width: 150%;
   
    color: #373737;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    z-index: 989;
    border: 1px solid #cccccc;
}
 
.tab-pane:hover::after {
  visibility: visible;
}
        </style>
posted @ 2024-05-21 21:30  千杯不醉1980  阅读(26)  评论(0编辑  收藏  举报