Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css - Vertical scroll bar remove

Tags:

html

css

Below is the code of the menu line with left&right additional images. I need the behavior: when resolution of the screen width something from 960px to 1398px -- left&right divs hides simultaneously. This code DO what I want exactly! The problem is that on the low screen width (960px to 1398px) it adds horizontal scroll bar to the browser :( But on my idea vertical scroll only need for screen width less that 960px. Any suggestions how to solve this? thanks.

html:

<div class="bxt">
            <div class="boxone"></div> 
            <div class="center"></div> 
            <div class="boxtwo"></div> 
</div>

css:

.bxt{
    width:960px;
    height:72px;
    margin:0 auto;
    position:relative;
    /*background-color:#000 */
}
.bxt div{
    position:absolute;
    width:219px;
    /* background:#CCCCCC; */
    top:0;
    height:72px;
    margin:0 0 0 0;
}
.bxt div.boxone{
    left:-219px;
        margin:0 0 0 0;
    background-image:url(images/i_02.jpg)
}
.bxt div.boxtwo{
    right:-219px;
        margin:0 0 0 0;
    background-image:url(images/i_04.jpg)
}
.bxt div.center{
    width:960px;
    height:72px;
    right:0;
    /* background:#AAAAAA; */
    background-image:url(images/i_03.jpg);
}
like image 380
abrahab Avatar asked Nov 28 '22 09:11

abrahab


2 Answers

You could use a media query:

body{
    overflow-y:hidden;
}
@media only screen and (max-width:960px){
    body{
        overflow-y:scroll;
    }
}

That will hide the scroll bar when the browser window is less than than 960px in width.

like image 72
Charlie Avatar answered Dec 19 '22 00:12

Charlie


body{
overflow-y:hidden;
}

Like this?

like image 25
vincent kleine Avatar answered Dec 18 '22 22:12

vincent kleine