Archive

Posts Tagged ‘Fixed Position’

Fixed Method for Positioning Elements in CSS

October 19th, 2009 Captain 4 comments

This article is short but inculding very useful information. A few years ago, we web programmers are used to make these operations via javascript. However, this wasn’t good method because, computers were not powerful enough. Nowadays, computers are too powerfull and we don’t need to use javascript anymore! Just one thing is required for us: CSS(Cascading Style Sheet).

Look at the top-right of this page. Did you see it? Let’s see how it is done…
Structure 1.0:

1
2
3
4
5
6
7
8
9
10
< !doctype html>
<head>
<style type="text/css">
#[DIV_ID]{
position:fixed;
top:[margin-top];
right:[margin-right];
left:[margin-left];
bottom:[margin-bottom];
}</style></head><body><div id="[DIV_ID]"></div></body>

Example 1.0: Assume that we have a div named Click to Read Complete Article »

Bookmark and Share
eXTReMe Tracker