Archives by Tag 'absolute positioning'

Introduction – Getting started

By Steve Monas - Last updated: Tuesday, June 15, 2010

Where do we start? Well, if we follow the advice of our wise old ancestors, we should “start at the beginning.” This book starts somewhere in the middle. The middle may be a good place to start if you know what went before and understand the direction you want to head. Because you picked up [...]

Absolute positioning

By Steve Monas - Last updated: Monday, June 14, 2010

Absolute positioning takes its position from the top-lefthand corner of the browser pane with the x and y coordinates at (0,0). This positioning gives the designer tremendous control over the elements so positioned. The code for an absolutely positioned element can be placed anywhere in the code and still the element will display at the [...]

Fixed positioning

By Steve Monas - Last updated: Monday, June 14, 2010

This type of positioning is similar to the absolute positioning attribute in that it is calculated with reference to its containing blocks, and it is pulled out of the normal flow. However, the reference is in the context of the browser viewport. The viewport is a fixed block that remains fixed; however, many of the [...]

Positioning considerations

By Steve Monas - Last updated: Monday, June 14, 2010

So, what are the things we should take into consideration when we decide to position the elements on our web page? The layout of the content and the purpose of the document are important. Do we want the content to use the default flow and reflow when resizing the window? If so, then we should [...]

Absolute positioning? Absolutely not!

By Steve Monas - Last updated: Monday, June 14, 2010

“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 quite a few disadvantages too. However, before we actually set out the long list of advantages and disadvantages, let us look [...]

Defining concepts

By Steve Monas - Last updated: Monday, June 14, 2010

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 somewhat like this: <style type= “text/css”> <!-– p {position: absolute; left 50pt; top: 30pt} –> </style> Note that [...]

Combining concepts

By Steve Monas - Last updated: Monday, June 14, 2010

Absolute positioning is relative! In reality, an absolutely positioned element is relative to its 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 [...]

z index property and positioning—absolute/relative

By Steve Monas - Last updated: Monday, June 14, 2010

CSS allows an overlay of elements to create a 3D effect. The elements can be absolutely positioned in such a way so that they are positioned in overlapping layers. A stacking occurs, and the z-index order value is used to position the layer in the stack and, consequently, the image or text. The code below [...]

Cascading style sheets (CSS)

By Steve Monas - Last updated: Monday, June 14, 2010

Style was separated from content with the advent of cascading style sheets. So, let us begin by understanding what CSS has to say about element positioning. We shall also look at a few examples of element positioning in CSS and compare them with the concept of absolute positioning.

Absolute positioning

By Steve Monas - Last updated: Monday, June 14, 2010

We will deal with absolute positioning very briefly here as we propose to devote a whole section to it a little later in this tutorial. Absolute positioning positions the element in a fixed point within its container. It cannot be moved from its position. The top and left declarations determine its position. The element then [...]