css – 文字装饰:无效

前端之家收集整理的这篇文章主要介绍了css – 文字装饰:无效前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
完全令人困惑!我已经尝试重写文本装饰:没有线几种不同的方式.我还设法通过定位文本来重新设置文本,但是文本装饰:无代码不会占用.

帮助非常感谢

.widget    
{
     height: 320px;
     width: 220px;
     background-color: #e6e6e6;
     position: relative;                              
     overflow: hidden;                          
}


.title    
{
     font-family: Georgia,Times New Roman,serif;
     font-size: 12px;
     color: #E6E6E6;
     text-align: center;
     letter-spacing: 1px;
     text-transform: uppercase;
     background-color: #4D4D4D;    
     position: absolute;
     top: 0;
     padding: 5px;
     width: 100%;
     margin-bottom: 1px;
     height: 28px;
     text-decoration: none;
}

a .title    
{
     text-decoration: none;
}
<a href="#">
    <div class="widget">  
        <div class="title">Underlined. Why?</div>  
    </div>
</a>

解决方法

内联元素(a)中有一个块元素(div).这在HTML 5中起作用,但不适用于HTML 4.因此也只有实际支持HTML 5的浏览器.

当浏览器遇到无效的标记时,他们会尝试修复它,但不同的浏览器会以不同的方式进行,所以结果会有所不同.一些浏览器会将block元素移动到inline元素之外,有些浏览器会忽略它.

原文链接:https://www.f2er.com/css/217182.html

猜你在找的CSS相关文章