Div没有隐藏媒体查询和display:none;

时间:2016-03-21 16:05:12

标签: html css media-queries

我想要隐藏在小型移动设备上的div,因为它会在徽标下滑动。我有其他元素可以正常工作,但这个我有隐藏的问题。我想隐藏div id"标语"但它并不隐藏。

SELECT *
FROM Posts P1
INNER JOIN (SELECT ParentId, Id 
            FROM Posts
            WHERE OwnerUserId = 5620297
            AND PostTypeId = 2) P2
    ON P1.Id = P2.ParentId
    AND P1.AcceptedAnswerId <> P2.Id;

现在,我的CSS看起来像这样:

<div class="container">
<div id="logo"><a href="../index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Nucleo-Logo','','../images/logo-over.png',1)"><img id="Nucleo-Logo" src="../images/logo.png" alt="Nucleo Fitness, Rapid City, SD" /></a> </div>
<div id="tagline"><img src="../images/get_to_the_core.png" alt="Get to the core."/>  <br/><h4>605-430-1418</a></h4></div>
</div>

1 个答案:

答案 0 :(得分:1)

  • max-with应为max-width
  • 在您的HTML中,您有</a>但它永远不会打开(在605-430-1418之后)

#tagline {
    float: right;
    z-index: 1;
    display: inline-block;
    margin-top: -75px;
    margin-right: 15%;
}

@media (max-width: 600px) {
    #tagline {
        display: none;
        visibility: hidden;
        clear: both;
    }
}
<div class="container">
    <div id="logo">
        <a href="../index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Nucleo-Logo','','../images/logo-over.png',1)"><img id="Nucleo-Logo" src="../images/logo.png" alt="Nucleo Fitness, Rapid City, SD" /></a>
    </div>
    <div id="tagline">
        <img src="../images/get_to_the_core.png" alt="Get to the core." /><br/>
        <h4>605-430-1418</h4>
    </div>
</div>