简体   繁体   English

使 <li> 不可滚动 <ul>

[英]Make <li> not scrollable in <ul>

I have the <ul> like this. 我有这样的<ul>

在此处输入图片说明

I want the text "You have 3 reminders." 我想要文本“您有3条提醒”。 not scrolling and stay on top. 不滚动并停留在最前面。 How can I do that? 我怎样才能做到这一点?

In the <ul> I have some code like this. <ul>我有一些类似的代码。

<ul class="dropdown-menu" role="menu" id="reminder"
style="max-height: 200px; width: 400px; overflow: hidden; 
overflow-y: scroll; padding-left: 10px; padding-right: 10px;"></ul>

Thank for your help. 谢谢您帮忙。

Maybe try to set the "You Have 3 Reminders" As the header and the rest mainly as content? 也许尝试将“您有3条提醒”设置为标头,其余设置为主要内容?

Something like this: HTML 像这样的东西:HTML

<article>
    <header>You Have 3 Reminders</header>

    <p id="ArticleTitle">Task Satu by admin to admin</p>

    <p id="Content">You have <b>Two Days Before</b> Reminder.</p>
</article>

CSS 的CSS

    ​#header {
        height:50px;
        width:100%;
        position:fixed;
        top:0;
        left:0;    
    }
.ArticleTitle{
    top:10;
}

You can experiment with position: fixed to get the result. 您可以尝试position: fixed获得结果。

Another option is to use position: sticky Although it isn't available in all browsers. 另一个选择是使用position: sticky尽管并非在所有浏览器中都可用。 Here is a reference to positioning. 是定位的参考。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM