Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have used jquery and the animate call to set heights of divs, but you can set the animate speed to 0.</p> <p>The example belows was for some mockups for quickly playing around with 2,3,5... block designs. The Jquery animate call is used to size the height of divs for main content, sidebar etc, ... but this may be a bit over the top for your requirement. </p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Mock_2_ColGoldenRatio.aspx.cs" Inherits="ia._HtmlMocks.Mock_2_ColGoldenRatio" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" &gt; &lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;style type="text/css" &gt; /*normalise*/ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin:0; padding:0; font-size:100%; font-style:normal ; font-weight:normal; border-collapse:collapse ; border-spacing:0; border:0; border-width: 0px ; text-align:left; } q:before,q:after { content:''; } /*center everything using html container*/ html{ text-align: center ; } /* wash with olive ; make body width max 976 px ; no margin ; relative position so other elements within */ body { background-color:Olive; width:976px; margin:0 auto ; text-align: left ; position: relative ; } #HeaderEnc { background-color : Maroon ; } #SearchEnc{ background-color: red ; border-width: 0px ; } #MainBlogNav{ background-color:Yellow ; } /* postion relative to normal flow */ #ContentEnc{ background-color: Teal ; position: relative ; } #ContentSideBarA { position: absolute ; background-color: #AAA ; left: 62% ; width: 38% ; } #ContentMainEnc{ position: absolute ; background-color: #888; left: 0% ; width: 62% ; } #ContentSideBarB{ position:absolute ; background-color : #AAA ; left: 0% ; width: 0px ; } #FooterEnc{ position: absolute ; background-color: blue ; left: 0 ; width: 100% ; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="HeaderEnc"&gt; The quick brown fo jumped over the lazy dog. &lt;br /&gt; HeaderEnc &lt;div id="SearchEnc"&gt;SearchEnc&lt;/div&gt; &lt;div id="MainBlogNav"&gt;MainBlogNav&lt;/div&gt; &lt;/div&gt; &lt;div id="ContentEnc"&gt; &lt;div id="ContentMainEnc"&gt;&lt;i&gt;ContentMainEnc&lt;/i&gt; : &lt;% Response.Write( GetContentBig()) ; %&gt; &lt;/div&gt; &lt;div id="ContentSideBarA"&gt;&lt;i&gt;ContentSideBarA&lt;/i&gt; &lt;% Response.Write( GetContentSmall()) ; %&gt; &lt;/div&gt; &lt;div id="ContentSideBarB"&gt;&lt;i&gt;ContentSideBarB&lt;/i&gt; &lt;% /*Response.Write( GetContentMedium()) ;*/ %&gt; &lt;/div&gt; &lt;i&gt;ContentEnc-Start&lt;/i&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;i&gt;ContentEnc-Start&lt;/i&gt; &lt;/div&gt; &lt;div id="FooterEnc" &gt;FooterEnc&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; &lt;script src="../../Scripts/jquery-1.3/jquery-1.3.1.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="../../Scripts/plugins/dimensions_1.2/jquery.dimensions.js" type="text/javascript" &gt;&lt;/script&gt; &lt;!--&lt;script src="../../Scripts/Common/IaCommon.js" type="text/javascript" &gt;&lt;/script&gt;--&gt; &lt;script type="text/javascript" &gt; /* * ia.common 0.1.0 * */ var ia = {} ia: "0.1.0"; // gets max settings from set of elements var getBoundaries = function(elements) { var maxHeight = 0; var maxTop = 0; var itemSelector = ''; var itemHeight = 0; var itemPosition = {}; var itemTop = 0; for (i = 0; i &lt; elements.length; i++) { itemSelector = elements[i] itemHeight = $(itemSelector).height(); itemPosition = $(itemSelector).position(); itemTop = itemPosition.top; maxHeight = itemHeight &gt; maxHeight ? itemHeight : maxHeight; maxTop = itemTop &gt; maxTop ? itemTop : maxTop; } return { 'maxHeight': maxHeight, 'maxTop': maxTop }; } // Rets truthy ; used by property get/set public fns var SetIfOk = function(val) { return val; } // IaPage class var IaPage = function(objSpec) { // override default page object with defaults from caller var that = $.extend({ 'speedFooterAnimate': 3000 , 'speedContentAnimate': 1000 }, objSpec || {}); // fn to move footer, ... to correct position : inmann clearing that.arrangePageStructure = function() { boundaries = getBoundaries(this.ContentElements); $(this.FooterEncSelector[0]).animate({ 'top': boundaries.maxTop + boundaries.maxHeight }, this.speedContentAnimate); $(this.ContentEncSelector[0]).animate({ 'height': boundaries.maxHeight }, this.speedFooterAnimate); }; // Ret return that; } var iaPage = IaPage( { 'ContentEncSelector': ['#ContentEnc'] , 'FooterEncSelector': ['#FooterEnc'] , 'ContentElements': ['#ContentEnc', '#ContentSideBarA', '#ContentMainEnc', '#ContentSideBarB'] } ); $(function() { iaPage.arrangePageStructure(); } ); &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload