Currently, I am in the process of converting a 3-column website to be responsive by using percentages and em's instead of negative pixel margins. This will ensure that the site functions well on various devices.
I am facing a similar issue as discussed in this post: HTML float right element order
Following the advice given in this article by @bookcassey, I have placed all columns in a container that is floated right, with child elements inside floated left. However, I am still struggling to get the columns in the correct order (#NavColumn #ContentColumn #ExtraColumn).
The HTML code looks like this:
<!DOCTYPE html>
<html>
<head>
<title>3 Col Page</title>
<meta name='description' content='Sample 3 Column Page'>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" media="screen and (max-width: 800px)" href="./support-files/landscapemobile.css" />
<link rel="stylesheet" type="text/css" media="screen and (max-width: 480px)" href="mobile.css" />
</head>
<body>
<div id="PageWrapper">
<div id="Header">
<div class="Liner">
Header Links Etc
</div> <!-- End Header Liner -->
</div> <!-- End Header -->
<!-- Begin Center Column Content -->
<div class="OuterBG threecol"> <!-- disregard. There are no rules for this. This was part of a tut-->
<div class="MidBG"> <!-- disregard. There are no rules for this. This was part of a tut-->
<div class="InnerBG">
<div id="ContentColumn"> <!-- col1 in tut -->
<div class="Liner">
<h1>Page Headline</h1>
Page Content, Images Lorem Upsim etc...
</div> <!-- End Content Column -->
</div> <!-- End Liner -->
<div id='NavColumn'>
<div class='Liner'>
<div class='Navigation'>
Site
Navigation
Links
</div><!-- end Navigation -->
</div><!-- end Navigation Liner -->
</div><!-- end NavColumn -->
<div id='ExtraColumn'>
<div class='Liner'>
Extra
Column
Content
</div><!-- END Extra Column Liner-->
</div><!-- END ExtraColumn -->
</div><!-- END colleft -->
</div><!-- END colmid -->
</div><!-- END colmask and threecol -->
<div id='Footer'>
Footer Content, Address etc...
</div>
</div><!-- END PageWrapper -->
</body>
</html>
Here is the CSS code:
#PageWrapper{
margin:1em auto;
max-width:60em; /*960px / Default Font Size of 16px = em result*/
border:0.3125em groove #DDDDDD;
background-image:url(../image-files/background.gif);
background-repeat:repeat-y;
}
.InnerBG{float:right;/*border:3px solid red;*/width:100%;}
#Header{position:relative;}
#Header .Liner{padding:0;}
#Header a.header-home-link{max-width:60em;display:block;}
#Header img{display:block;}
#ShareThis{width:100%;margin:1em auto 2em;}
#NavColumn, #ContentColumn, #ExtraColumn {float:left;}
#ContentColumn{max-width:62.50%;/*border:2px solid green;*/width:100%;}
#NavColumn{max-width:18.645833333%;text-align:center;font-size:90%;color:#000;width:100%;}
#ExtraColumn{max-width:18.645833333%;text-align:center;font-size:90%;color:#000;width:100%;}
It has been an extensive process trying to figure out the ideal CSS rules to display the columns correctly. If anyone has suggestions on how to resolve the column display issues witnessed here: , I would greatly appreciate the help. Thank you in advance for any assistance provided.