Html 定位锚元素中的文本,而不是图像
我不希望图片被下划线,但我需要在文本中的超链接被下划线。我该怎么做?这是一个wordpress主题,所以我不能更改html,我必须使用cssHtml 定位锚元素中的文本,而不是图像,html,css,css-selectors,Html,Css,Css Selectors,我不希望图片被下划线,但我需要在文本中的超链接被下划线。我该怎么做?这是一个wordpress主题,所以我不能更改html,我必须使用css .post desc a{ 边框底部:1px实心#FBCF00; } .post desc a img{ 边框底部:无; } 文本装饰下划线 <div><a style="text-decoration:underline" href="http://www.montrealguidecondo.ca/news/wp-content/u
.post desc a{
边框底部:1px实心#FBCF00;
}
.post desc a img{
边框底部:无;
}
文本装饰下划线
<div><a style="text-decoration:underline" href="http://www.montrealguidecondo.ca/news/wp-content/uploads/2016/01/exterieur-1.jpg" target="_blank" rel="attachment wp-att-2763"><img class="alignnone wp-image-2763 size-full" src="http://www.montrealguidecondo.ca/news/wp-content/uploads/2016/01/exterieur-1.jpg" alt="extérieur de Tod condo" width="639" height="438"></a>
您可以使用
display:table在图像下删除它代码>在图像上,如下所示:
.post-desc a img{
border-bottom: none;
display:table;
}
片段:
.post desc a{
边框底部:1px实心#FBCF00;
}
.post desc a img{
边框底部:无;
显示:表格;
}
您已经在上设置了边框属性(尚未),显然您无法编辑html,因此我们必须坚持使用我们获得的信息
包含图像的链接在属性rel
中有单词attachment
。这是如何选择它们并禁用它们的边框:
a[rel~="attachment"] {
border-bottom: none !important;
}
为了简化操作,您可以使用带有负值的vertical align
将img
按需放置在基线下:
a{
边框底部:实心;
}
img{
垂直对齐:-0.5em;/*平均-0.25em等于垂直对齐:底部*/
/*演示目的:参见img下的边框*/
不透明度:0.75;
}
我想使用:边框底部:1px实心#FBCF00;对于颜色,但它需要在图片下删除这里是完整的站点,以查看问题:我在你的锚标签中没有看到任何文本?你到底想在什么下面划线?