3 columns on frontpage

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
Tue Mar 25, 2014 1:43 pm
Reply with quote
Report this post
Hi
using the Creativity template, how can I get a 3 column layout in the mainbody position, with a Custom HTML module?

Thank you.
User avatar
Expert Boarder

GK User
Wed Mar 26, 2014 12:09 pm
Reply with quote
Report this post
Hello,

Please add the following code at the end of css/gk.stuff.css file:

Code: Select all
/* Columns in the content */
.gkColumns {
   margin: 0 -10px;
   overflow: hidden;
   width: auto;
}
.gkColumns > div {
   -webkit-box-sizing: border-box;
   -moz-box-sizing: border-box;
   -ms-box-sizing: border-box;
   box-sizing: border-box;
   float: left;
   padding: 0 10px;
}
.gkColumns[data-cols="2"] > div { width: 50%; }
.gkColumns[data-cols="3"] > div { width: 33.333333%; }
.gkColumns[data-cols="4"] > div { width: 25%; }
.gkColumns[data-cols="5"] > div { width: 20%; }
.gkColumns[data-cols="6"] > div { width: 16.666666%; }


Then you will be able to use the following code in the Custom HTML module:

Code: Select all
<div class="gkColumns" data-cols="X">
<div>
// … column content
</div>
...
</div>
User avatar
Administrator

GK User
Wed Mar 26, 2014 7:01 pm
Reply with quote
Report this post
Thank you very much :)
User avatar
Expert Boarder

GK User
Mon Apr 14, 2014 3:50 pm
Reply with quote
Report this post
Hi
This works very well, but is there any way of making it responsive as well,?
Thanks.
User avatar
Expert Boarder

GK User
Tue Apr 15, 2014 4:34 pm
Reply with quote
Report this post
Yes, it is possible - you have to just prepare proper media queries. In example:

Code: Select all
/* Small tablet view */
@media (max-width: 800px) {
.gkColumns[data-cols="2"] > div { width: 50%; }
.gkColumns[data-cols="3"] > div { width: 33.333333%; }
.gkColumns[data-cols="4"] > div { width: 50%; }
.gkColumns[data-cols="5"] > div { width: 50%; }
.gkColumns[data-cols="6"] > div { width: 50%; }
}

/* Mobile phones */
@media (max-width: 500px) {
.gkColumns > div { clear: both; }
.gkColumns[data-cols="2"] > div { width: 100%; }
.gkColumns[data-cols="3"] > div { width: 100%; }
.gkColumns[data-cols="4"] > div { width: 100%; }
.gkColumns[data-cols="5"] > div { width: 100%; }
.gkColumns[data-cols="6"] > div { width: 100%; }
}
User avatar
Administrator


cron