Forum Moderators: not2easy
i have the css to make the DIVS align next to each other, but when i place them inside of a larger div once full it goes to the next line and i want them to continue to overflow to create a horizontal scroll area.
here is my css to make the DIVs align left to right:
.video_207 {
float: left;
width: 207px;
margin-top: 0px;
margin-right: 3px;
margin-bottom: 3px;
margin-left: 0px;
position: relative;
left: 0px;
top: 0px;
background-color: #f7f7f7;
height: 200px;
is there a way to keep them aligning next to each other and create a horizontal scroll area instead of them starting a new line and a vertical scroll area?
thanks.
1. overflow-x
Set the width of the parent container, and set the
overflow-x to auto. Set overflow-y to hidden. This definitely won't work in... Opera and Safari (I think? I'm pretty sure they don't support overflow-x and overflow-y) but it should work in the majors (IE 6, 7 and Firefox.) If it doesn't, you may have to:
2.
in a divdiv
Like Babushka dolls, try having a fixed height
div with the width set to the sum of all your floated videos. Then, a div surrounding that one with a fixed width, and overflow: auto; -- it should work in all the modern browsers. Give it a go and let us know whether something works :)
Oh and Welcome to Webmaster World!
I have done something similar to this before. Basically you are looking at one <div> to contain the scrolling <div> which contains the individual <div>. Your css would look something like this:
#frame {
height: 200px /* just an arbitrary number */
width: 400px;
overflow: auto;
}
#holder {
height: 200px;
width: 100%; /* or do not indicate width */
}
.innerDiv {
height: 200px;
width: 200px; /* just an arbitrary number but you would need to assign a width */
float left;
}
Your HTML
<div id="frame">
<div id="holder">
<div class="innerDiv"></div><div class="innerDiv"></div><div class="innerDiv"></div><div class="innerDiv"></div><div class="innerDiv"></div> <!-- and so on -->
</div>
</div>
This should work.
Marshall