I’m creating a page with a window, similar to the screenshot window you get on the iTunes App Store pages, showing a horizontally scrolling, wider page of information.
Have looked at, and successfully implemented the example documented here http://css-tricks.com/how-to-create-a-horizontally-scrolling-site/
On my implementation I have 3 ‘post’ sections, the middle one double width.
Below is the layout I’m trying to achieve, the 3rd ‘post’ is omitted, as is the outer container just for clarity as it’s quite messy. ‘post’ sections in red.
The first section is not a problem, the second one is and I’m struggling to get the boxes lined up.
Firstly, should I not expect to see them lined up until I have ALL the divs in the section in place? I’m thinking that might be right as the boxes affect each other.
Is there any frameworks available that would make this easier? I can see it’s just a case of a grid, sections of 84 pixels, with each box breaking out of the grid. I’ve had a quick look at Bootstrap, but wasn’t sure if that would help.
HTML
<div id="horizon">
<div class="post">
<div id="oneHead">
Box oneHead
</div>
<div id="oneCont">
Box oneCont
</div>
<div id="oneFoot">
<span class="lstPrice">Box lstPrice</span>
</div>
</div>
<div class="post-w">
<div id="twoHead">Box twoHead</div>
<div id="twoSubHead">Box twoSubHead</div>
<div id="twoSpacer">Box twoSpacer</div>
<div id="twoImgHead">
</div>
<div id="twoBar"></div>
<div id="twoImgFoot">
</div>
</div>
<div class="post">
</div>
</div>
CSS
#horizon {
width: 80%;
height: 504px;
margin-left: auto;
margin-right: auto;
margin-top: 20px;
overflow-x: auto;
overflow-y: hidden;
border-style: solid;
border-width: 1px;
border-color: #333;
}
.post {
width: 504px;
height: 504px;
margin-right: 5px;
}
.post-w {
width: 1008px;
height: 504px;
margin-right: 5px;
}
#onehead {
/*position: relative;*/
width: 504px;
height: 84px;
background-color: #333;
color: #FFF;
font-size: 28px;
padding-left: 4px;
}
#oneCont {
/*position: relative;*/
width: 504px;
height: 336px;
}
#oneFoot {
/*position: relative;*/
width: 504px;
height: 84px;
background-color: #333;
color: #FFF;
}
#twoHead {
/*top: 0px;
left: 0px;*/
width: 164px;
height: 84px;
background-color: #333;
color: #FFF;
font-size: 28px;
padding-left: 4px;
margin-right: 4px;
float: left;
}
#twoSubHead {
/*top: 0px;
left: 0px;*/
width: 164px;
height: 84px;
background-color: #BF8885;
color: #FFF;
font-size: 28px;
padding-left: 4px;
margin-right: 4px;
float: left;
}
#twoSpacer {
top: 0px;
left: 0px;
width: 164px;
height: 42px;
/*float: left;*/
}
#twoBar {
top: 0px;
left: 0px;
width: 504px;
height: 48px;
background-color: #333;
/*float: left;*/
margin-top: 4px;
margin-bottom: 4px;
}
#twoImgFoot {
width: 336px;
height: 224px;
/*float: left;*/
}
.twoImgHead {
top: 0px;
left: 0px;
width: 336px;
height: 224px;
/*float: left;*/
}
Any tips, suggestions, help, ideas, or even links to things that would help would be appreciated.