Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Hey guys, I dont want my website to resize itself when the windows has been resized, I want a scroll bar instead,

My website resizes itself when i make the window smaller, i want my website to stay the same size but with a scroll bar instead

Here's my entire stylesheet:

/**********************
GENERAL
***********************/
body {
 font-family: 'Open Sans', sans-serif;
}

html {overflow-y: scroll;
overflow-x: scroll;

}

#wrapper {
  max-width: 1000px;
  margin: 0 auto; 
  padding: 0 5%;

}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
}



/**********************
Heading
***********************/




ul#navmenu {

    list-style: none;
    text-align: center;
    outline: 1px solid red;
    width: 1300px;
    float: right;
    position: relative;
    margin-right: 277px
}

/*Hovering*/

ul#navmenu li:hover > a {
    background-color: #CFC;
}

ul#navmenu li:hover a:hover {

    background-color: gray;
}

/*positioning*/

ul#navmenu ul.sub1 {
    display: none;
    position: absolute;
    top: 47px;
    left: 0px;
    }


ul#navmenu .sub1 li {

    margin-top: 5px;
    list-style-type: none;
    margin-left: -42.5px;
}


ul#navmenu .sub1 a {
    margin-top: 3px;

}


/*dropdowntime*/
ul#navmenu li:hover .sub1 {

    display:block;
}



ul#navmenu a {
    text-decoration: none;
    display: block;
    width: 125px;
    height: 50px;
    background-color: #599a68;
    }

ul#navmenu li{


    width: 180px;
    text-align: center;
    position: relative;
    float: left;

}
nav {
   text-align: center;
    padding: 100px 0;
    margin: 20px 0 0;

  }


#logo { 
  text-align: center;
  margin:o;
}

h1 {
 font-family: 'Changa One', sans-serif;
  margin: 15px 0;
  font-size:1.75em;
  font-weight: normal;
  line-height: 0.8em;
}

h2 {
  font-size: 0.75em;
  margin: -5px 0 0;
  font-weight: normal;
}



  /**********************
NAVIGATION
***********************/





  /**********************
FOOTER
***********************/


  footer {
    font-size: 0.75em;
  text-align: center;
  clear:  both;
  padding-top: 50px;
  color:#ccc;


  }




/**********************
PAGE: PORTOFOLIO
***********************/


#gallery {

 margin: 0;
  padding 0;
  list-style: none;

}

#gallery li {
 float: left;
  width: 45%;
  margin: 2.5%;
  background-color: #f5f5f5;
    color: #bdc3c7;
}

#gallery li a p {
 margin: 0;
  padding: 5%;
  font-size: 0.75em;
  color: #bdc3c7;
}


}

}

/**********************
COLOURS
***********************/
/* site body */

body {

 background-color: #fff;
  color:#999
}
/*green header */

header {
  background: #6ab47b;
  border-color:#599888;

}
/*nav background on mobile*/
nav { background-color: #599a68;
}



h1, h2 {

  color: #fff;
}
/*link colour*/
a {
  color:#6ab47b;
}

nav a, nav a:visited {
  color: #fff;
}
/*selected nav link colour*/
nav a.selected, nav a:hover {

 color:#32673f; 

}

5 Answers

Try setting a width on your #wrapper selector rather than max-width.

Thanks that worked! At least the body did, but the heading section still responds

try overflow: scroll; only

I'ts still the same

where is this code from, track module and section please

not using overflow and my website works fine, has vertical scroll bar. what section are you on.

I'm on Build Navigation with Unordered Lists section. The problem is, whenever I resize my windows, my entire website gets smaller for mobile friendly, I don't want it, I want to be able to scroll vertically and horizontally without my website's size changing.

Works in Firefox and Chrome. (Problem with IE at moment probable need modification; webkit...) NOTE following changes in css.

main.css

/****************** GENERAL *******************/

  • { box-sizing: border-box; }

body { font-family: 'Open Sans', sans-serif; }

wrapper {

min-width: 940px; margin: 0 auto; padding: 0 10px; }

a { text-decoration: none; }

img { max-width: 100%; }

/****************** HEADING *******************/

header { float: left; margin: 0 auto 30px; padding: 5px 0 0 0; min-width: 1280px;

}

responsive.css

@media screen and (min-width: 1px) {

/****************** TWO COLUMN LAYOUT *******************/

@media screen and (min-width: 1px) {

/****************** HEADER *******************/

#logo { float: left; margin-left: 10px; text-align: left; min-width: 450px; }

nav { background: none; float: right; font-size: 1.125em; margin-right: 10px; text-align: right; min-width: 450px; }