<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>SeoExploration &#187; exact position</title> <atom:link href="http://www.seoexploration.com/tag/exact-position/feed/" rel="self" type="application/rss+xml" /><link>http://www.seoexploration.com</link> <description>discovering new optimisation techniques</description> <lastBuildDate>Fri, 11 Nov 2011 14:37:05 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.2.1</generator> <item><title>How to Position Text and Images Exactly within a Web Page</title><link>http://www.seoexploration.com/2009/08/how-to-position-text-and-images-exactly-within-a-web-page/</link> <comments>http://www.seoexploration.com/2009/08/how-to-position-text-and-images-exactly-within-a-web-page/#comments</comments> <pubDate>Wed, 19 Aug 2009 16:36:42 +0000</pubDate> <dc:creator>anon</dc:creator> <category><![CDATA[HTML]]></category> <category><![CDATA[div style]]></category> <category><![CDATA[div tag]]></category> <category><![CDATA[exact position]]></category><guid
isPermaLink="false">http://www.seoexploration.com/2009/08/how-to-position-text-and-images-exactly-within-a-web-page/</guid> <description><![CDATA[By William Bontrager Although I&#8217;ve written several articles that included examples of positioning, such as &#8220;Instant Info&#8221; and the &#8220;No-Kill Pop Box&#8221; series, it occurred to me that I&#8217;ve never written an article about how to do the positioning itself. This is it. Basically, it&#8217;s three steps: 1. Create a DIV tag. 2. Put content [...]]]></description> <content:encoded><![CDATA[<h3><span
style="font-family: verdana,helvetica,arial; font-size: x-small;">By<span
style="color: #0000ff;"> <a
href="http://www.web-source.net/cgi-bin/web/jump.cgi?ID=762" target="blank">William Bontrager</a></span></span></h3><p>Although I&#8217;ve written several articles that included examples of positioning, such as &#8220;<a
href="http://willmaster.com/possibilities/archives/wmp20021224001.shtml" target="blank">Instant Info</a>&#8221; and the  &#8220;<a
href="http://willmaster.com/possibilities/archives/wmp20030617001.shtml" target="blank">No-Kill Pop Box</a>&#8221; series, it occurred to me that I&#8217;ve never written an article about how to do the positioning itself.</p><p>This is it.</p><p>Basically, it&#8217;s three steps:</p><p>1. Create a DIV tag.</p><p>2. Put content within the DIV.</p><p>3. Tell the browser where to put the DIV.</p><p>What you&#8217;re doing is making a layer. I&#8217;ll explain those three steps in a 		      moment.</p><p>Without the above, text and images can move, and probably will, depending 		      on which browser is displaying your page and the size preferences the user 		      has specified.</p><p>That&#8217;s not necessarily bad. But if you must have something in an exact position, 		      making a layer and positioning it is a way to do it.</p><p>You might want a photograph overlapping another. Or, you might want to place 		      some text so it overlaps an image. Or, perhaps, your logo must be in the 		      exact same place on every web page.</p><p>A demonstration page has been prepared consisting of four layers.</p><p>The first layer is a photograph of the Old Faithful geyser at Yellowstone 		      National Park. The other layers are layered over the first and are composed 		      of text, the word &#8220;Old,&#8221; the word &#8220;Faithful,&#8221; and a copyright line (this 		      latter being bordered).</p><p>The demonstration page is at<br
/> <a
href="http://willmaster.com/a/21t/pl.pl?art215" target="blank">http://willmaster.com/a/21t/pl.pl?art215</a></p><p>Here&#8217;s how to do it.</p><p>1. Create a DIV tag</p><p>Creating a DIV tag creates a layer.</p><p>The DIV tag contains a style attribute with positioning information. It might 		      also have border and size information, if appropriate.</p><p>Here is the basic DIV tag required for exact positioning:</p><pre>&lt;div
   style="
      top: 99;
      left: 99;
      position: absolute;
      z-index: 1;
      visibility: show;"&gt;
&lt;!-- content will go here --&gt;
&lt;/div&gt;</pre><p><span
style="font-family: Verdana,Helvetica; font-size: x-small;"> The above creates a layer.</span></p><p>You&#8217;ll notice that the style attribute has five different labels. They all 		      relate to positioning the layer and will be addresses in section 3, &#8220;Tell 		      the browser where to put the DIV,&#8221; below.</p><p>2. Put content within the DIV</p><p>Putting content between the &lt;div&#8230;&gt; and &lt;/div&gt; tags is providing 		      content for the layer.</p><p>The layer might contain an image tag, a word, paragraphs of text, or combination 		      text and images. The layer can contain anything web pages can contain, including 		      forms.</p><p>3. Tell the browser where to put the DIV</p><p>Telling the browser where to put the DIV tag is actually telling it where 		      to put the layer and its content.</p><p>The &#8220;top&#8221; and &#8220;left&#8221; labels &#8211;</p><p>The 2-dimension positioning is done with the &#8220;top&#8221; and &#8220;left&#8221; labels in the 		      style attribute. The number is in pixels. In the example DIV tag in section 		      1, &#8220;Create a DIV tag,&#8221; the layer is put 99 pixels from the top edge and 99 		      pixels from the left edge.</p><p>The &#8220;position&#8221; label &#8211;</p><p>The top edge of what? The left edge of what?</p><p>The &#8220;position&#8221; label gives the browser the answers to those questions.</p><p>If the position label&#8217;s value is &#8220;absolute,&#8221; then the number of pixels is 		      measured from the top of the browser window and from the left of the browser 		      window.</p><p>If the label&#8217;s value is &#8220;relative&#8221; however, the position is measured from 		      the position relative to the place in the HTML source code that you have 		      placed the DIV tag. If you&#8217;ve placed the DIV tag at the end of a paragraph, 		      the position will be calculated relative to the end of that paragraph. Using 		      the &#8220;relative&#8221; value does not position elements according to purpose of this 		      article, but it does have its uses in other situations.</p><p>The &#8220;z-index&#8221; label &#8211;</p><p>This label determines the third dimension of positioning when several layers 		      occupy the same pixel of the user&#8217;s screen. The value of the &#8220;z-index&#8221; label 		      determines which layer will be placed over the other. If two layers vie for 		      the same spot, one has a &#8220;z-index&#8221; value of &#8220;1&#8243; and the other a &#8220;z-index&#8221; 		      value of &#8220;2,&#8221; then the &#8220;2&#8243; value layer will be placed over the &#8220;1&#8243; value 		      layer.</p><p>The &#8220;z-index&#8221; label was used to place text over an image on the demonstration 		      page. The image was given a &#8220;z-layer&#8221; of 1 and the text a &#8220;z-layer&#8221; of &#8220;2.&#8221; 		      The demonstration page is at <a
href="http://willmaster.com/a/21t/pl.pl?art215" target="blank">http://willmaster.com/a/21t/pl.pl?art215</a></p><p>The &#8220;visibility&#8221; label &#8211;</p><p>Give the &#8220;visibility&#8221; label a value of &#8220;show&#8221; so it will be visible. For 		      other purposes, a layer might want to be hidden for a time, in which case 		      the value &#8220;hide&#8221; or &#8220;hidden&#8221; would be used.</p><p>Special Effects</p><p>Supposing the content of the layer is the word &#8220;hello,&#8221; the above would give 		      us a layer like this:</p><pre>&lt;div
   style="
      top: 99;
      left: 99;
      position: absolute;
      z-index: 1;
      visibility: show;"&gt;
hello
&lt;/div&gt;</pre><p><span
style="font-family: Verdana,Helvetica; font-size: x-small;"> If you want to give the layer a 		      background color or a border, you&#8217;ll also need to specify the size of the 		      layer. It&#8217;s done with these labels:</span></p><p>width: 266px;<br
/> height: 17px;</p><p>(The &#8220;px&#8221; represents pixels, although other units of measurements may be 		      specified.)</p><p>To give the layer a background color of yellow, use this label and value:</p><p>background: yellow;</p><p>To put a 1-pixel solid black border around the layer, specify these labels 		      and values:</p><p>border-color: #000000;<br
/> border-style: solid;<br
/> border-top-width: 1px;<br
/> border-bottom-width: 1px;<br
/> border-left-width: 1px;<br
/> border-right-width: 1px;</p><p>The &#8220;border-color&#8221; label can have a color name or hexadecimal color value.</p><p>The &#8220;border-style&#8221; label can have other values, such as &#8220;dotted&#8221; and &#8220;dashed,&#8221; 		      but some browsers print a solid line nevertheless.</p><p>The width of the border can be different for each side.</p><p>The copyright line layered over the image on the demonstration page is a 		      demonstration of giving a layer a border. The demonstration page is at <a
href="http://willmaster.com/a/21t/pl.pl?art215" target="blank">http://willmaster.com/a/21t/pl.pl?art215</a></p><p>Note: If you wish to apply other style elements within the layer, such as 		      font size or color, use a SPAN, P, or other tag instead of the DIV tag. A 		      DIV tag within a layer (somewhat like a DIV tag nested within a DIV tag) 		      can confuse some browsers.</p><p>When you need to position something on a web page exactly, so it stays in 		      that position regardless of what browser is used to view it, what the browser&#8217;s 		      preferences are, or the size of the browser window, you now know how to do 		      it.</p><p>The visitor&#8217;s browser must be able to render layers, of course, in order 		      to position your content. Most recent browser releases do.</p><p>Netscape 4.#, while it does render layers, doesn&#8217;t do a good job with more 		      than two layers over each other. If this is a high priority for you, you 		      might develop with Netscape 4.# and then verify your pages render correctly 		      in the later browsers.</p><p>Those browsers that don&#8217;t render layers will probably place the content in 		      the order it exists in your source code. That may be a consideration when 		      you decide where in the source code to put layer DIV tags.</p><p>Will Bontrager</p><p><strong>About the Author:</strong></p><p>Copyright 2003 Bontrager Connection, LLC<br
/> <a
href="http://www.web-source.net/cgi-bin/web/jump.cgi?ID=762" target="blank">William 		      Bontrager</a> Programmer/Publisher, &#8220;WillMaster Possibilities&#8221; <a
href="http://willmaster.com/possibilities/" target="blank">ezine</a> <a
href="mailto:possibilities@willmaster.com">mailto:possibilities@willmaster.com</a></p> ]]></content:encoded> <wfw:commentRss>http://www.seoexploration.com/2009/08/how-to-position-text-and-images-exactly-within-a-web-page/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Served from: www.seoexploration.com @ 2012-02-05 12:50:39 by W3 Total Cache -->
