- This topic is empty.
-
AuthorPosts
-
March 22, 2012 at 3:27 pm #37296
Konnor
MemberSo I’m wondering how to code my layout.
I’m familiar with quite simply coding it like this……..
Naturally there would be more div’s than I’ve shown. I would then use a class to center elements in the page, whilst having the background patterns extend the whole width of the div/screen.
However, I was wondering, considering everything from the slider down to the footer is lined up in 2 columns, should it be more like this?
But, can this work with the backgrounds I have? Would I put the column div’s within the slider div? If so I can’t see how I could get my slider background pattern to work without applying it all the way down the page.
Which method would you choose? Or would they be an even better method for coding a layout like this?
Many thanks!
March 22, 2012 at 4:01 pm #99712wolfcry911
Participantcombine the graphic in the green and white divs and repeat it horizontally on the body. Then, I’d have a header section, sub header, and finally main content area. I wouldn’t utilize two column divs until the main content area.
March 22, 2012 at 5:46 pm #99718Konnor
MemberAh interesting. I’m guessing the loading speed is going to be better with one image, as oppose to seperate background images for the header and slider?
March 23, 2012 at 9:29 am #99760dfogge
Participanti would personally go with the first option to ensure the different sections could grow smoothly if more content needed to be added in the future. but that’s just me.
March 23, 2012 at 10:40 am #99763jstam
MemberMy thinking is do a hybrid of both. Lay your 2-column grid layout inside each of the div’s that control the background. If you structure your CSS well you’re not looking at a ton of additional markup.
March 23, 2012 at 1:32 pm #99785Konnor
Member@jstam so I could perhaps use classes for the left and right columns? Then apply that to where I need to in the slider and main content?
This is what I have currently for the slider section….
Welcome
Chilli Con Salsa is Norwich's premier destination for Cuban Salsa Dancing
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla magna turpis, tempor posuere elementum at, bibendum sit amet felis. Sed et mollis lorem. Cras id arcu odio. Nunc tinc
cAlign is the class that centers everything into my 960px width. “sliderLeft” will be floated left, the image will be floated right.
I’m thinking “sliderLeft” could instead become a “left” class, to also be used in the main section.
Is it okay and good practise to modify a class throughout your CSS?
Like so….
.left {
width: 580px;
float: left;
}
div#slider .left {
/**Some CSS**/
}
div#slider .left h3 {
/**Some CSS**/
}
div#slider .left p {
/**Some CSS**/
}
div#mainContent .left {
/**Some CSS**/
}Thanks!
March 23, 2012 at 2:02 pm #99789jstam
Member@Konnor Yeah, I’d say you’re on the right track there.
Create the style declarations for the generic .left and .right, then customize as you need them with higher specificity inside your parent containers (#slider in this case).
March 24, 2012 at 9:55 am #99839Konnor
MemberGreat. Cheers fella.
I assume that would also be a good option with an eye to making it responsive, so you can change the column widths easily.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.