<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by addo boakye on Medium]]></title>
        <description><![CDATA[Stories by addo boakye on Medium]]></description>
        <link>https://medium.com/@forison?source=rss-10d1da2ed973------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*LHSvw2-4334RmmhI.jpg</url>
            <title>Stories by addo boakye on Medium</title>
            <link>https://medium.com/@forison?source=rss-10d1da2ed973------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 03:52:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@forison/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Basic Positioning of Elements on A Web page ?]]></title>
            <link>https://medium.com/@forison/basic-positioning-of-elements-on-a-web-page-3d6be729a75a?source=rss-10d1da2ed973------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d6be729a75a</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[css-position]]></category>
            <category><![CDATA[html-css]]></category>
            <dc:creator><![CDATA[addo boakye]]></dc:creator>
            <pubDate>Wed, 19 Jun 2019 23:45:33 GMT</pubDate>
            <atom:updated>2019-06-28T18:45:13.731Z</atom:updated>
            <content:encoded><![CDATA[<h3>Positioning Elements on A Web Page PART 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*SsIa8XkmeVz7_oVfhwDiEQ.jpeg" /></figure><p>Web designs have become complex. Nowadays, it is not enough to have some content online. The organization and presentation of your content determine the number of time users spend on your website. The website today is characterized by complex presentation and animations</p><p>HTML and CSS enable developers to create attractive web pages. Understanding how to position various elements at different positions on a page by a beginner is very important. Understanding the <strong>position </strong>property would come in handy for anyone intending to start a career in web development. The purpose of this article is to delve into the <strong>position</strong> property and try to understand how it can be implemented.</p><p>Mastery over this concept prior to introduction to any framework can be helpful. Below is an image depicting a web page nicely designed with different elements at different positions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o21IDl3ftStiqgDkakXj1g.png" /></figure><h3><strong>Position property</strong> :</h3><p>The<strong> position</strong> property specifies the type of positioning method used for an element .<strong>position </strong>can accept five values these are :</p><ol><li><strong>Static</strong></li><li><strong>Relative</strong></li><li><strong>Fixed</strong></li><li><strong>Absolute</strong></li><li><strong>Sticky</strong></li></ol><p>When these values are assigned to the position properties it enables the developer to move the element in diverse ways, by either moving the element some distance from the left, right, top, bottom to a specified position.</p><h3><strong>position: static</strong>;</h3><p>Html elements by default have their position value set to <strong>static,</strong> hence it is not necessary for the developer to declare “<strong>position: static;” </strong>unless he/she wants to <strong>overwrite</strong> a position value.</p><p>An element with a position set to static behaves quite differently from other values. When an element has a position <strong>static</strong> we can move it around our web page by modifying its margins. Margin is also a property that accepts %, px, rem, etc… units of distance.</p><p>let us create a box on a web page with Html and CSS and move around on the web page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*bxPrvO4dWZXYXLmoE7aD3A.png" /><figcaption>index.html</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/1*AJ-EdWQ6uconT7-z4MzfBg.png" /><figcaption>style.css</figcaption></figure><p>this will output this on our web page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZEVZSFUYa8yjCobX33WPVA.png" /><figcaption>box on position before moving</figcaption></figure><p>now we can assign margin at the top, bottom, right, left in other to move our box to different places on the page.we do not need to restate <strong><em>position: static ;</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*MJGDg-wvICheUQzhHSTMYA.png" /></figure><p>this results in</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mjg_cDd9OurTytggb7ZQ0A.png" /></figure><p>you may set the <strong><em>margin:0 auto;</em></strong> to the center element</p><h3><strong>position: relative;</strong></h3><p>An element with position relative is positioned relative to its current position. This allows elements to be able to respond to the left, right, top and bottom properties.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hapWGXQmA_sIz9wYLlADOA.png" /><figcaption>index.html</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lPodb7tZ4zHBMZ6Rb65CTw.png" /><figcaption>style.css</figcaption></figure><p>this will output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9KqpNpSz2mWVvLrrq6CCHg.png" /><figcaption>relatively positioned element</figcaption></figure><h3><strong>position: absolute;</strong></h3><p>When the position of an element is set to <strong>absolute,</strong> the element is placed relative to the element closer to it or makes it relative to the body of the document. Absolute value takes the element out of the normal flow of the page and can enable you to position the element at any place you wish. It responds to <strong>left, right, bottom, top</strong> property and it also responds to the<strong> transform</strong> property</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3_x3i1VQ_YzY7OTASbvWzw.png" /><figcaption>index.html</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uMHI4dKnEtVXueumu2-D7Q.png" /><figcaption>style.css</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AV3VPHAnmAP0GIcwA2bpLw.png" /><figcaption>The Yellow Square is Position Absolute to the Red Square</figcaption></figure><h3><strong>position:fixed;</strong></h3><p>When an element is given a <strong>“position: fixed;”, </strong>it makes the element relative to the Viewport, consequently elements with the <strong>position</strong> value <strong>fixed</strong> do not move on scroll they remain fixed to the position specified through the <strong>left, right, top, bottom</strong> properties.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PORrgewuN8BDC3vibLpo4Q.png" /><figcaption>index,html</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2U69hSso5fObkgU4ca0_DA.png" /><figcaption>style.css</figcaption></figure><p>this will output, the blue circle will be fixed to its current position even if scrolled. Setting top to zero and left to zero will stick it to the top, this approach is usually used in navigation bar development</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mvZNB94pOaKaWmciqRwrpg.png" /></figure><h3><strong>position:static;</strong></h3><p>When an element is given a <strong>position</strong> value <strong>static, </strong>the element’s position becomes relative to the screen scroll.Use <strong>right,left,top,bottom </strong>to position element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*16pgqsYSdRVVKqo0C6fu3A.png" /><figcaption>index.html</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8DczOahZAStK2TJe3QaPSA.png" /><figcaption>style.css</figcaption></figure><p>this will output a sea blue square with a position value set to sticky. The sticky square will toggle between relative and fixed. When top hit zero it becomes fixed else it assumes a relative position.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*koePcFajYV8HAF6c6M7YKA.png" /></figure><p>positions are important in modern web site because they allow the developer to stick different boxes over each other. <strong>fixed </strong>and <strong>sticky </strong>are used widely in the navigation bar to stick it to the top.</p><p>let us use this knowledge to develop a layout with semantic HTML based on the concepts discussed above.</p><p><strong>index.html</strong></p><p>this file is going to house six elements that are going to position with CSS to give us a basic web page layout.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*L90WtAC0UtmaDhBsWWy5DQ.png" /><figcaption>index.html</figcaption></figure><p><strong>style.css</strong></p><p>Change the default position of the<strong> nav</strong> element from <strong>static </strong>to <strong>fixed</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_DOIDYqPeJSUA33d9YUixA.png" /></figure><p>Change the default position of the<strong> left_el</strong> element from <strong>static </strong>to <strong>absolute </strong>then, position element accordingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MHjHSGbypGeL3TUr_03RLw.png" /></figure><p>Change the default position of the<strong> right_el</strong> element from <strong>static </strong>to <strong>absolute then, </strong>position element accordingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VQRrLPQnXZlLQNC4FhvT0g.png" /></figure><p>Change the default position of the<strong> foot_row</strong> element from <strong>static </strong>to <strong>absolute </strong>then, position element accordingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xLh8xa4djG6oPZy6UwKxJQ.png" /></figure><p>this will lead to the creation of this layout</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O1e1L5cU1nyA3O4_-9Q0WA.png" /></figure><h3>Conclusion</h3><p>There are many ways to position elements on a web page. Read on display to further reinforce your mastery of positioning elements on a web page.</p><p>If you want to get more information on the topic, <a href="https://css-tricks.com/almanac/properties/p/position/">https://css-tricks.com/almanac/properties/p/position/</a></p><p>This article seeks to make positioning of element easy to beginners because it forms the basis of a good web page design</p><p>If you have a question, let me know. If you want to keep up with what I’m doing, follow me on <a href="https://www.linkedin.com/feed/">LinkedIn</a> or <a href="https://twitter.com/ADDOBOAKYE1">Twitter</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jdVm4DoIwK9DryXCIcyW6g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d6be729a75a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>