How do I make a page have three columns. With the outer side columns a fixed width. And the inner center be a variable width. My blog posts should be in the middle column. And other content I can edit in the two sidebars.
I want it to look and work like the current Google News design.
Reply
RileyApr-5-2014 10:45am
That type of page layout with a responsive design is called "The Holy Grail". That's because it's what lots of people want, but it's very tricky to get it to work properly.
This is a little more advanced web design. So you will have to enable "Show advanced CSS/HTML options" under the General preferences part of the Customize style menu.
Then on the page you want to have this layout you need to insert this CSS code Page options:
#main {
padding-left: 400px; /* LC width */
padding-right: 150px; /* RC width */
max-width:100%;
}
#main .common {
position: relative;
float: left;
}
#section {
width: 100%;
}
#column1 {
width: 400px; /* LC width */
right: 400px; /* LC width */
margin-left: -100%;
padding-left:12px;
}
#sidebar {
width: 150px; /* RC width */
margin-right: -150px; /* RC width */
float:right;
padding-right:12px;
margin-left:-12px;
}
#footer {
clear: both;
}
/*** IE6 Fix ***/
* html #column1 {
left: 150px; /* RC width */
}
.heading1container, .columnbody, .postbody{
width:95%;
}
#trash-can {
display: none;
}
@media screen and (max-width: 990px){
#column1 {
display:none;
}
#main {
padding-left:0;
}
}
@media screen and (max-width: 780px){
#sidebar {
display:none;
}
#main {
padding-right:0;
}
}
And then the right sidebar content will be HTML code that goes inside the "HTML at bottom end of main content" blank (second to last HTML input):
<div id="sidebar">
RIGHT SIDEBAR CONTENT GOES HERE
</div>
You can customize the "LC width" values to adjust the width of the left sidebar. And adjust the "RC width" to adjust the width of the right sidebar. The above settings have the left sidebar disappear on screens less than 990 pixels wide. And the right sidebar disappears at 780 pixels wide. So on mobile phones you will just see the center column's content. You can adjust those values too.
And you can also apply this page layout to your entire site by doing the same thing, but add the code to the Additional CSS and HTML part in Customizing style for the entire site.
Reply