stas-webdev stas-webdev - 2 years ago 158
CSS Question

HTML/CSS create body wider than viewport

I'll trying to create website with horizontal scrolling.
But when I set element wider than viewport - body is do not wider.

Following code doesn't works

body {
float: left

How I can do body wider than viewport?

I create fiddle for this -

Update: I have a unknown num of .grid-cell blocks, in theory. So, I don't know, how wide should be body width in each case. It should be flexible.

Answer Source

If you have unknown number of cells then just add overflow property on your html, body. see below:

html, body {
  position: relative;
  height: 100%;
  background: red;
  overflow: auto;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download