duanbi6522 2017-05-29 06:44
浏览 447
已采纳

垂直滚动条不起作用

Here is my problem i want to use scrollbar but it is only showing scrollbar but that scrollbar is not working. I am using CSS to style the scrollbar and other layouts and Html to use that styling. here is my Styling Code

  #sub_menu, #content{
    display: inline-block;
}

#sub_menu{
    width:23%;
    height: 10%;
    background-color: #999999;
    padding: 1%;
    vertical-align: top;
    border: 1px solid;
}
#content{
    width: 73%;
    margin-right: 1%;
}
@media screen and (max-width: 600px), sreen\0{
 #sub_menu{
        height: initial;
        font-size: 15px;
        margin-bottom: 2%;
    }
    #content, #sub_menu{
        display: block;
        width: 95%
    } }
 .contentt {



  height: 100%;
  overflow-y: scroll;
  margin-bottom: 1%;
}

.contentt::-webkit-scrollbar { 

  display: none;
}

And Here is my HTML CODE

 <div id="sub_menu">
                      <h3  style="border-bottom: 3px solid rgb(135, 31, 139);">Related Videos</h3>


    <div class="contentt" style="width:100%;height:40%; margin-bottom:3%;padding:2%" >

     <?php

    $con = new mysqli('localhost','','','');


    $sql = "SELECT ID, Title, Link FROM that where Category like 'this'";
    $result = $con->query($sql);

    if ($result->num_rows > 0) {

    while($row = $result->fetch_assoc()) {

        $url = $row["Link"];


        $title = $row["Title"];
        $id = $row["ID"];
        $path="http://domain/Song.php";

        echo "<h5>$title'</h5>";
        echo '<a href="' . $path . '?Title=' . $title .'&id=' . $id .'"><img src="http://domain/images/' . $id .'.jpg"  alt="HTML tutorial" style="width:75%;height:95%;border:0;"class="btnn songpicc"></a>';

       echo '<hr>';
    }
    } else {
    echo "0 results";
    }

    $con->close();

    ?>
    </div>
    </div>

Thanks in Advance

  • 写回答

3条回答 默认 最新

  • douji8549 2017-05-29 06:57
    关注

    You need to fix the height of the container (not in %, but in px or em for example) with overflow-y: scroll;

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
  • ¥15 vs2019中数据导出问题
  • ¥20 云服务Linux系统TCP-MSS值修改?
  • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)
  • ¥20 怎么在stm32门禁成品上增加查询记录功能
  • ¥15 Source insight编写代码后使用CCS5.2版本import之后,代码跳到注释行里面
  • ¥50 NT4.0系统 STOP:0X0000007B
  • ¥15 想问一下stata17中这段代码哪里有问题呀
  • ¥15 flink cdc无法实时同步mysql数据
  • ¥100 有人会搭建GPT-J-6B框架吗?有偿