<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="/templates/default/atom.css" type="text/css" ?>

<feed 
   xmlns="http://www.w3.org/2005/Atom"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <link href="http://absolutepositioning.com/feeds/atom.xml" rel="self" title="Absolute Positioning" type="application/atom+xml" />
    <link href="http://absolutepositioning.com/"                        rel="alternate"    title="Absolute Positioning" type="text/html" />
    <link href="http://absolutepositioning.com/rss.php?version=2.0"     rel="alternate"    title="Absolute Positioning" type="application/rss+xml" />
    <title type="html">Absolute Positioning</title>
    <subtitle type="html">An Element in Web Design</subtitle>
    <icon>http://absolutepositioning.com/templates/default/img/s9y_banner_small.png</icon>
    <id>http://absolutepositioning.com/</id>
    <updated>2007-01-09T09:00:09Z</updated>
    <generator uri="http://www.s9y.org/" version="1.0.1">Serendipity 1.0.1 - http://www.s9y.org/</generator>
    <dc:language>en</dc:language>

    <entry>
        <link href="http://absolutepositioning.com/archives/14-Absolute-Positioning-Absolutely-Not!.html" rel="alternate" title="Absolute Positioning? Absolutely Not!" />
        <author>
            <name>Steve Monas</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-01-09T07:31:15Z</published>
        <updated>2007-01-09T09:00:09Z</updated>
        <wfw:comment>http://absolutepositioning.com/wfwcomment.php?cid=14</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://absolutepositioning.com/rss.php?version=atom1.0&amp;type=comments&amp;cid=14</wfw:commentRss>
    
            <category scheme="http://absolutepositioning.com/categories/22-Chap-05" label="Chap 05" term="Chap 05" />
    
        <id>http://absolutepositioning.com/archives/14-guid.html</id>
        <title type="html">Absolute Positioning? Absolutely Not!</title>
        <content type="xhtml" xml:base="http://absolutepositioning.com/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p><font color="#000000" size="5"><strong>Absolute Positioning? Absolutely Not!</strong></font></p><br /><p align="justify"><font color="#000000" size="2">Absolute Positioning? Absolutely not! This reaction to the process of absolutely positioning elements on a web page is understandable but not justified.  Why ever not?  Absolute positioning provides the designer with certain advantages and a quite a few disadvantages too. However, before we actually set out the long list of advantages and disadvantages, let us look at the concept of absolute positioning.</font></p><br /><p><strong><font color="#000000">Defining Concepts</font></strong></p><br /><p align="justify"><font color="#000000">Absolute positioning defines the x and y coordinates of an element with reference to the top left corner of the browser page or the containing block and the position attribute is set to absolute.  The code will read as under:</font></p><p align="left"><br /><font color="#000000" size="2">&lt;STYLE TYPE= “text/css”&gt;<br />&lt;! –<br />P{position: absolute; left 50 pt; top:30pt}<br />&lt;/STYLE&gt;</font></p><br /><p align="justify"><font style="BACKGROUND-COLOR: #ffffff" size="2"><font color="#000000">Note that the right and bottom coordinates have not been defined. So the text moves to the right and the bottom of the page.  Specifying all four coordinates will give you greater control over the element.</font>  </font></p><br /><p align="justify"><font style="BACKGROUND-COLOR: #ffffff" color="#000000" size="2">Absolute positioning removes the element from the normal flow of the document and it does not impact the other elements on the page when the page is loaded.  This means that the element is placed in an arbitrary position somewhere in the viewport and its properties are set by the top, bottom, left and right attributes.</font></p><br /><p align="justify"><font style="BACKGROUND-COLOR: #ffffff" color="#000000" size="2">A point that needs to be noted here is that if the absolutely positioned element is a child element of another element which has not been placed static, then the absolutely placed element will not be placed relative to the viewport, but relative to the parent box.  In the following code three boxes have been specified.  When the code is executed, box one will be placed relative to the view port.  Box two will be placed absolutely and box three as the child of box two will be placed relative to box two.</font></p><p><br /><font color="#000000">#one {<br /> position: absolute;<br /> top: 1em;<br /> left: 1em;<br />}<br />#two {<br /> position: absolute;<br /> top: 3em;<br /> left: 2em;<br />}<br />#three {<br /> position: absolute;<br /> top: 0.5em;<br /> left: 0.5em;<br />}<br />&lt;P ID=&quot;one&quot;&gt;This is box one.&lt;/P&gt;<br />&lt;DIV ID=&quot;two&quot;&gt;<br /> &lt;P&gt;This is box two.&lt;/P&gt;<br /> &lt;P ID=&quot;three&quot;&gt;This is box three, which is also inside box two.&lt;/P&gt;<br />&lt;/DIV&gt;</font></p><p><br /><font color="#000000">One common use of absolute positioning is for creating columnar layouts for the web pages. You would probably create two Div ID to represent the columns and define a block of text within each &lt;Div&gt;. This can also be achieved by defining the following style sheet.</font></p><p align="justify"><br /> <font color="#000000">#columns {<br /> position: relative;<br /> top: 0;<br /> right: 0;<br /> padding-right: 10em;<br />}<br />#right {<br /> position: absolute;<br /> top: 0;<br /> right: 0;<br /> width: 9em;<br />}</font> <br /><font color="#000000">In this code we have set the position of the container to relative and the position of the boxes absolute with reference to the container. A right padding of 10em is included to make the necessary room for the box.  Margins are not set.  The width of the element is inside its margin and contains the padding.  If the margin is set it will to the right of the text and the positioned box!</font></p><br /><p align="justify"><font color="#000000">The user agent or the application that processes the web page such as the browser selects the initial containing block. It also could be related to the veiwport.</font>  </p><br /><p align="justify"><font color="#000000">It is ok to assign negative values to the absolutely positioned elements.  However, this may result in non-display of the element.</font></p><p align="justify"><font color="#000000">Layers can be used to absolutely position elements on a page.  Layers are created using the div tag as in the following code:</font></p><font style="BACKGROUND-COLOR: #ffffff" color="#000000">&lt;div style=&quot;position: absolute; left: 610px; top: 80px; height: 400px; width: 100px; padding: 1em;&quot;&gt;layer stuff&lt;/div&gt;</font><p /><p align="justify"><br /><font color="#000000">It is possible to position the layer and also define its dimensions. However, the latter is optional. Absolute positioning can use absolute (px) and relative (%) units of measurement.</font> </p><p align="justify"><font color="#000000">The advantage of using layers with div tags is that they load faster.  All the style information is contained in the attributes added. The overlapping layers can be created using the z-index command.  The values assigned to the z index will determine its order in the stack.  The higher the index the closer the div will appear to the front of the page.  The layer that holds the page’s content should be given the z index of one so that users can read the content and click on the navigation elements.</font></p><br /><p align="justify"><font color="#000000">Absolute positioning gives complete control over the elements of a web page to you.  Once the element is pulled out of the flow it can be placed anywhere in the page and this will allow you the freedom to display your content before your navigation structures become visible. This enables you to provide the user with optimum accessibility and to optimize your content for search engines.</font> </p><br /><p align="justify"><font color="#000000">However, absolute positioning can cause problems of overlapping if adequate care is not exercised.  Layouts that use absolute positioning for columns can have problems with footer display if the column length is not correctly estimated.</font></p><br /><p><font style="BACKGROUND-COLOR: #ffffff"><strong>Comparing Concepts</strong></font></p><br /><p align="justify"><font style="BACKGROUND-COLOR: #ffffff" color="#000000">Most users are confused between absolute and relative positioning concepts in CSS.  This is because of the coordinate system within which the block is placed.  The block then depends on the positioning context and there is no universal set of coordinates to guide the designer.  Whenever a new block is placed on the page it creates a positioning contexts for its descendents with reference to the upper left hand corner of the page. It another element is placed within the first element, its position will be calculated with reference to the top left corner of the containing block and not the page.  The code fragment below will place an absolutely positioned element with reference to the top left corner of the page.</font></p><br /><font color="#000000">&lt;div class=&quot;MyTitle&quot;<br />  style=&quot;position:absolute; left:125px; top:75px;&quot;&gt;<br />  This text is being absolutely positioned with reference to the page.<br />&lt;/div&gt;</font><p align="justify"><br /><font color="#000000">If a second div is placed within the first one as in the code under, the positioning context will indent the second line 25px from the first as the positioning context determines the position of the second element within the first one.</font> </p><br /><font style="BACKGROUND-COLOR: #ffffff" color="#000000">&lt;div class=&quot;MyTitle&quot;<br />  style=&quot;position:absolute; left:125px; top:75px;&quot;&gt;<br />  This text is being absolutely positioned with reference to the page.<br />  &lt;div class=&quot;MyTitle&quot;<br />    style=&quot;position:absolute; left:25px; top:30px;&quot;&gt;<br />    This is another absolutely positioned element within the first one.<br />  &lt;/div&gt;<br />&lt;/div&gt;</font><p align="justify"><br /><font color="#000000">The font size will also be larger as the second line is treated as the child of the first element and its font size is calculated relative to the first element.</font> </p><br /><p align="justify"><font color="#000000">If a third element is added using the relative positioning, it will be contained within the second element. Relative positioning will render the text slightly to the right of the second element within the span.  This is because it calculates the position with reference to the original position on the page.</font></p><p><br /><font color="#000000">:&lt;div class=&quot;firstDiv&quot;<br />     style=&quot;position:absolute; left:125px; top:75px;&quot;&gt;<br />  This text is being absolutely positioned with reference to the page.<br />  &lt;div class=&quot;firstDiv&quot;<br />       style=&quot;position:absolute; left:25px; top:30px;&quot;&gt;<br />    This is&lt;span style=&quot;position:relative; left:10px;<br />top:30px;&quot;&gt;relative positions example&lt;/span&gt; is contained within the second line.<br />  &lt;/div&gt;<br />&lt;/div&gt;</font></p><p align="justify"><br /><font color="#000000">In short the absolutely positioned elements are placed relative to the positioning context in which they are located while relatively positioned elements create their own positioning context based on their original location.</font></p><br /><p><strong>Combining Concepts</strong></p><br /><p align="justify"><font color="#000000">Absolute positioning is relative!   In reality an absolutely positioned element is relative to the containing block.  The containing block is the nearest positioned ancestor or the document’s initial containing block.  It is a structurally superior element whose property is absolute or fixed or relative.  The following example shows how an absolutely positioned element can be relative to the containing block. The H3  positioned as relative allows the span to be positioned relative to the containing header.</font></p><p><br /><font color="#000000">h3 {<br />  position: relative; /<strong> So that elements INSIDE this header can be positioned relative to the header </strong>/<br />}</font></p><p><font color="#000000">h3 span {<br />  position: absolute;<br />  display: block; /<strong> So we can give the element a width </strong>/<br />  top: 3px;<br />  right: 3px;<br />  width: 10px;<br />}</font></p><p><font color="#000000">&lt;h3&gt;Some header &lt;span&gt;!!!&lt;/span&gt;&lt;/h3&gt;</font></p><p align="justify"><br /><font color="#000000">Parent child relationships affect absolute positioning.  The position of the child element is determined in relation to the parent element.  The contained element’s absolute position will be referenced in relation to the upper left corner of the &lt;div&gt; element.</font></p><br /><p align="justify"><font color="#000000">A relative element can be nested in an absolute element.  The relative element will be treated as a child of the absolute element and its position on the page will be determined in the context of the parent’s position on the page.  The relative element is moved to its original position in the flow within the parent element. The code for this will read as under:</font></p><br /><p><font style="BACKGROUND-COLOR: #ffffff"><font color="#000000">.relpos { position: relative;<br />            left: 150px<br />           }</font> </font></p><p><br /><font color="#000000">The markup of the second page will read as under:</font></p><p><br /><font color="#000000">&lt;div class=&quot;relpos&quot;&gt;<br />&lt;img src=&quot;horse1.jpg&quot; alt=&quot;Horsie&quot; /&gt;<br />&lt;/div&gt;</font></p><p align="justify"><br /><font color="#000000">An absolute element can also be nested within a relative element.  The relatively positioned element is the parent and the absolutely positioned element is the child.  It positioned will be determined with reference to the coordinates within the relatively positioned element. The absolutely positioned element will move if the relatively positioned element is moved.   The css code will read as under:</font></p><p><br /><font color="#000000">.relposx { position: relative;<br />              top: 270px;<br />              left: 0px;<br />              border: teal thick groove<br />             }</font> </p><p><br /><font color="#000000">The code for the absolutely positioned element will read as under:</font></p><p><br /><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font color="#000000"><font size="2"><font color="#000000">.</font><font face="verdana,arial,helvetica,sans-serif" color="#000000">abposx { position: absolute;<br />              top: 0px;<br />              left: 150px;<br />              z-index: 0<br />             }</font></font> </font></span></p><p /><p><br /><strong>z Index Property and Positioning—Absolute/Relative</strong></p><br /><p align="justify"><font color="#000000">CSS allows overlay of elements to create a 3D effect.  The elements can be absolutely positioned in such a way that they are positioned in overlapping layers. A stacking happens and the z index order value is used to position the layer in the stack and consequently the image or text.  The code below is illustrative of this technique. It positions one image slightly above the other.</font></p><br /><font color="#000000">.csslogo{ color: red;<br />              font-size: 42pt;<br />              font-weight: bold;<br />              top:110px;<br />              left: 80px;<br />              position: absolute;<br />              z-index:1<br />             } <br />.wkshop { color: black;<br />              font-size: 26pt;<br />              font-weight: bold;<br />              top:140px;<br />              left:200px;<br />              position: absolute;<br />              z-index:2<br />             }</font> <p /><p align="justify"><br /><font color="#000000">As indicated in the opening sentence, many programmers feel that Absolute positioning should not be encouraged for web page design.  Their contention is that absolutely positioned elements on a web page make for rigidity in design and can cause display problems when they are executed in different browsers and computers with different resolutions.  One solution could be that we create different style sheets for different resolutions and take advantage of the strengths of using absolute positioning of elements in a web page.  As I said earlier, the design of the web page is only limited by the imagination of the designer and the tools he brings into play in the creation of his art.  Scripting languages and object oriented programming techniques are coming up with a number of useful methods of designing and controlling the elements of the web page.  Why not take advantage of them?  Why complain about the problems of absolutely positioning elements?  I would say yes to absolute positioning provided it is used skillfully and effectively by the designer!</font></p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://absolutepositioning.com/archives/13-Layers-and-Positioning-of-Elements.html" rel="alternate" title="Layers and Positioning of Elements" />
        <author>
            <name>Steve Monas</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-01-06T07:49:50Z</published>
        <updated>2007-01-06T18:27:01Z</updated>
        <wfw:comment>http://absolutepositioning.com/wfwcomment.php?cid=13</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://absolutepositioning.com/rss.php?version=atom1.0&amp;type=comments&amp;cid=13</wfw:commentRss>
    
            <category scheme="http://absolutepositioning.com/categories/21-Chap-12" label="Chap 12" term="Chap 12" />
    
        <id>http://absolutepositioning.com/archives/13-guid.html</id>
        <title type="html">Layers and Positioning of Elements</title>
        <content type="xhtml" xml:base="http://absolutepositioning.com/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p><b><font size="3"><font face="verdana,arial,helvetica,sans-serif" color="#000000">Layers and Positioning of Elements</font></font></b></p><p><span><font size="3"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif">A layer is a type of container.<span>  </span>It can hold text, images, tables and other layers. While layers are extremely difficult to hardcode and a number of browsers do not support layers, they can be used to an advantage for obtaining text and image effects and for the creation of web sites that are creative.<span>  </span>The web designer can also have immense versatility in the positioning of elements on a page.<span>  </span>A number of software, like Dreamweaver have provided designers with tools for creation of layers with ease.<span>  </span></font></font></font></span></p><p><b><span><font size="3"><font face="verdana,arial,helvetica,sans-serif" color="#000000">Using Layers to Position Elements.</font></font></span></b></p><p style="TEXT-ALIGN: justify"><span><font size="3"><font face="verdana,arial,helvetica,sans-serif" color="#000000">Coordinates and positioning are two important attributes of the layer that have to be considered the moment the web designer works on his composition.<span>   </span>The coordinate system x/y begins with the top right corner of the page.<span>  </span>Layers can be stacked or overlapped in the order supplied by the third coordinate called the z-index, which is used by the web browser to determine the topmost layer of the stack.<span>  </span>Positioning of elements on a layer is similar to positioning of elements on the web page—static, relative and absolute. Static positions, as we have already stated, treat the image or text like a block in the normal flow.<span>  </span>Relative positioning places the element with reference to the top left corner of the document.<span>  </span>Absolute positioning takes the layer and the elements on it away from the normal flow and places them in coordinates of their own.<span>  </span>They are not affected by the contents of the page.</font></font></span></p><p><b><font size="3"><font face="verdana,arial,helvetica,sans-serif" color="#000000">Attributes and Positions</font></font></b></p><p><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="3">An HTML attribute or a style property is called a parameter in web design parlance.<span>  </span>For instance, the ID parameter means either an ID attribute that can used with the &lt;LAYER&gt; tag or the ID Style property.<span>  </span>However, property means Style property.</font><font size="3"><font color="#000000"> </font></font></font></p><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3">The &lt;LAYER&gt; tag takes on pixels as the unit of measurement for attributes that specify the distance.<span>  </span>Style properties are generally numerical values.</font></p><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3">The Position property only applies to layers that have been defined as styles and its value can be absolute or relative.</font></p><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3">ID is an identity for the layer and must begin with an alphabet.<span>  </span>The ID can be used to refer to the layer in the code.<span>  </span>This is an optional attribute.</font></p><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3">The Left and Top parameters are used to specify the horizontal and vertical positions of the top-left corner of the containing layer or page.<span>  </span>The value has to be an integer.</font></p><p><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="3">PageX and PageY properties are sometimes used to specify the horizontal and vertical positions in pixels of the top left corner of the layer relative to the enclosing document if there is no equivalent style property specified with the &lt;layer&gt; tag.</font><font size="3"><font color="#000000"> </font></font></font></p><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3">The SRC and Source –include style attribute are used to specify the HTML document that needs to be displayed in a specific layer.<span>  </span>This source file can include JavaScript code and all layers in the source file will be treated as child layers.<span>  </span>This technique is useful if the content has to be dynamically changed constantly.</font></p><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3">The chef doesn't have to rewrite the entire page just to update the information about the special of the day.</font></p><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3">The Width parameter is used when the layer’s contents have to warp to fit within the layer. An integer value is normally used but percentages can also be ascribed. However if the layer contain images which cannot be warped the layer will ignore the width property and expand automatically to accommodate the width of the image.<span>  </span>By default it will warp at the right boundary of the containing layer. </font></p><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3">The height parameter defines the initial height of the clipping region of the layer.<span>  </span>This is expressed as an integer value or a percentage of the height of the containing layer. Like the width property, the height will also expand to accommodate elements which cannot be warped. By default the height is the minimum height for all the contents of the layer.</font></p><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3">The Clip property defines the clipping rectangle—that is the visible boundaries of the layer. It takes the top, left, right and bottom values as pixels.<span>  </span>The left and right values are pixels with reference to the left edge of the rectangle and the top and bottom are defined with reference to the top edge of the layer itself.<span>  </span>If the right and bottom values are specified the other two values will default to zero. If no value is specified, the values of the width and height will be determined by the contents of the layer. </font></p><p><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="3">Z-Index, above and below are three attributes used by the &lt;LAYER&gt; tag for defining the stacking order of the layers.<span>  </span>Values specified in these attributes will override default values.<span>  </span>The topmost layer will have the highest z-index value. The Above attribute refers to the layer above the referenced layer and the below attribute refers to the layer immediately below the referenced layer.<span>  </span>All nested layers are stacked above the parent layer.</font><font size="3"><font color="#000000"> </font></font></font></p><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="3">The visibility attribute will determine the visibility or invisibility of the layer. Pop up menus are examples of setting visibility attributes to layers.<span>  </span>All submenus are created as invisible layers and they pop up on mouse-over events. HIDE hides the layer and INHERIT causes the layer to have the same visibility as the parent layer. This is also the default value. A layer with a visibility set to show may not be visible if there are other layers with the visibility set to show above it.</font><font size="3"><font color="#000000"> </font></font></font></p><p><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="3">By default layers are transparent. The BG-Color and Background-color can be specified to define the color of the layer.<span>   </span>The Background color will be applied to the rectangular region occupied by the layer. If a border is defined in the Style the region will be enclosed with a border in the color specified for the border. </font><font size="3"><font color="#000000"> </font></font></font></p><p><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="3">The Background and Background-image style properties assign a tiled image across the background of the layer. The value specified is the URL of the image. </font><font size="3"><font color="#000000"> </font></font></font></p><p><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="3">OnMouseOver and OnMouseOut, OnFocus, OnLoad, event handlers are functions or inline JavaScript code that can be invoked to make visible or invisible layers.</font><font size="3"><font color="#000000"> </font></font></font></p><p><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="3">Finally the NoLayer tag displays the content as if was not positioned at all.<span>  </span>If layers functionality is required, it will generate JavaScript errors.</font><font size="3"><font color="#000000"> </font></font></font></p><p><font size="3"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif">Layers can contain applets and plugins which are special windowed elements that float on top of all layers—even when the containing layer is not visible.<span>  </span>If these elements are moved to the edge of the containing layer they will disappear completely or partially(as in the case of form elements).<span>  </span></font></font></font></p><p style="TEXT-ALIGN: justify"><b><span><font size="3"><font face="verdana,arial,helvetica,sans-serif" color="#000000">Examples of Layer Positions</font></font></span></b></p><pre><b><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif" color="#000000">Relative Positioning and Layers:</font></span></b></pre><p><font style="BACKGROUND-COLOR: #ffffff" color="#000000" size="3">Relatively positioned layers form part of the normal flow of the web page.  These are also known as Inflow layers.  These layers occupy space in the document flow and share line space with other elements of the web page.   The left and top attributes or properties can be set to specify the offset of the layer’s top-left corner from the current position of the document. The &lt;ILAYER&gt;&lt;/ILAYER&gt; tag is used while specifying an inflow layer.</font></p><p><font face="times new roman,times,serif">&lt;ILAYER ID=layer2&gt;<br /> &lt;P&gt;Sample content for relatively positioned layer&lt;/P&gt;<br />&lt;/ILAYER&gt;<br />&lt;STYLE type=&quot;text/css&quot;&gt;<br />&lt;!--<br />#layer2 {position:relative; }<br />--&gt;<br />&lt;/STYLE&gt;</font></p><p><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif" color="#000000">In the following code relative position has been used to determine the positioning of layers:</font></span><br /><font style="BACKGROUND-COLOR: #ffffff" face="times new roman,times,serif" color="#000000" size="2">&lt;html&gt;<br />&lt;body&gt;</font></p><p><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif" color="#000000">Sample ON TOP:</font></span></p><p><font style="BACKGROUND-COLOR: #ffffff" face="times new roman,times,serif" color="#000000" size="2">&lt;div style=&quot;position:relative; font-size:50px; z-index:2;&quot;&gt;Sample&lt;/div&gt;</font></p><p><font style="BACKGROUND-COLOR: #ffffff" face="times new roman,times,serif" color="#000000" size="2">&lt;div style=&quot;position:relative; top:-50; left:5; color:red; font-size:80px; z-index:1&quot;&gt;Sampleagain&lt;/div&gt;<br />Sampleagain ON TOP:&lt;div style=&quot;position:relative; font-size:50px; z-index:3;&quot;&gt;Sample &lt;/div&gt;</font></p><p><font style="BACKGROUND-COLOR: #ffffff" face="times new roman,times,serif" color="#000000" size="2">&lt;div style=&quot;position:relative; top:-50; left:5; color:red; font-size:80px; z-index:4&quot;&gt;Sampleagain&lt;/div&gt;</font></p><p><font style="BACKGROUND-COLOR: #ffffff" face="times new roman,times,serif" color="#000000" size="2">&lt;/body&gt;</font></p><p><font face="times new roman,times,serif"><font size="2"><font style="BACKGROUND-COLOR: #ffffff" color="#000000">&lt;/html&gt;</font></font></font></p><p><font style="BACKGROUND-COLOR: #ffffff" face="verdana,arial,helvetica,sans-serif" color="#000000" size="3">The web page will look as under:</font><br /><img style="BORDER-RIGHT: 0px; PADDING-RIGHT: 5px; BORDER-TOP: 0px; PADDING-LEFT: 5px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height="229" src="http://absolutepositioning.com/uploads/image9.jpg.psd.jpg" width="305" /></p><p><font face="verdana,arial,helvetica,sans-serif"><b><font size="3"><font color="#000000">Absolute Positioning and Layers:</font></font></b><font size="3"><font color="#000000"> </font></font></font></p><p><span class="text"><font size="3"><font color="#000000"><font face="Times New Roman"><font face="verdana,arial,helvetica,sans-serif">Absolutely positioned layers can be defined with reference to its coordinates within its containing layer. The top, left corner of the layer can be set using the left and top attributes or properties. However, if these attributes are not set they will default to the top and left of the containing layer automatically.</font> </font></font></font></span></p><p><span class="text"><font size="3"><font color="#000000"><font face="Times New Roman"><font face="verdana,arial,helvetica,sans-serif">The absolutely positioned layer will not occupy space in the normal flow and will have no impact on the other elements on the page within the normal flow.<span>  </span>The other elements on the page too will not make space for the absolutely positioned element in the normal flow.</font> </font></font></font></span></p><p><span class="text"><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif" color="#000000">An absolutely positioned layer is created using the <span class="text"><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font face="times new roman,times,serif" size="2">&lt;LAYER&gt; &lt;/LAYER&gt;</font> </span></span></font></span></span><font size="3">tag. If the layer has been defined as a style the layer will have to be created as under:</font></p><p><br /><font face="times new roman,times,serif" size="2">&lt;LAYER ID=layer1 TOP=200 LEFT=260&gt;<br /> &lt;P&gt;Sample layer content&lt;/P&gt;<br />&lt;/LAYER&gt;<br />&lt;STYLE type=&quot;text/css&quot;&gt;<br />&lt;!--<br />#layer1 {position:absolute; top:200px; left:260px;}<br />--&gt;<br />&lt;/STYLE&gt;</font></p><p><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif" color="#000000">If the position is defined as Absolute in the example given for relative positioning, the web page will appear as under:</font></span></p><p><img style="BORDER-RIGHT: 0px; PADDING-RIGHT: 5px; BORDER-TOP: 0px; PADDING-LEFT: 5px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height="229" src="http://absolutepositioning.com/uploads/image10.jpg.psd.jpg" width="305" /></p><p><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="3">Note that the top layer has been defined using the z-index attribute in both instances cited above.<br /><span> </span><br />Layers can be positioned relatively absolute or absolutely relative. In other words the position of the layer can be calculated with reference to the upper left corner (the absolute) or from the position of the layer within which the layer has been placed(relative).</font><font size="3"><font color="#000000"> </font></font></font></p><p><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="3">Negative and positive values are acceptable while positioning layers. The positions can also be changed dynamically using JavaScript.<span>  </span>This opens up immense possibilities.<span>  </span>Whole games can be designed using layers with coordinates and positions defined. Or layers of pages can be created in a stack and clicking on a link can move the specified layer to the top. </font><b><font size="3"><font color="#000000"> </font></font></b></font></p><p><b><font size="3"><font face="verdana,arial,helvetica,sans-serif" color="#000000">Layer problems</font></font></b></p><p><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="3">The most irritating problem about absolutely positioned layers is overlapping text. The moment a user resizes his text, all the beautiful layering done by the web designer takes a toss!<span>  </span>The text begins to overlap. While Gecko browsers will allow the text to overflow, IE will expand the layers and overlap the borders of the layers too! The second layer will not move down to accommodate the first one as both are absolutely positioned and are not affected by the changes in the position of other elements!</font><font size="3"><font color="#000000"> </font></font></font></p><p><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="3">Another common problem with layers is that they will not stay put where the designer intended them to stay!<span>  </span>If the layer is designed to be 800 pixel wide and the user has a screen that is 1024 pixel wide the layer will appear to jump a little to the left. While the actual layer has not moved a single pixel, it appears to move because it is absolutely positioned!<span>  </span>In reality it is the table that has moved to the right to remain perfectly centered on the page. Since we do not have control over the user’s resolutions, it may be a good idea not to use absolute positioning? Maybe static positioning would server your ends better? Or maybe you could try setting margin and padding properties to resolve the issue? </font><font size="3"><font color="#000000"> </font></font></font></p><p><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="3">In a sense setting the Margin and padding would solve the problem.<span>  </span>Well ….Almost. The &lt;div&gt; containing the first layer will expand to accommodate the text if the font size is changed and the second layer will move to accommodate the changes in the first layer—rendering the layers correctly. The padding will take care of the space around the border and ensure that the text does not stick to the borders.<span>  </span>A wrapper &lt;div&gt; can be used to enable the text to retain its positions relative to each other and the wrapper can be centered while the text remains at a specified position from the left of the browser viewport.</font><font size="3"><font color="#000000"> </font></font></font></p><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3">Once all the above has been taken care of the designer will still have to deal with Browser bugs.<span>  </span>Width is part of the content area. Any margin and padding added is included in the width in the determination of the area occupied by the element.<span>  </span>Old Browsers do not recognize the box model which describes the width.<span>  </span>Internet Explorer will calculate the width property and subtract the padding and borders before rendering the page. Well, you can imagine what will happen to all the positioning you have done when IE renders the page! </font></p><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3">To accommodate this bug in IE it has been suggested that web designers should ensure that the browser renders the page in Standards mode rather than in the quirks mode by including a Doctype in the page.<span>  </span>The designer will also have to take care of the problems of IE 5x.<span>  </span>A number of CSS hacks exist that can filter styles. These can be used or you could use a specific type of code that is called conditional comment.<span>  </span>A code like the one under will be offered to IE 5x.</font></p><p>   <font face="times new roman,times,serif">&lt;!--[if IE 5]&gt;<br />   &lt;style type=&quot;text/css&quot;&gt;<br />   #smpl1, #smpl2{width: 200px;}<br />   &lt;/style&gt;<br />   &lt;![endif]--&gt;</font></p><p><br /><br /><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif" color="#000000">This code can be placed in <font face="times new roman,times,serif" size="2">&lt;head&gt; <span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif">of the document after other styles or link to an external style sheet.<span>  </span>While IE 5x will act on it, other Browsers will ignore it.</font> </span></font></font></span></p><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif" color="#000000"><font face="times new roman,times,serif" size="2"><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><pre><b><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif">Stacking layers</font></span></b></pre><p><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif">We briefly discussed z-index order and stacking of layers.<span>  </span>In this section we shall understand this concept better.</font></span></p><p><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif">CSS allows the designer position boxes on layers in addition to rendering the layers from 0 to whatever integer value he wishes to stack layers in the z-index property.<span>  </span>The position of the layer in the Z axis is based on this integer value and higher the value the closer to the top the layer would be positioned.</font> </span></span></p><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><p><font face="verdana,arial,helvetica,sans-serif">Default stacking rules</font></p><p><font face="verdana,arial,helvetica,sans-serif">Let us visualize a situation where no z index is assigned to a layer.<span>  </span>What would be the stacking order--Default? The default order of stacking takes into account the background and borders of the root element, the descendant blocks in the normal flow –in the order of appearance in HTML, the descendent order of elements—again in the order of appearance in HTML.<span>  </span></font></p><p><font face="verdana,arial,helvetica,sans-serif">How floating elements can be handled</font></p><p><font face="verdana,arial,helvetica,sans-serif">The stacking of floating blocks is handled differently.<span>  </span>They are placed between the non-positioned and the positioned boxes after taking into account the background and borders of the root element, the descendent blocks in the normal flow—in the order of their appearance in HTML, floating blocks and descendant positioned elements in the order of their appearance in HTML.<span>  </span></font></p><p><b><font face="verdana,arial,helvetica,sans-serif">Using z-index to change default stacking</font></b></p><p><font face="verdana,arial,helvetica,sans-serif">If a z-index is specified then the default stacking order is overridden and the specified stacking order takes effect.<span>  </span>The z-index defines the position of the element in the z-index or third dimension of the page. The integer value can be positive or negative.<span>  </span>The layer with the lowest index value will be the bottommost layer of the stack.<span>  </span>If there are several layers with the same z-index value they are placed on the same layer.</font></p><p><b><font face="verdana,arial,helvetica,sans-serif">The stacking context</font></b></p><p><font face="verdana,arial,helvetica,sans-serif">In certain circumstances child stacking contexts can be created.<span>  </span>For instance if a particular layer has a number of sub layers, the latter would be child layers for the said layer.<span>  </span>A stacking context will have to be created for the child layers that are to be stacked on the parent layer.<span>  </span></font></p><p><font face="verdana,arial,helvetica,sans-serif">If an element is placed within another element and is given an z index value other than auto, then it creates its own stacking context.<span>  </span>All child elements will then be stacked entirely within that context. The entire div and its contents are treated as single element in that layer.<span> </span></font></p><ul type="disc"><li><span><font face="verdana,arial,helvetica,sans-serif">Positioning and assigning a z-index value to an HTML element creates a stacking context. </font></span></li><li><span><font face="verdana,arial,helvetica,sans-serif">Stacking contexts can be contained in other stacking contexts, and together create a hierarchy of stacking contexts. </font></span></li><li><span><font face="verdana,arial,helvetica,sans-serif">Each stacking context is completely independent from its siblings: only descendant elements are considered when stacking is processed. </font></span></li><li><span><font face="verdana,arial,helvetica,sans-serif">Each stacking context is self-contained: after the element's contents are stacked, the whole element is considered in the stacking order of the parent stacking context. </font></span></li></ul><p><font face="verdana,arial,helvetica,sans-serif"><b>Examples of stacking</b><b><span> </span></b></font></p><p><span><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif">The code for the display of overlapping cells is given below for ease of understanding. Each </font><font face="times new roman,times,serif" size="2">&lt;div&gt; <span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif">is defined, its properties set and then a z-index order has been assigned.<span>  </span>Readers should try to reassign the z-index order or change the properties of the different divs to see the effect on the positioning of layers.</font></span></font></span></span></p><p><span><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font face="times new roman,times,serif" size="2"><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><img style="BORDER-RIGHT: 0px; PADDING-RIGHT: 5px; BORDER-TOP: 0px; PADDING-LEFT: 5px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height="229" src="http://absolutepositioning.com/uploads/image11.jpg.psd.jpg" width="305" /> </span></font></span></span></p><p> <font size="2">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br />&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;<br />  &quot;</font><a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><font size="2">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</font></a><font size="2">&quot;&gt;</font></p><p><font size="2">&lt;html xmlns=&quot;</font><a href="http://www.w3.org/1999/xhtml"><font size="2">http://www.w3.org/1999/xhtml</font></a><font size="2">&quot; xml:lang=&quot;en&quot;&gt;<br />  &lt;head&gt;</font></p><p><font size="2">    &lt;title&gt;Understanding Stacking order&lt;/title&gt;</font></p><p><font size="2">    &lt;style type=&quot;text/css&quot;&gt;      html {<br />        padding: 20px;<br />        font: 12px/20px Arial, sans-serif;<br />        }<br />//Defining the Divs and assigning properties such as opacity, z-index order etc.<br />      div {<br />        opacity: 0.7;<br />        position: relative;<br />        }<br />      h1 {<br />        font: inherit;<br />        font-weight: bold;<br />        }<br />      #div1, #div2 {<br />        border: 1px dashed #696;<br />        padding: 10px;<br />        background-color: #cfc;<br />        }<br />      #div1 {<br />        z-index: 5;<br />        margin-bottom: 190px;<br />        }<br />      #div2 {<br />        z-index: 2;<br />        }<br />      #div3 {<br />        z-index: 4;<br />        opacity: 1;<br />        position: absolute;<br />        top: 40px;<br />        left: 180px;<br />        width: 330px;<br />        border: 1px dashed #900;<br />        background-color: #fdd;<br />        padding: 40px 20px 20px;<br />        }<br />      #div4, #div5 {<br />        border: 1px dashed #996;<br />        background-color: #ffc;<br />        }<br />      #div4 {<br />        z-index: 6;<br />        margin-bottom: 15px;<br />        padding: 25px 10px 5px;<br />        }<br />      #div5 {<br />        z-index: 1;<br />        margin-top: 15px;<br />        padding: 5px 10px;<br />        }<br />      #div6 {<br />        z-index: 3;<br />        position: absolute;<br />        top: 20px;<br />        left: 180px;<br />        width: 150px;<br />        height: 125px;<br />        border: 1px dashed #009;<br />        padding-top: 125px;<br />        background-color: #ddf;<br />        text-align: center;<br />        }<br />    &lt;/style&gt;</font></p><p><font size="2">  &lt;/head&gt;<br />  &lt;body&gt;<br />//Positioning the Divs<br />    &lt;div id=&quot;div1&quot;&gt;<br />      &lt;h1&gt;Division Element #1&lt;/h1&gt;<br />      &lt;code&gt;position: relative;&lt;br/&gt;<br />      z-index: 5;&lt;/code&gt;<br />    &lt;/div&gt;</font></p><p><font size="2">    &lt;div id=&quot;div2&quot;&gt;<br />      &lt;h1&gt;Division Element #2&lt;/h1&gt;<br />      &lt;code&gt;position: relative;&lt;br/&gt;<br />      z-index: 2;&lt;/code&gt;<br />    &lt;/div&gt;</font></p><p><font size="2">    &lt;p&gt;&amp;nbsp;&lt;/p&gt;</font></p><p><font size="2">    &lt;div id=&quot;div3&quot; style=&quot;position: absolute; left: 416px; top: 28px; width: 536px; height: 516px&quot;&gt;</font></p><p><font size="2">      &lt;div id=&quot;div4&quot;&gt;<br />        &lt;h1&gt;Division Element #4&lt;/h1&gt;<br />        &lt;code&gt;position: relative;&lt;br/&gt;<br />        z-index: 6;&lt;/code&gt;<br />      &lt;/div&gt;</font></p><p><font size="2">      &lt;h1&gt;Division Element #3&lt;/h1&gt;<br />      &lt;code&gt;position: absolute;&lt;br/&gt;<br />      z-index: 4;&lt;/code&gt;</font></p><p><font size="2">      &lt;div id=&quot;div5&quot;&gt;<br />        &lt;h1&gt;Division Element #5&lt;/h1&gt;<br />        &lt;code&gt;position: relative;&lt;br/&gt;<br />        z-index: 1;&lt;/code&gt;<br />      &lt;/div&gt;<br />   <br />      &lt;div id=&quot;div6&quot; style=&quot;position: absolute; left: 387px; top: 59px&quot;&gt;<br />        &lt;h1&gt;&lt;font size=&quot;4&quot;&gt;Division Element #6&lt;/font&gt;&lt;/h1&gt;<br />        &lt;code&gt;position: absolute;&lt;br/&gt;<br />        z-index: 3;&lt;/code&gt;<br />      &lt;/div&gt;</font></p><p><font size="2">    &lt;/div&gt;</font></p><p><font size="2">  &lt;/body&gt;<br />&lt;/html&gt;</font></p></span></span></span></font></font></span><font style="BACKGROUND-COLOR: #ffffff" face="Times New Roman" color="#000000" size="2"><p><br /><font face="verdana,arial,helvetica,sans-serif" size="3"><strong>Converting Layers to Tables.</strong></font></p><p><font face="verdana,arial,helvetica,sans-serif" size="3">Layers or tables? –this is a question that most designers ask themselves when they sit down to design their websites.  If the target audience is still hanging on to the ancient browsers—the answer is simple—it has to be tables.  However, if they have moved on to newer browsers—well, you could use layers.  There is yet a third possibility.  You could write codes for identifying browsers types and create a design that will convert your layers into tables and vice versa depending on the version of the browser!</font></p><p><font face="verdana,arial,helvetica,sans-serif" size="3">Software like Dreamweaver and Front page make the creation of layers or tables a breeze.  The WYSIWYG editors help you move your layers and columns around without touching the code.  In fact, a large number of designers subscribe to the view that it is easy to create layers and then convert them into tables.</font></p><p><font face="verdana,arial,helvetica,sans-serif" size="3">When layers are converted into a table, every layer is assigned a specific cell. Additional cells required to preserve the space between the layers are also created.  Software that converts layers into tables also provides for aligning the layers edges if they are positioned within the specified number of pixels.  This ensures that the resulting table will have less number of empty rows and columns. </font></p><p><font face="verdana,arial,helvetica,sans-serif" size="3">Often the last row of the table is filled with transparent GIFs to ensure that the table is displayed uniformly in all browsers. This type of table can be edited by dragging the columns.  The Center option can be used to center the table on the page.</font></p><p><font face="verdana,arial,helvetica,sans-serif" size="3">The process of converting tables to layers is the reverse.  Every cell in the table becomes a layer and additional empty cells used for maintaining the space between cells become space between the layers and so on.</font></p></font> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://absolutepositioning.com/archives/12-Using-Layout-Managers.html" rel="alternate" title="Using Layout Managers" />
        <author>
            <name>Steve Monas</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-01-06T07:14:55Z</published>
        <updated>2007-01-10T06:49:59Z</updated>
        <wfw:comment>http://absolutepositioning.com/wfwcomment.php?cid=12</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://absolutepositioning.com/rss.php?version=atom1.0&amp;type=comments&amp;cid=12</wfw:commentRss>
    
            <category scheme="http://absolutepositioning.com/categories/20-Chap-11" label="Chap 11" term="Chap 11" />
    
        <id>http://absolutepositioning.com/archives/12-guid.html</id>
        <title type="html">Using Layout Managers</title>
        <content type="xhtml" xml:base="http://absolutepositioning.com/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p style="TEXT-ALIGN: justify"><b><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="5">Using Layout Managers</font></b></p><br /><p style="TEXT-ALIGN: justify"><b><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">The Concept</font></b></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Layout managers were created to simplify interface design and free the designer from the drudgery of calculating the coordinates for each element on the page and worrying about properties, attributes and display problems relating to any specific elements.<span>  </span>While the concept is laudable and helpful, it was not the ultimate panacea for the web designer’s problems.<span>  </span>While it was possible to use different layout managers for different containers on a page and these layout managers gave sizes and positions to the components in the window and are helpful for windows whose size changed or were displayed on multiple operating systems, they did not provide the ultimate sought after solution. Complex layouts with nested containers, invisible components all come packaged with their own peculiar problems and layout managers can be as frustrating to the designer as manual arrangement of elements on a web page!</font></p><br /><p style="TEXT-ALIGN: justify"><font size="3"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif"><font size="2">A basic requirement of web design is portability. Standard UI design techniques do not guarantee portability.<span>  </span>What looks beautiful on the design platform may be distorted beyond recognition in other platforms.</font><span>  </span></font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">The first portable layout managers were designed in Java with a guarantee of being deployable on multiple platforms.<span>   </span>These layout managers specified rules and constraints for the layout of the user interface.<span>  </span>The advantages of these layout managers were that they correctly positioned components that were independent of fonts, screen resolutions and platform differences.<span>  </span>They provided intelligent component placement for containers when they are dynamically resized. They also provided for ease of translation to make allowances for increase in the length of the string on translation.</font></p><br /><p align="justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">The Java UI container comes inbuilt with a special object called the layout manager.<span>  </span>This component controls the components in the container.<span>  </span>It automatically arranges the components in accordance with the rules, properties, constraints specified by the layout manager.<span>  </span>The preferredSize, minimumSize, maximumSize, alignmentX and alignmentY and the size of the container are specified.<span>  </span>The user can accept the default layout manager or override the settings and specify a custom layout manager. </font></p><br /><p align="justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">All layout managers use absolute positioning.<span>  </span>Therefore, components do not adjust automatically when parent containers are resized.<span>  </span>The properties of different layout containers are as under:</font></p><br /><p align="justify"><font size="3"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif"><font size="2">BorderLayout has a hgap(horizontal gap) and vgap(vertical gap) to determine the distances between the components. Each component has a constraint value with possible values like North, south, east, west and center.</font><span>  </span></font></font></font></p><br /><p align="justify"><font size="3"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif"><font size="2">FlowLayout and GridLayout properties can be used to align components with reference to the vertical and horizontal gaps.<span>  </span>GridLayout also has the option of specifying the number of rows and columns.</font><span>  </span></font></font></font></p><br /><p align="justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">GridBagLayout has no properties.<span>  </span>However, it has GridBagLayoutConstraints object associated with it which has properties of height and width of the component linked to it.<span>  </span>It also has information about where the component in anchored in its cell, how the component fills up the cell, or how much padding surrounds the component inside its cell.</font></p><br /><p align="justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Java uses different types of information to determine the position and size of components placed in the container.</font></p><br /><p style="TEXT-ALIGN: justify" align="justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3"><font size="2">Layout managers in C# were different from the Java layout managers.<span>  </span>While Java relegated layout managers to Graphical User Interfaces, in C# anything that implements Ilayoutable interface can be laid out.<span>  </span>Moreover, since the layoutable objects are abstract concepts, distinct areas of the parent component can be laid out.<span>  </span>This gives a lot of power to the web designer.</font> </font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Layout managers in Visual Studio 2003 are analogous to the layout managers of Java in that it implements Flow layout and Grid Layout.<span>  </span>ASP.NET 2.0 introduced Master pages as a layout concept.<span>  </span>Master pages implement standard visual and functional capabilities throughout the web based application and work in conjunction with content pages.<span>  </span>Content will be populated into the placeholders for content provided in the master pages.<span>  </span>Personalization features, takes the concept a little further by allowing users to select and populate their pages with components.</font></p><br /><p style="TEXT-ALIGN: justify"><b><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Layout Examples</font></b></p><br /><p style="TEXT-ALIGN: justify"><b><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">TLB pages</font></b></p><br /><p style="TEXT-ALIGN: justify" align="justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">TLB stands for Translation look-aside buffer.<span>  </span>This is a table in the processor’s memory and contains information about the recently created pages in the memory.<span>  </span>The program’s virtual memory is cross-referenced with the corresponding absolute address in the physical memory.<span>  </span>This enables faster computing.<span>  </span>The TLB contains about 64-256 entries. The number of entries in the TLB is multiplied by the page size defined in the TLB reach.<span>  </span>This is critical to the performance of the application and the performance begins to degrade once the TLB reaches the critical point.</font></p><br /><p style="TEXT-ALIGN: justify" align="justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">During the recent years the TLB is failing to keep pace with the increasingly large working sets of applications.<span>  </span>Modern processor cache is getting large and few microprocessors have a TLB reach larger than the secondary cache for conventional page sizes.<span>  </span>TLB misses become more common while accessing data from the cache and this increases the latency to memory. </font></p><br /><p style="TEXT-ALIGN: justify" align="justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3"><font size="2">Efforts are being made to increase the TLB using the memory controller TLB.<span>  </span>This will let the designer aggressively create super pages from non-contiguous, unaligned regions of the physical memory.<span>  </span>Shadow pages are supported by the MTLB and this greatly empowers the Operating System’s ability to swap shadow-backed super pages more efficiently.</font> </font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2"><strong>Header and Footer Pages</strong></font></p><br /><p style="TEXT-ALIGN: justify"><font size="3"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif"><font size="2">Sites that are several pages long would like to introduce a header and footer that will look identical on all pages. This header or footer should be capable of being changed when the designer wants to change the look and feel of the site.<span>  </span>Header and footer pages are generally HTML pages that are part of the “includes” in PHP or master files in ASP.NET. Look at the following file created in PHP.</font><span>  </span></font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font size="3"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif" size="2"><span>&lt;html&gt;<br />&lt;head&gt;<br />&lt;title&gt;Welcome to this sample site!&lt;/title&gt;<br />&lt;style type=&quot;text/css&quot;&gt;<br />a {<br />// lots of styles<br />}<br />&lt;/style&gt;<br />&lt;/head&gt;<br />&lt;body background color=&quot;black&quot;&gt;<br />&lt;img src=&quot;header.png&quot; /&gt;<br />&lt;div style=&quot;postion: absolute; mycontent&quot;&gt;&lt;b&gt;Sidebar!&lt;/b&gt;<br />- Navigate<br />- Navigate<br />&lt;/div&gt;<br />&lt;div&gt;Content!!!!! mycontent&lt;/div&gt;<br />&lt;/body&gt;<br />&lt;/html&gt;</span></font></font></font></p><font face="verdana,arial,helvetica,sans-serif"><span><br /><p style="TEXT-ALIGN: justify"><font color="#000000" size="2">All pages associated with this header file will have to have the extension .php and then the header and footer files will have to be created.<span>  </span>Enter all the details from the Layout that you want reflected in every page and name the file header.inc.<span>  </span>The header file will appear as under:</font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">&lt;html&gt;<br />&lt;head&gt;<br />&lt;title&gt;Welcome to my sample site!&lt;/title&gt;<br />&lt;style type=&quot;text/css&quot;&gt;<br />a {<br />// lots of styles<br />}<br />&lt;/style&gt;<br />&lt;/head&gt;<br />&lt;body background color=&quot;black&quot;&gt;<br />&lt;img src=&quot;header.png&quot; /&gt;<br />&lt;div style=&quot;postion: absolute; mycontent&quot;&gt;&lt;b&gt;Sidebar!&lt;/b&gt;<br />- Navigate<br />- Navigate<br />&lt;/div&gt;<br />&lt;div&gt;</font></p><Br /><p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Note that the code is truncated before the content starts.<span>  </span>The Footer.inc file will reflect the footer layout as under:</font></span></p><br /><p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">&lt;/div&gt;<br />&lt;/body&gt;<br />&lt;/html&gt;</font></span></p><br /><p align="justify" /><p><font size="2"><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font color="#000000"><font face="verdana,arial,helvetica,sans-serif" size="2">Both the header.inc and the footer.inc files will have to be uploaded to the same folder as the pages in the website.<span>  </span>Layout coding should not be part of any of the files in your folder, else your header and footer files will be overridden.<span>  </span>At the head of every file enter the following code:</font> </font></span></font></p><br /><p>&lt;?php include(&quot;header.inc&quot;); ?&gt;</p><br /><p><font color="#000000" size="2">Below the content, the following code will have to be added.</font></p><p></p><p><span style="FONT-SIZE: 12pt; FONT-FAMILY: "><font color="#000000" size="2">&lt;?php include(&quot;footer.inc&quot;); ?&gt;</font></span></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="3"><font size="2">The include files can be named with any extension so long as the correct extension is specified in the include code.</font> </font><font size="3"><font color="#000000"> </font></font></font></p><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="3"><font size="2">In Java too, the include files can specify the header and footer files to be included as in PHP.</font> </font><font size="3"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify" align="justify"><font face="Times New Roman" color="#000000" size="3"><font face="verdana,arial,helvetica,sans-serif" size="2">The classic ASP can include any type of script files as include files for headers and footers. The extension ASP or INC or HTM can be specified. The development of User controls offered greater flexibility, reliability and speed.<span>  </span>Header user controls can be created by renaming the HTML file into head.ascx. The header must be registered and then called as under:</font> </font></p><br /><p><font size="2">&lt;%@ Page Language=&quot;VB&quot; runat=&quot;server&quot; %&gt;<br />&lt;%@ Register TagPrefix=&quot;UserControl&quot; TagName=&quot;Header&quot; Src=&quot;/usercontrols/head.ascx&quot; %&gt;<br />&lt;html&gt;<br />&lt;head&gt;<br /> &lt;title&gt;samplesite –Create smart headers and footers using ASP.NET User Controls&lt;/title&gt;<br />&lt;/head&gt;</font></p><p><font size="2">&lt;body&gt;<br /> &lt;UserControl:Header runat=&quot;server&quot; /&gt;<br /> ...<br />&lt;/body&gt;<br />&lt;/html&gt;</font></p><br /><p align="justify"><font style="BACKGROUND-COLOR: #ffffff" face="verdana,arial,helvetica,sans-serif" size="2">ASP.NET 2.0 Master pages are used for creating consistent and maintainable interfaces and derives from the UserControl class. The PreInit event of the master page is called before the PreInit event of the content page is called and the content page fills into the content placeholder on the master page and becomes a child of the master page before it is displayed. </font></p><br /><p align="justify"><font style="BACKGROUND-COLOR: #ffffff" face="verdana,arial,helvetica,sans-serif" size="2">In absolute positioning layout of components the footer pages will have to take into consideration the length of the longest column, while the header will have to take into consideration the start of the columns..</font></p><br /><p align="justify"><font style="BACKGROUND-COLOR: #ffffff" face="verdana,arial,helvetica,sans-serif"><font size="2"><strong>Floating Window Pages</strong><br /><br />Floating windows can be used when visual overlapping is considered advantageous and provides some depth to the application.  A floating window floats in front of other windows because the z-index order placement is relative to that of the other windows.  Floating windows are supported in Windows, Mac Os and Linux.</font></font></p><br /><p style="TEXT-ALIGN: justify" align="justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3"><font size="2">Floating windows help the designer divide the web page into rectangles that can be formatted independently of each other. They could be like DHTML layers—they can be hidden, shown or animated on top of the page.<span>  </span>They can contain other HTML elements, such as text or image and another floating box if required.<span>  </span>However, some web browsers do have problems with the floating windows, which have embedded floating boxes as the child-floating box inherits the CSS from the parent-floating box.</font> </font></p><br /><p style="TEXT-ALIGN: justify" align="justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3"><font size="2">A large number of designers are tending to move towards use of floating layers instead of popup windows.<span>  </span>These are just HTML elements such as divs styled to sit on top of the rest of the page. This window usually has a close button on the top right corner for ease of dismissal.</font> </font></p><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">The important facts about floating windows are that popup blockers cannot block them.<span>  </span>It forces the audience to look at the window—at least to figure out how it can be dismissed. If a link on the page is clicked the floating window will disappear with the rest of the page.<span>  </span>Often JavaScript is used to close them but not for displaying them.<span>  </span>They behave like normal windows on all computers.<span>  </span>They cannot be minimized or resized.<span>  </span>It is also not possible to switch back and forth between a floating window and the main page.</font></p><br /><p style="TEXT-ALIGN: justify" align="justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Absolutely positioned floating windows have been used for creating attractive and “never scroll out of view” menus.</font></p><br /><h4 style="MARGIN: auto 0in; TEXT-ALIGN: justify"><span style="FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Stretchable pages</font></span></h4><br /><p style="MARGIN: auto 0in; TEXT-ALIGN: justify"><span style="FONT-WEIGHT: normal; FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif" color="#000000"><font size="2">Web pages that stretch to fit into any window is the latest craze in web design.<span>  </span>If the page does not stretch a lot of white space around it looks pretty bad.<span>  </span>A simple solution is to center the design, but the white space remains a fact.<span>  </span>Relative sizing using percentage values on tables does not allow for any arbitrary screen size.<span>  </span>So stretching the pages to fit the window without distorting the elements composing it is a task that tests the ingenuity of the web designer.</font> </font></span></p><br /><p style="MARGIN: auto 0in; TEXT-ALIGN: justify" align="justify"><span style="FONT-WEIGHT: normal; FONT-FAMILY: "><font color="#000000"><font face="verdana,arial,helvetica,sans-serif">However, stretchable pages have some disadvantages. Stretching limits the page design and can cause readability problems. They should be used with caution and that too only with pages that have a great deal of content such as portal pages or company home pages.<span>  </span></font></font></span></p><br /><p style="MARGIN: auto 0in; TEXT-ALIGN: justify"><span style="FONT-WEIGHT: normal; FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif" color="#000000"><font size="2">Stretchable pages must flexibly expand horizontally.<span>  </span>This will be possible if solid color backgrounds are used or patterns that do not distort on stretching are used</font>. </font></span></p><br /><p style="MARGIN: auto 0in; TEXT-ALIGN: justify"><span style="FONT-WEIGHT: normal; FONT-FAMILY: "><font color="#000000"><font face="verdana,arial,helvetica,sans-serif"><font size="2">Text is usually laid out in columns and more the columns the greater the ease of reading. However, if there are too few columns on a page, the text may stretch beyond a reasonable limit.<span>  </span>Multiple column pages are easier to stretch for this reason.</font><span>  </span></font></font></span></p><br /><p style="MARGIN: auto 0in; TEXT-ALIGN: justify"><span style="FONT-WEIGHT: normal; FONT-FAMILY: "><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">What has absolute positioning got to do with all the facts stated above?<span>  </span>Absolute Positioning enables the designer design without layout managers! If the layout manager is set to null, the controls can be manually positioned using absolute positioning. However, it is not very comfortable to manually set the elements in their respective positions when the whole can be done with ease using a layout manager!<span>  </span>Moreover, all components will get locked in place and will not adjust to the position and size if the window is resized. It is possible to take care of this issue also, but would require a lot of programming effort from your side.</font></span></p></span></font> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://absolutepositioning.com/archives/10-Concept-of-Templates.html" rel="alternate" title="Concept of Templates" />
        <author>
            <name>Steve Monas</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-01-06T06:50:42Z</published>
        <updated>2007-01-09T09:42:31Z</updated>
        <wfw:comment>http://absolutepositioning.com/wfwcomment.php?cid=10</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://absolutepositioning.com/rss.php?version=atom1.0&amp;type=comments&amp;cid=10</wfw:commentRss>
    
            <category scheme="http://absolutepositioning.com/categories/18-Chap-09" label="Chap 09" term="Chap 09" />
    
        <id>http://absolutepositioning.com/archives/10-guid.html</id>
        <title type="html">Concept of Templates</title>
        <content type="xhtml" xml:base="http://absolutepositioning.com/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p style="TEXT-ALIGN: justify" align="center"><b><span style="FONT-SIZE: 18pt"><font face="verdana,arial,helvetica,sans-serif" color="#000000">Concept of Templates </font></span></b></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3"><font size="2">Much of the tasks in web page design are repetitive. The need to maintain a consistent look and feel throughout the site, the familiarity of users to the positioning of buttons and navigational elements and so on, makes it inevitable that some of the aspects of the design are repeated again and again.<span>  </span>This results in a lot of time being expended on doing the same tasks over and over again.<span>  </span>A template separates form from content and helps web designers layout elements on a generic page that can be called to provide the consistent look and feel of the website. Today, template designs provide a way of enforcing layouts, defining sets of privileges, style and content for multiple pages.<span>  </span>The template can be divided into regions and tabs and styles can be applied to specific regions and items such as portlets can be added.</font> </font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">At the other end of the spectrum, the user too, benefits from templating.<span>  </span>The web designer now has the option to define themes or skins for web pages which can be accessed by users who wish to give a special feel to his page while retaining the underlying template that defines the look and feel of the website. These themes and skins are nothing but elements of a web page that have been pre-positioned for immediacy of deployment.<span>  </span>With ASP.NET 2.0 the web designer can provide a repository of components to the web user for dragging and dropping into the web page.<span>  </span>The end user has the freedom to position the elements on the web page!</font></p><Br /><p style="TEXT-ALIGN: justify"><b><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Evolution of the Concept of Templates</font></b></p><br /><p style="TEXT-ALIGN: justify"><span><font size="3"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif"><font size="2">The web designer needs to feel that he is in control of the way in which his web page displays the elements he has so carefully positioned. The end user wants to feel that he should have the ability to personalize the page to suit his tastes.<span>  </span>There is a constant conflict of interest and the concept of templates has evolved from this fundamental need of both the designer and the user.</font><span>  </span></font></font></font></span></p><br /><p style="TEXT-ALIGN: justify"><span><font size="3"><font face="verdana,arial,helvetica,sans-serif" color="#000000"><font size="2">Paper templates for entering structured information have always been around. The first web pages were designed as if were extensions of the paper format.<span>  </span>Task based forms on the Internet, even today; share many of the features of the paper format.<span>  </span>The word document is a template of the paper and Microsoft Word provides a large number of templates for jobs such as letter writing or resume writing. It enables users keep structure and content independent from each other and makes designer experimentation with templates wholly possible.</font> </font></font></span></p><br /><p style="TEXT-ALIGN: justify"><span><font size="3"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif"><font size="2">The initial web pages were static pages and the initial efforts were directed towards experimenting with variations of the static page.</font><span>  </span></font></font></font></span></p><Br /><p style="TEXT-ALIGN: justify"><span><font size="3"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif"><font size="2">The Cascading Style Sheets were the first efforts to distinguish between form and content.<span>  </span>The possibility of creating “Styles” to which web content could be linked suggested undreamed of possibilities.<span>  </span>A number of designers began to experiment with form.<span>  </span>In fact it became such an obsession that flashy, buttons, colors and designs began to dominate the web.<span>  </span>Form seemed to take precedence over content and communication. The moderate members of the profession vociferously expressed their discomfort with the state of things and a balance has gradually been achieved.</font><span>  </span></font></font></font></span></p><br /><p style="TEXT-ALIGN: justify"><span><font size="3"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif"><font size="2">Server side coding for templates emerged in the 1990’s.<span>  </span>The Common Gateway Interface was first typically used in Unix Web servers for AWK report generator or M4 templates.<span>  </span>The Server side ‘include’ helped in defining a more direct way of creating server side scripts on web servers.<span>   </span>Web portals, then, catalyzed the whole and web designers began to experiment with “template languages” and talk about the need for a “template standard language”.</font><span>  </span></font></font></font></span></p><br /><p style="TEXT-ALIGN: justify"><span><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">A template system now consists of a template engine that processes web templates and content information to produce web documents.<span>  </span>The template engine can also be used as part of a preprocessor, filter or template processor.<span>  </span>Programming languages such as PERL, Ruby, C or Java all support template processing natively or using add-on libraries and modules.<span>   </span>Java Server pages, Active Server pages, PHP are template engines in their own right. XSLT and Xquery designed by W3C have emerged with promises of future convergence of template languages!</font></span></p><br /><p style="TEXT-ALIGN: justify"><font size="3"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif"><span><font size="2">Templates can be simple “substitute templates” or masks where place variables are substituted with the web designer’s content or can be complex templates using XSLT schemas.<span>   </span>Masks or substitute templates are the first server side includes that created uniform headers and footers on the web page. Complex templates provide for standardized layouts using a single base layout over which other layouts are superimposed.</font></span> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font size="3"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif"><font size="2">A template can be defined as a piece of code that uses preset variables to expose data on a web page. The template can be further categorized into data templates and theme templates. Data templates are base templates on which theme templates are superimposed to give a customized look and feel to the web page.</font><span><font size="2"> </font>  </span></font></font></font></p><br /><p style="TEXT-ALIGN: justify"><b><span style="FONT-SIZE: 16pt"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Templating?</font></span></b></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3"><font size="2">A template is a kind of wire frame for the web page. The elements that must appear in every page on the website can be laid out in the frame to form a basic layout for the whole. The “All page template” is a general layout background for the website with a fixed header and footer with an “all content” variable.<span>  </span>The block template is a segment or component region of the page with a specified layout block.<span>  </span>The menu block that usually appears on the left hand side column of the page is an example of a template layout box in a dynamic web site.</font> </font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Strongly template oriented websites have databases that receive only pure content while the form is determined by the template and are not impacted by the content that is displayed on the page.<span>  </span>Weakly template oriented websites allow the template design to be affected by the content and the template rules are changed every time the content changes.<span>  </span>While the former can make for rigidity of design the latter can make for non standardized web pages.<span>  </span>Providing for themes and skins probably emerged from a desire to mitigate the rigidity of strongly oriented web templates and to overcome the weakness of the weakly oriented ones.</font></p><Br /><p style="TEXT-ALIGN: justify"><font size="3"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif"><font size="2">The template file is a single file that may reference other resources for logical dependencies or layout dependencies.<span>  </span>The file is formatted with specific markup and reflects the template system strategies of the website. It uses scripts to provide instructions to the template engine and can be an embedded template language or an event driven template language. Embedded template language embeds the template script into a host language(old processor languages), while in an event driven template language (such as XSLT and filter languages) the template script treats each block as a separate event definition.</font><span>  </span></font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font size="3"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif"><font size="2">A template language formalizes the variables, blocks, substitution rules or logic in a web template and the standards that can be fixed into engine dependent or independent contexts in accordance with the type of language selected.</font><span>  </span></font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Simple substitution templates have only syntax rules and no logic and iteration. Iteration templates are similar to simple substitution templates but have inbuilt iterations that can repeat a substitution in the scope of a single block or several blocks.<span>  </span>Programmable templates call functions that execute and impact the state or value of other variables. Complex templates have unrestricted logic and specify sequential algorithms and permit parameterization.</font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3"><font size="2">Templates also fit in with the concept of object oriented programming. It encapsulates the concept and functionality so that it can be modified minimally without impacting the other parts of the application.</font> </font></p><Br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3"><font size="2">If there are a large number of templates in a web site, template management demands the use of the Layout manager.<span>  </span>The layout manager enables the management of layout in addition to the management of content in a web site.<span>  </span>We shall be dealing with layout managers in greater detail in a later chapter.<span>  </span>So we shall not say much more than this here.</font> </font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3"><font size="2">This chapter however, would be incomplete if we do not mention personalization, even though the details would be beyond the scope of this book..<span>  </span>Personalization of a site is the process of creating templates that filter and target the information displayed on the web site on the basis of the user’s identity and predefined needs.<span>  </span>The pages are tailored to the user needs and are a common form of enhancing customer service or e-commerce sales and marketing.<span>  </span>Personalization software includes software like Broadvision, ResponseLogic and Autonomy. ASP.Net personalization features take the whole technology one notch higher by allowing the user customized even the components that will be placed on the web page. <span> </span>It introduces an generic storage system object called “profile’ which makes it easy to track and apply user preferences on web pages.</font> </font></p><Br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3"><font size="2">Web design is maturing.<span>  </span>It is becoming modular, object oriented and more scientific.<span>  </span>It is concerned about usability issues and is focusing on creating websites that are user friendly and cross browser compatible.<span>  </span>Positioning elements on a template and then deploying them across the website is a challenge by itself.<span>  </span>Absolute positioning of elements in a template based web site is an absolute challenge.<span>  </span>We shall be exploring this in a later chapter.</font> </font></p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://absolutepositioning.com/archives/9-Pages,-Page-Sizes-and-Positioning-of-Elements.html" rel="alternate" title="Pages, Page Sizes and Positioning of Elements" />
        <author>
            <name>Steve Monas</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-01-06T06:47:35Z</published>
        <updated>2007-01-09T09:37:02Z</updated>
        <wfw:comment>http://absolutepositioning.com/wfwcomment.php?cid=9</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://absolutepositioning.com/rss.php?version=atom1.0&amp;type=comments&amp;cid=9</wfw:commentRss>
    
            <category scheme="http://absolutepositioning.com/categories/17-Chap-08" label="Chap 08" term="Chap 08" />
    
        <id>http://absolutepositioning.com/archives/9-guid.html</id>
        <title type="html">Pages, Page Sizes and Positioning of Elements</title>
        <content type="xhtml" xml:base="http://absolutepositioning.com/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p style="TEXT-ALIGN: justify" align="center"><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="5"><strong>Pages, Page Sizes and Positioning of Elements</strong></font></font></p><br /><p style="TEXT-ALIGN: justify" align="center"><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="2">Ultimately, what the user sees is a page.<span>  </span>The layout of the page will impact on how the user rates the website. Flashy buttons, animations that distract and positioning of key elements including content, will all make the difference between the success and the failure of the page. This chapter intends to introduce you to the broad concepts that govern page layouts and how it impacts the overall impression that the web page creates on the user.</font><font size="2"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font size="2"><font color="#000000"><b>Proximity of elements</b> is the distance between the locations of elements on the web page.<span>  </span>Proximity determines how elements relate to one another whether they are text, navigation or graphics.<span>  </span>Elements that are placed close together appear to have a stronger relationship than elements that are farther apart.</font></font><font color="#000000"><font size="3"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="2">Generally speaking, elements that are close together appear to have a stronger relationship than elements that farther apart.<span>  </span>For instance a caption for a picture must be placed directly below the picture and not a few inches below if it must establish a relationship.<span>  </span>A subtitle must be directly below the title if it must make sense.<span>  </span>A layout that positions elements in an unrelated manner is likely to be termed as weak.<span>  </span>Therefore, positioning of elements on the web page will impact of the page on the user.</font><font size="2"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font size="2"><font color="#000000"><font size="2"><b>Alignment</b>is one of the most critical principles of site layout that must be taken into consideration while designing the pages and positioning the elements of the page.<span>  </span>It not only disturbs the readability of the page, but can also detract from the appearance. On most pages the alignment is from left to right.<span>  </span>It provides a good starting point for the eye movement and the eye of the user is accustomed to this style unless he belongs to a culture that reads from right to left customarily.</font> </font></font><span><font color="#000000" size="3">            </font></span></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font size="2"><font color="#000000"><font size="2"><b>Repetition </b>is the art of saying the same thing over and over again without boring the reader with the intention of getting a point across. While web pages do not have to be the same across pages, users welcome repetition of some of the elements with slight variations for consistency.<span>  </span>. For instance, placement of the logo on the upper left corner, the menu bar at the top of the page and so on adds to the look and feel of the site and provides a strong sense of familiarity to the user.</font><span>  </span></font></font><font size="2"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font size="2"><font color="#000000"><font size="2"><b>Contrast </b>is used to make things stand out significantly.<span>  </span>For instance the white of text against a dark background or the use of dark colored text on a white background.<span>  </span>It makes reading easy and helps highlight it.<span>  </span>Contrast can also be used to attract the attention of the user to a particular object on the page—such as a freebie or a competition announcement by making the text larger than the surrounding text or printing it in a significant color or positioning it in the middle of the page.</font><span>  </span><span>        </span></font></font><font size="3"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font color="#000000"><font size="2"><b>Navigation</b> is another element that is carefully positioned on pages to hold the attention of the reader. It is a very important element on the page as it helps the reader get around the site with ease.<span>  </span>Research has revealed that positioning of navigation elements is one of the main reasons that determine how long a visitor stays on the site.</font></font><font size="2"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font size="2"><font color="#000000"><font size="2">A number of navigation styles have consequently developed. The most common one is to position the navigation buttons at the top of the page so that they are visible to the user as soon as he enters the site.<span>   </span>Sometimes Navigation is provided for on the left of the page and sometimes on the right.<span>  </span>A few sites prefer to have the navigation buttons at the bottom of the page.<span>  </span>Some place it horizontally and some vertically.<span>  </span>The type of site and the style of the site will determine the kind of navigation style that is used.</font><span>  </span></font></font><font size="3"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="2"><font size="2">While top and left navigations are common and familiar to users, bottom navigation is advantageous when the pages are long and the user has to scroll through the page back to the top if the navigation is placed at the top. Sometimes the navigation links are duplicated at the top and the bottom of the page for ease of operation.</font> </font><font size="2"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font size="2"><font color="#000000"><b>Text</b> is the primary means of communication on a web page and hence has to be positioned in a central place on the page.<span>  </span>Text is also displayed on different browsers in different ways because it relies on fonts installed on the user’s computer.<span>  </span>So positioning of text and use of fonts that display well across browsers becomes an important aspect of page layouts. Almost all PC users have Arial and Times New Roman installed and Macintosh users have Helvetica and Times New Roman.<span>  </span>So it would be safe to stick to these fonts while positioning text on the page.</font></font><font color="#000000"><font size="3"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="2">It must also be remembered that users read as a group of words. The size of the text then becomes the key element that determines how easy or difficult the text is to read.<span>  </span>Large text is difficult to read if they have to read two words at a time and small text is difficult to read if groups of words are too closely packed. Consequently, it may be advisable to define the font size so that browser settings do not override the text and distort the page.</font><font size="2"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="3"><font size="2">High contrast between the text and background also makes the text easier to read.<span>  </span>Red and blue texts create perception problems and should be avoided.</font> </font><span><font color="#000000" size="3">            </font></span></font></p><br /><p><font face="verdana,arial,helvetica,sans-serif"><font size="3"><font color="#000000"><font size="2"><b>Page Size and Layout</b> is extremely important factors in positioning of elements on a web page.<span>  </span>This is one of the biggest challenges faced by web designers.<span>  </span><b>Variability of screen sizes</b> is incumbent upon the settings adopted by the user.<span>  </span>Most computer monitors are set for 800 X 600 pixels.<span>  </span>However, some monitors go in for lower or higher pixel settings.<span>  </span>This can play havoc with the page and the positioning of elements on the page. Therefore, the web designer must create a web page that caters to all the different monitor settings and yet display well!</font> </font></font><font size="3"><font color="#000000"> </font></font></font></p><br /><p><font face="verdana,arial,helvetica,sans-serif"><font size="3"><font color="#000000"><font size="2">As pointed out earlier, knowing your audience is crucial to the kind of web page you design and how you place your elements on the page.<span>  </span>If the audience is using older computers, then the screen resolution should be set for 640 pixel wide screen.<span>  </span>If the audience is fairly tech savvy, you are likely to have an audience who has the screen set to 800 pixels and if you have a specialty audience then they are likely to be using an extremely wide monitor of 1024 pixels.</font><span>  </span></font></font><font size="3"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="2">However, if your audience is extremely varied, then it would be best to design your screen for 640 pixels, center the page and allow the browser to display your web page smaller than the screen width.<span>  </span>In this way you will not be sacrificing the positioning of elements at the altar of the screen width. However, there will a lot of “dead space” around the page, which cannot be used by the designer.</font><font size="3"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font size="3"><font color="#000000"><font size="2"><b>Tables</b> have been around for a long time as a method of laying out the pages.<span>  </span>These are used to control the width of material presented on the web page.<span>  </span>The table width is specified as a percent or pixels. Percent will cause the table size to change depending on what the viewer’s screen width is.<span>  </span>The display is fairly uniform across browsers and screen sizes.<span>  </span>It follows that the screen will be narrow in one monitor and wide in another if pixels are used to define the tables.</font> </font></font><font size="3"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font color="#000000"><font size="2"><b>Use of frames</b> in more elaborate websites throws up its own problems of positioning elements. It is also a moot point that a number of browsers do not support frames.<span>  </span>Frames work by splitting up the browser window into two or three regions and displaying a separate page in each region.<span>  </span>The problem of page layout is commensurate with the number of pages and frames on the screen at any given point of time.<span>  </span>Each is an independent page and the positioning of elements in one page has nothing to do with the positioning of elements in another frame.<span>  </span>One method of getting around the problem of frames and yet taking advantage of its capabilities is the use of a single large frame on a web page.<span>  </span>It helps control with precision the placement of images and other items on the page.<span>  </span>While a large number of browsers don’t support frames, they are more widely supported than layers or stylesheets and they open up the site to a wider potential audience. By adding the &lt;NOFRAMES&gt; tag and simply making a few minor adjustments to the framed area alone, anyone would have access to the information without having to build different versions of the same site.</font></font><font size="3"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="2">The concepts of frames has been taken a little further by the use of <b>iframes </b>which was popularized by Microsoft Internet Explorer 3.0 and is now supported by Netscape 6 and opera 5.<span>  </span>An iframe is an inline frame that is not bound to the side of the browser window. It floats free and can sit anywhere in the window.<span>  </span>It goes where it wants to go and displays whatever it needs to display. It obviously gives the web designer some undreamed of advantages.</font><font color="#000000"><font size="2"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="2"><font size="2">The next kind of page layout that is often used is the <b>Style based layout</b>. All style information is stored in a separate style sheet and &lt;div&gt; tags are used to place elements in right positions. By itself, the &lt;div&gt; tag is inert.<span>  </span>It becomes active when it is combined with a style sheet rule.<span>  </span>Most of these sheets use CSS positioning techniques to place their elements on the page—especially relative positioning.<span>  </span>However, special effects can be obtained by using Floating boxes or Absolute Positioning techniques.</font> </font><font size="3"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font color="#000000"><font size="2"><b>Layering</b> is another method that is used during page layout to place elements on the page so that users have easy access to them.<span>  </span>This type of layout is done sometimes deliberately to create dramatic effects.<span>  </span>When overlapping layers are used the designer must inform the browser how the element goes into the z-index and which elements are high on the z index and which are lower.</font></font><font size="2"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font size="2"><font color="#000000"><font face="Times New Roman"><font face="verdana,arial,helvetica,sans-serif" size="2">Well we have briefly explored the elements of the page, the size of the page the layout of the page and positioning of elements, generally, in the context.<span>  </span>The chapters preceding this one and including this one was intended to be introductory.<span>  </span>The idea was to ensure that you had all the concepts in place and that you truly appreciate the problems of the web designer who sets out to design his web page. Well we shall now begin drilling into each of the concepts in the context of absolute positioning of elements in the later chapters of this book.</font><span>  </span></font></font></font><span><font face="Times New Roman" color="#000000" size="3">          </font></span></p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://absolutepositioning.com/archives/8-Site-Organization-and-Element-Positioning.html" rel="alternate" title="Site Organization and Element Positioning" />
        <author>
            <name>Steve Monas</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-01-06T06:29:25Z</published>
        <updated>2007-01-09T09:36:21Z</updated>
        <wfw:comment>http://absolutepositioning.com/wfwcomment.php?cid=8</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://absolutepositioning.com/rss.php?version=atom1.0&amp;type=comments&amp;cid=8</wfw:commentRss>
    
            <category scheme="http://absolutepositioning.com/categories/16-Chap-07" label="Chap 07" term="Chap 07" />
    
        <id>http://absolutepositioning.com/archives/8-guid.html</id>
        <title type="html">Site Organization and Element Positioning</title>
        <content type="xhtml" xml:base="http://absolutepositioning.com/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <font face="verdana,arial,helvetica,sans-serif" color="#000000" size="5"><strong>Site Organization and Element Positioning</strong></strong /></font></span /><span style="FONT-FAMILY: "><font size="2"><font color="#000000"><font face="Times New Roman"> </font></font></font></span><br /><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><span style="FONT-FAMILY: "><font size="2"><font color="#000000">The user visiting a web site wants to find something.<span>  </span>You as the designer must make it easy for him to do so.<span>  </span>If the user leaves the site without finding the element he is looking for, you as a designer have failed to deliver.<span>  </span>The positioning of the navigation elements and other elements on the site directs the user to the element he wants to find. A number of site organization models have been developed to assist web designers create usable and navigable web sites. In this chapter we shall briefly look at some of the organization models that are in use today.</font></font></span><span style="FONT-FAMILY: "><font size="2"><font color="#000000"> </font></font></span></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><span><font size="2"><font color="#000000">Logical site organization models.</font></font><font size="2"><font color="#000000"> </font></font></span></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><span style="FONT-FAMILY: "><font size="2"><font color="#000000">An efficient ordering of information is what users are looking for.<span>  </span>Real content should be tucked away only a few clicks below the surface.<span>   </span>The information can be simply placed in a sequence or in hierarchies.<span>  </span>Web like organizational structures have several advantages, but tend to develop into dense links that explore information nuggets fully from multiple dimensions.<span>  </span></font></font></span><span style="FONT-FAMILY: "><font size="2"><font color="#000000"> </font></font></span></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><span style="FONT-FAMILY: "><font size="2"><font color="#000000">Site diagrams are used to evolve the site and act as the core-planning document that is referenced every time a change is proposed.<span>  </span>Positioning of the different elements on the web pages and the location, accessibility of the pages is defined in this document.</font></font></span><span style="FONT-FAMILY: "><font size="2"><font color="#000000"> </font></font></span></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><span style="FONT-FAMILY: "><font size="2"><font color="#000000">Clear, consistent icons, graphic identity schemes and graphics or text based overview and summary screens can give the user a bird’s eye view of what he is looking for. Users should not be confronted with complexity.<span>  </span>Interface metaphors should not be obscure or culturally insensitive. It is of paramount importance that users should always be able to return to the home page.<span>  </span>This is usually taken care of by providing users with a button bar at the top or bottom of every page.</font></font></span><span style="FONT-FAMILY: "><font size="2"><font color="#000000"> </font></font></span></font></p><br /><p style="TEXT-ALIGN: justify"><span style="FONT-FAMILY: "><font size="2"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif">Site organizations are generally Linear, Hierarchical or Circular.<span>   </span>The type of navigation used defines the site organization that has been used. Linear layouts direct the user from page to page one after another.<span>  </span>This type of design is best suited for web sites that require the user to perform a task linearly such as registering for a seminar. Hierarchical layouts are used when information has to be presented hierarchically.<span>  </span>The user is provided with multiple paths for reaching the target page. Circular layouts are most suited for large sites where volumes of information are stored. Circular sites are designed with entry pages that allow users reach any page from anywhere.<span>  </span></font></font></font></span></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><span style="FONT-FAMILY: "><font size="2"><font color="#000000">Every web site begins with an home page. It is the logical entry point of the web site. In hierarchical site organizations the home page is the apex from which all other pages flow. The top of the home page is the point that attracts the eye of the user when he arrives at the home page. So any element positioned at this point attracts the attention immediately.<span>  </span>If the site aims at efficient navigation, this space should be dense with links.<span>  </span>Menu home pages are the most common type of home pages.<span>  </span>These pages are dominated by text or graphic links.<span>  </span>News oriented home pages put live/hot news on the home page with links to details in other pages. Path based home pages are known for sheer breadth and depth of site content.<span>  </span>This type of home page helps split audience into interest groups and to offer them user specific information.<span>  </span></font></font></span><span style="FONT-FAMILY: "><font size="3"><font color="#000000"> </font></font></span></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><span style="FONT-FAMILY: "><font size="2"><font color="#000000">Splash screens are controversial entry points.<span>  </span>This type of entry point to the web site is more attractive in an entertainment site rather than in an information site.</font></font></span><span style="FONT-FAMILY: "><font size="2"><font color="#000000"> </font></font></span></font></p><br /><p style="TEXT-ALIGN: justify"><span style="FONT-FAMILY: "><font size="2"><font face="verdana,arial,helvetica,sans-serif" color="#000000"><strong>Tabled?</strong></font></font></span></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><span style="FONT-FAMILY: "><font size="2"><font color="#000000">Tables are one of the primary tools that are used by web designers to gain control over elements of a web page. They also offer visually interesting organization of text and graphics.<span>  </span>They help the designer designate specific parts or columns and rows for menus, navigation bars or for framing images or content.<span>   </span>However, browser support of tables is still a matter of concern and many designers resort to table-less layouts for browser compatibility and uniformity of display across all browsers. </font></font></span><span style="FONT-FAMILY: "><font size="2"><font color="#000000"> </font></font></span></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><span style="FONT-FAMILY: "><font size="2"><font color="#000000">Text tables require the use of preformatted fonts for better display.<span>  </span>The use of &lt;pre&gt; gives the designer control over column alignment as the tag ensures that the same amount of space is used for every character, irrespective of the width of the font.<span>  </span>Several text-based browsers can only display text tables. </font></font></span><span style="FONT-FAMILY: "><font size="2"><font color="#000000"> </font></font></span></font></p><br /><p style="TEXT-ALIGN: justify"><span style="FONT-FAMILY: "><font size="2"><font face="verdana,arial,helvetica,sans-serif" color="#000000">Special tags are used to create graphical tables.<span>  </span>Borders, colors, shading, backgrounds, frames, spacing and padding are some of the attributes that are pressed into the service of the web designer. The table attributes of height, width, alignment, row and column spanning are taken advantage of.<span>  </span>Nested tables are a common feature.<span>  </span>However, tabled layouts can pose complex design problems that designers must familiarize themselves with before launching into tabled web designs.</font></font></span></p><br /><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Visual formatting of tables is specified as a rectangular grid of intersecting rows and columns organized into groups.<span>  </span>The borders defined around them may indicate Row and column groups. Data may be aligned horizontally or vertically within a cell or in all cells of a row column group. Positioning of cells as float or absolutely, may cause the cells to cease to be part of the table.<span>  </span>We shall deal with this in greater detail in a later chapter.</font></p><br /><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">The optimal layout for tables is not defined in CSS.<span>  </span>However, the constraints that designers must appreciate while laying out the table are specified and the algorithm may be customized to the needs of the designers, except in the instance where “fixed layout algorithm” has been selected.</font></p><br /><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">The advantage of using tables is that they are flexible.<span>  </span>They can spread out to cover the whole page or they can be forced to occupy specified regions of the page.<span>  </span>The disadvantage of using tables is that they create bloated volumes of code, increase the size of the file, impact the loading speed of the page on to the browser, are labor intensive, and mixes presentational data with content.</font></p><br /><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Table-less layouts in CSS are achieved using Structural markup language.<span>  </span>This just requires a different kind of thinking hat. We have to cease thinking about the format of the page and start thinking about the structure of the content and information. Content is released from the table cells and wrapped into &lt;div&gt; tags.<span>  </span>The div elements or id or class describes their content and function rather than their appearance. The advantage is that meaning can be conveyed to the user even if he cannot see the web page!</font></p><br /><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">One of the simplest methods of creating a column-like layout, using CSS, is defining percentage-based positions for elements.<span>  </span>Other relative units of measurement can also be used unlike in tables. For instance the em attribute enables the calculation of the size of the element will be determined by the calculation of the size of the text in the element.</font></p><br /><p><font size="2"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif">The limited support to tables in IE 5, Netscape 6 and Mozilla, the need for a different method of laying out the pages is welcome.<span>  </span>Float and clear properties can be used to make texts flow around images.<span>  </span>Objects can be positioned with reference to the bottom right or z index can be used to layer objects.<span>  </span></font></font></font></p><br /><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">While tables provide a relatively useful framework for emulating the printed page, they are not very useful in providing tools for designing new ways of presenting information.<span>  </span>CSS positioning is more dynamic and provides more scope for innovation.</font></p><br /><p><font size="2"><font face="verdana,arial,helvetica,sans-serif" color="#000000"><strong>Framed?</strong></font></font></b /></p><br /><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Web designers use frames when they wish to display multiple HTML documents on a single page at once.<span>  </span>The implementation of frames was introduced by Netscape Navigator 2.0 and was not backward compatible and is not supported by a large number of browsers.<span>  </span>Web designers who use frames have to double their labor by designing web pages that use frames and ones that do not use frames to cater to end users viewing the page through different types of browsers!</font></p><br /><p><font size="2"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif">The first task is to set up the frameset document. This document differs from the normal HTML 3.2 document in that it does not have a BODY element. The frameset determines the number of rows and columns and their respective heights and widths.<span>  </span>Nested framesets are also factored into the page when the frameset is set up.<span>  </span></font></font></font></p><br /><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Rows and columns are defined, by first describing the outermost set of rows and columns and then replacing the FRAME element in the row or column, to get the nested innermost FRAMESET element.</font></p><br /><p><font size="2"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif">Frames have several drawbacks.<span>  </span>The image load is never off in Netscape Navigator. Combination of frames cannot be book marked and there are no URLs associated with framesets. Frames break up the integrity of the page and distract the attention of the user.<span>  </span>Navigation does not work with frames.<span>  </span>The unit of navigation is distinct from the unit of view.<span>  </span></font></font></font></p><br /><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Frames also present a number of implementation problems to the web designer.<span>  </span>Users with browsers that do not support frames (they are a significant percentage) will not be able to view the pages in the way it is to be viewed. The BACK button does not work with framed sites.<span>  </span>Additionally framed sites present a number of print problems.<span>  </span>Search engines too have troubles with frames, as frames are not navigation units in their index. </font></p><br /><p><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Nevertheless frames are still popular design mode with many web designers who wish to implement specific features in their site.<span>  </span>The use of frames, while vehemently opposed, had its own set of loyal followers.<span>  </span>The future of this feature of web design will depend on the skill of the frame advocates in proving the usability of the technique.</font></p><br /><p><font size="2"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif">We shall look at frames from the perspective of positioning elements on framed pages a little later in this book.<span>  </span></font></font></font></p><h1 /> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://absolutepositioning.com/archives/7-Positioning-of-Elements-and-Audience.html" rel="alternate" title="Positioning of Elements and Audience" />
        <author>
            <name>Steve Monas</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-01-06T03:00:51Z</published>
        <updated>2007-01-09T08:52:38Z</updated>
        <wfw:comment>http://absolutepositioning.com/wfwcomment.php?cid=7</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://absolutepositioning.com/rss.php?version=atom1.0&amp;type=comments&amp;cid=7</wfw:commentRss>
    
            <category scheme="http://absolutepositioning.com/categories/15-Chap-06" label="Chap 06" term="Chap 06" />
    
        <id>http://absolutepositioning.com/archives/7-guid.html</id>
        <title type="html">Positioning of Elements and Audience</title>
        <content type="xhtml" xml:base="http://absolutepositioning.com/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p style="TEXT-ALIGN: left" align="left"><font face="verdana,arial,helvetica,sans-serif"><strong><font color="#000000" size="5">Positioning of Elements and Audience</font></strong><br /><font size="3"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><b><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">The Customer is the King!</font></b></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="3"><font size="2">Information alone is not the primary goal of website users.<span>  </span>They enter the website with the curiosity of a child entering a new room.<span>  </span>They expect the different items to be placed exactly where it should be and expect it to be in the shape that they are accustomed to.<span>  </span>Anything that does not conform to the norm is probed or discarded as unfamiliar territory depending on the kind of user he or she is. A web designer setting out to design a website that is experimental may be in for a shock.<span>  </span>The audience may not appreciate his efforts for the simple reason that the shapes, colors and dimensions of the web page are not relatable to anything that they have experienced! &quot;Human needs should be the guide for our technologies.&quot; —Ben Shneiderman</font> </font><font size="3"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font size="3"><font color="#000000"><font size="2">Therefore, a detailed understanding of the audience needs in creation and positioning of elements is an effective metric of good web design.<span>  </span>So if you know who your target audience is you can design for them meaningfully and efficiently.<span>  </span>Positioning of elements in your website is all about organizing your content into logical, user oriented sections and prioritizing content in order of importance to your target audience. A point to be considered in this context is that elements placed below the fold (point at which the user has to start scrolling), will receive less importance than the elements at the top of the page.</font><span>  </span></font></font><font size="3"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="2">Positioning of elements is all about being conscious of the culture of communication in the region and sensitively arranging the elements in accordance with the expectations.<span>  </span>For instance, most cultures read a document from left to right, but some cultures read it from right to left and expect the elements to be placed accordingly!</font><font size="3"><font color="#000000"> </font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif"><font color="#000000" size="3"><font size="2">Demographics will help you distinguish your audience on the basis of gender, income level, age, religion, geographic location and so on.<span>  </span>A study of the environment in which the section of audience lives will also help you determine what they will find appropriate. <span> </span>If you look a little deeper you will perhaps explore their motivations and intentions and arrive at other expectations that are not immediately visible.<span>  </span>Finally, while studying your audience you need to factor in issues of hardware and software limitations and technology awareness levels.<span>  </span>It is also necessary to address browser issues that can distort the best-designed websites.</font> </font><b><font size="3"><font color="#000000"> </font></font></b></font></p><br /><h1><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Type of Websites</font></h1><h1><span style="FONT-WEIGHT: normal"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Each medium of communication has its won unique constraints and this can impact the principles and elements of the design.<span>   </span>The constraints may be based on a variety of factors which may include the customer expectations, the purpose of the web site, the technology used, the processes and standards of the industry and so on. The environment creates a unique set of constraints in the placement and positioning of elements in a web page.</font></span></h1><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Commercial websites are websites that sell products or services to its customers. A right combination of art, technology and communication skills are vital ingredients of a successful commercial website. The user should be able to understand at a glance what the website is selling and should be able to access the details with ease.<span>  </span>They should be able to select the product into the proverbial shopping cart, see their selections, confirm the selections and pay for them.<span>  </span>Shipping information, time that will be taken etc should be displayed prominently.<span>  </span>So the positioning of these elements on the website will be of primary importance.</font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="2">Personal websites are information sites normally accessed by a closed group of people or people with similar interests.<span>  </span>The type of information being provided and the type of audience who will access the information will determine type and positioning of elements.<span>  </span>The intent of the website should be clear when the user enters the site so that his expectations are correctly oriented.</font></p><br /><p style="TEXT-ALIGN: justify"><font size="3"><font color="#000000"><font face="verdana,arial,helvetica,sans-serif"><font size="2">Organizational websites are created to advocate and individual opinion or a group’s point of view within the organization. Message boards, chat forums and discussion groups are usually the pages that are frequently accessed by these groups.<span>  </span>The websites should be designed to instantly give the user access to all the above elements.</font><span>  </span></font></font></font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3"><font size="2">Educational websites are designed to provide information about educational institutions or to present study materials, tutorials and so on to the students. The user should be able to see the list of lessons and navigate to the required lesson with ease. He should be able to access, the applications, registration forms and other aspects of the website that are essential for him, with ease.</font> </font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3"><font size="2">Entertainment websites are created with an intention to provide users with a variety of entertainment avenues.</font> </font></p><br /><p style="TEXT-ALIGN: justify"><font face="verdana,arial,helvetica,sans-serif" color="#000000" size="3"><font size="2">Ne