What is “position:absolute” in CSS ? To learn absolute positioning CSS property you must understand block level & inline elements, normal flow concept of CSS. You must know normal flow first, then learn absolute position concept.
Box model, Normal Flow > Absolute positioning
Absolute Positioning Explained
- An absolutely positioned element is removed from the normal flow. This positioning scheme applies to any element that has its position porperty absolute or fixed.
- This means you can put it anywhere, and it won’t affect or be affected by any other element in the flow.
- Normally absolutely positioned elements are positioned by the top and left property assigned to them.
- This top and left works with respect to the container block of this absolutely positioned element. This top and left are called offset positions.
- Absolute positioning always works w.r.t the container block of this absolutely positioned element.
- Absolute elements create a new coordinate system for child elements inside them.
- This is an exellent property of ABSOLUTE POSITIONING : Use all four offset properties (TOP, LEFT, BOTTOM, RIGHT), and you can stretch an element without defining any width or height—it’s bound only by its parent element or the document itself if there is no container.
Continue reading “Absolute Positioning in CSS – Learn CSS positioning”
Learn CSS box model first if you want to learn web designing, because all the HTML elements are either inline or block level elements. When we say a <p> tag (Paragraph element) or DIV tag (DIV element) or Hyperlink (anchor tag <a>), then we always refer to these HTML elements’ box model. Continue reading “Box model, inline & block elements & normal flow”
Inline & Block elements >> Centering HTML elements
In this article I have describe which HTML elements are inline elements and which are block level HTML5 elements. How to center inline elements inside a container DIV or block level elements.
Centering text & inline elements
IMG, STRONG, SPAN elements in a webpage are examples of inline elements. Alos I have used the term inline content, which means inline elements. Inline content includes such things as text, images, <strong> and <span> tags. Now we need to center inline content inside a block element (Normally Inline elements resides inside a BLOCK element like DIV, H1 etc)
Just use text-align property applied to the next higher level block level container with the content to be aligned inside. Continue reading “Centering text using CSS, Center inline & block DIV elements”
Here container DIV has two child DIVs. Container DIV is relatively positioned. After container DIV a footer DIV BOX exists which also relatively positioned. Inside container DIV there exists two column DIVs which are absolutely positioned. Left colummn is of 60% width of container and right column is of 30% width.
Continue reading “CSS Tutorial on Two column DIV layout problem where container DIV collapses”
This is a CSS tutorial to draw concentric circles using pure CSS. Here Web Developer Mr Choudhury shown with free source code examples, the easiest ways to draw CSS circles & concentric circles with the help of pure CSS. Here DIV represent each circle having border-radius:50%;.
About this tutorial & author : Also Mr. Choudhury shown the formula, and he described and explained here developed by the renowned CSS layout expert and css template designer for web page layouts.
Continue reading “CSS circles – draw concentric Circles using CSS3”
Vertically center a DIV inside a container DIV element. The container can be relatively positioned. The child DIV should be absolutely positioned and its top, right, bottom, and left offset properties specify the element’s position w.r.t the container block (what the element is positioned relative to) and this value should be 0. So now use these properties to vertically center a DIV inside a container DIV element. Continue reading “Vertical centering using CSS- when child DIV placed in a ‘container DIV of fixed height’”
Vertical Centering Problem found in IE9 when two DIV elements placed side by side. A tutorial by Bikram Choudhury, Web Design Tutor, Kolkata. Continue reading “Vertical Centering Problem found in IE9 for side by side two DIVs”
When container DIV collapses having multiple child DIV inside it. Here you will get a case study when container DIV has two child divs side by side they appears inside container DIV. Child DIVs are absolutely positioned inside a container DIV which is relatively positioned. Also know how to recover from the problem. Continue reading “When container DIV collapses having multiple child DIV inside it”
You will be able to create a top level horizontal navigation menu which may or may not have sub-menus. This type of menus sometimes called as NAV menu or suckerfish menu… when you will mouse over on them, then sub menu will be shown (if that menu item has sub level menu). Continue reading “Create horizontal navigation menu with drop down submenu CSS tutorial”