full width background colour?

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Thu Jun 11, 2015 1:58 pm
Reply with quote
Report this post
Hi, I'm trying to make a custom HTML module have a background colour that spans the entire width of the browser window.

I've added the required background colour to my override.csss as follows;
Code: Select all
#gkMainbodyTop {
background: #f8f8f8;
}


But it doesn't go across the full width of the browser window?
background-width.PNG

Thanks
User avatar
Expert Boarder

GK User
Thu Jun 11, 2015 4:46 pm
Reply with quote
Report this post
Hi,
try to increase width using max-width:100%; for this class.
User avatar
Platinum Boarder

GK User
Fri Jun 12, 2015 8:47 am
Reply with quote
Report this post
I already tried that - it has no effect for some reason.

I can see it working for the "We turn ideas into our work" module in the demo?

Thanks
User avatar
Expert Boarder

GK User
Fri Jun 12, 2015 4:42 pm
Reply with quote
Report this post
My code works, but it request to use right class.

Because by default in code you will find
.gkPage {
max-width: 1150px;
}


For example use following code for bottom5 position:
Code: Select all
#gkBottom5 .gkPage {
    max-width: 100%;
}


check using firebug class'es on selected by you position :whistle:
User avatar
Platinum Boarder

GK User
Thu Jun 25, 2015 10:53 am
Reply with quote
Report this post
Thanks Oscar. I think I can see what the problem is - the module I'm using is adding "custom" before the gkPage - see attached;
background-width1.PNG


This is my entry in override.css;
Code: Select all
#gkMainbodyTop .gkPage {
background: #f8f8f8;
max-width: 1150px;
}
User avatar
Expert Boarder

GK User
Thu Jun 25, 2015 6:51 pm
Reply with quote
Report this post
Sometimes you have to add "!important" in css rule to get work.
User avatar
Platinum Boarder

GK User
Thu Jun 25, 2015 7:48 pm
Reply with quote
Report this post
I've added that and I still only get a grey box around the module itself
User avatar
Expert Boarder

GK User
Thu Jun 25, 2015 11:18 pm
Reply with quote
Report this post
I have to see to tell more...
User avatar
Platinum Boarder

GK User
Fri Jun 26, 2015 3:29 pm
Reply with quote
Report this post
new.guidancesolutions.co. uk

Thanks
User avatar
Expert Boarder

GK User
Sun Jun 28, 2015 6:53 pm
Reply with quote
Report this post
Code: Select all
#gkMainbodyTop .gkPage {
    background: white;
}

and BG will be white.
and about width , but it will work for whole section, check
Code: Select all
.gkPage {
    max-width: 100%;
}
User avatar
Platinum Boarder

GK User
Sun Jun 28, 2015 7:40 pm
Reply with quote
Report this post
OK, that has made the background full width but also the entire content has been stretched?
User avatar
Expert Boarder

GK User
Sun Jun 28, 2015 7:50 pm
Reply with quote
Report this post
Yep. This template was designed like that. sorry it wasn't me.
so now you have to center content or/and paddings inside blocks, one by one. (CSS also)
User avatar
Platinum Boarder

GK User
Sun Jun 28, 2015 8:08 pm
Reply with quote
Report this post
Hmm, if I remove the 100% in my override.css file then the content is not stretched? (I've removed it now so you can see the difference).

It affects all modules not just the ones I'm focusing on.

Thanks
User avatar
Expert Boarder

GK User
Sun Jun 28, 2015 9:55 pm
Reply with quote
Report this post
Yep,
it's because of structure... whole content have max-width with value and were centered,
check.jpg

so when we (you) remove this global limitation, you have to add limitation again but on the lower layer.

Check this code, with my previous also
Code: Select all
#gkMainbodyTop .content {
    margin: 0 auto;
    max-width: 1150px;
}

Then "Latest News" should be okey, using this same trick, you have to fix all module positions below
User avatar
Platinum Boarder

GK User
Wed Jul 01, 2015 11:28 am
Reply with quote
Report this post
Even that didn't work :(

I finally got it to work by placing all my homepage content in the bottom1, bottom2, bottom3 module positions as these have the correct css to make them grey alternately (and full width).

Thanks for your help with this.
User avatar
Expert Boarder


cron