html - 如何在弹出窗口中隐藏特定行

标签 html css

这是网站的代码:

<div class="infoBox" style="position: absolute; visibility: visible; width: 450px; left: 504.626px; top: -103.94px;">

<div class="marker-wrapper animated fadeInDown">
    <div class="marker-title"></div>
    <div class="marker-content">
        <div class="two_third popup-content">
            <ul>
                <li></li>
                <li>
                    <span class="icon-link"></span>
                    <a href="http://www.hotelesavant.com" target="_blank" rel="nofollow"></a>
                </li>
            </ul>
        </div>
        <div class="one_third last image-wrapper pop-image"></div>

在自定义 CSS 上写这个,隐藏整个弹出框:

.popup-content ul li {
margin-bottom: 5px;
color: #5A5A5A;
}

但我只想隐藏这个:

<li>
  <span class="icon-link"></span>
  <a href="http://www.hotelesavant.com" target="_blank" rel="nofollow"></a>
</li>

此致问候...并在此先致谢!

最佳答案

你可以使用最后一个 child :

.popup-content ul li:last-child { display:none;}

编辑:如果有问题的“LI”元素最终不是最后一个 li,那么您还有其他选择:

li:nth-child(#index of the element)

在你的情况下:

li:nth-child(1)

当然除非你可以给它添加一个类。

关于html - 如何在弹出窗口中隐藏特定行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24103767/

相关文章:

javascript - 尝试平滑滚动动画并理解为什么我的文字会瞬间消失

html - 为什么这些 div 样式会破坏我的网站布局?

javascript - 将 Box2d 与 EaselJS 形状一起使用?

javascript - 如何用两个图像保存 Canvas

html - Bootstrap 独立输入焦点颜色

html - 背景渐变无法使用 bootstrap 3 正确显示

video - iPad 上的 HTML5 视频

html - 无法正确镜像 div

html - Angular/Material mat-form-field 输入 - float 标签问题

html - 如何使用 css 和 html 排序产生从 1.1、1.2、1.3(而不仅仅是 1、2、3)开始的结果的列表