0

I want add vertical scroll for may div element. I use -webkit-scrollbar CSS code but this method not working in firefox browser

I think only method for scrollbar in firefox browser is javascript method! please help me for this code

.news-box{
    width: 380px;
    height: 360px;
    margin-top: 20px;
    float: left;
    background: #fff;
    overflow-y: scroll;
}
.news-box-title{
    width: 340px;
    height: 60px;
    margin: 0px 20px 20px 0px;
    border-bottom: 1px solid #ebebeb;
    text-align: right;
    font-size: 18px;
    line-height: 60px;
}
.news-box li{
    line-height: 60px;
    height: 60px;
    color: #5d5d5d;
}
.news-box li:nth-child(even){

    background: #f2f2f2;
}
.news-box li a {
    line-height: 60px;
    height: 60px;
    padding:10px;
}
    <div class="news-box">
        <div class="news-box-title"><span>news</span></div>
        <li>
            <a target="_blank"  href="" title="">text</a>
        </li>
     <li>
            <a target="_blank"  href="" title="">text</a>
        </li>
             <li>
            <a target="_blank"  href="" title="">text</a>
        </li>
             <li>
            <a target="_blank"  href="" title="">text</a>
        </li>
             <li>
            <a target="_blank"  href="" title="">text</a>
        </li>
             <li>
            <a target="_blank"  href="" title="">text</a>
        </li>

            </div>

5
  • firefox isn't -webkit- it is -moz- or no prefix - by the way, the code you posted has a) no -webkit-scrollbar, and b) a scrollbar Commented Apr 24, 2018 at 11:29
  • I think dont working scroll in firefox Commented Apr 24, 2018 at 11:32
  • can you add scroll to my code? without javascript? I dont want use defualt scroll Commented Apr 24, 2018 at 11:33
  • You already have overflow-y: scroll; and that's what you need to add a vertical scrollbar. Commented Apr 24, 2018 at 11:33
  • You need to use a js plugin to get cross browser styled scrollbars Commented Apr 24, 2018 at 11:34

1 Answer 1

0
overflow:scroll;

example - jsfiddle

Sign up to request clarification or add additional context in comments.

1 Comment

I know i want to create custom scrollbar

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.