SlideShare a Scribd company logo
CSS Advanced – Session 4 Ramkumar Lakshminarayanan
Grouping Selectors In style sheets there are often elements with the same style. h1 { color:green; } h2 { color:green; } p { color:green; }
To minimize the code, you can group selectors. Separate each selector with a comma. In the example below we have grouped the selectors from the code above: Example Source Example h1,h2,p { color:green; }
Nesting Selectors It is possible to apply a style for a selector within a selector. In the example below, one style is specified for all p elements, one style is specified for all elements with class="marked", and a third style is specified only for p elements with class="marked":
Example Source Example p { color:blue; text-align:center; } .marked { background-color:red; } .marked p { color:white; }
CSS Dimension The CSS dimension properties allow you to control the height and width of an element.
All CSS Dimension Properties The number in the "CSS" column indicates in which CSS version the property is defined (CSS1 or CSS2). Example Property Description Values CSS Height Sets the height of an element auto length % inherit 1 max-height Sets the maximum height of an element none length % inherit 2 max-width Sets the maximum width of an element none length % inherit 2 min-height Sets the minimum height of an element length % inherit 2 min-width Sets the minimum width of an element length % inherit 2 width Sets the width of an element auto length % inherit 1
CSS Display and Visibility The display property specifies if/how an element is displayed, and the visibility property specifies if an element should be visible or hidden.
Hiding an Element - display:none or visibility:hidden Hiding an element can be done by setting the display property to "none" or the visibility property to "hidden". However, notice that these two methods produce different results: visibility:hidden hides an element, but it will still take up the same space as before. The element will be hidden, but still affect the layout. Example Source Example h1.hidden {visibility:hidden;}
display:none hides an element, and it will not take up any space. The element will be hidden, and the page will be displayed as the element is not there: Example Source Example h1.hidden {display:none;}
CSS Display - Block and Inline Elements A block element is an element that takes up the full width available, and has a line break before and after it. Examples of block elements: <h1> <p> <div> An inline element only takes up as much width as necessary, and does not force line breaks. Examples of inline elements: <span> <a>
Changing How an Element is Displayed Changing an inline element to a block element, or vice versa, can be useful for making the page look a specific way, and still follow web standards. The following example displays list items as inline elements: Example Source Example li {display:inline;}
The following example displays span elements as block elements: Note:  Changing the display type of an element changes only how the element is displayed, NOT what kind of element it is. For example: An inline element set to display:block is not allowed to have a block element nested inside of it. Example Source Example span {display:block;}
Positioning The CSS positioning properties allow you to position an element. It can also place an element behind another, and specify what should happen when an element's content is too big. Elements can be positioned using the top, bottom, left, and right properties. However, these properties will not work unless the position property is set first. They also work differently depending on the positioning method.
There are four different positioning methods. Static Positioning Fixed Positioning Relative Positioning Absolute Positioning
Static Positioning HTML elements are positioned static by default. A static positioned element is always positioned according to the normal flow of the page. Static positioned elements are not affected by the top, bottom, left, and right properties.
Fixed Positioning An element with fixed position is positioned relative to the browser window. It will not move even if the window is scrolled: Example Source Example p.pos_fixed { position:fixed; top:30px; right:5px; }
Note:  IE7 and IE8 support the fixed value only if a !DOCTYPE is specified. Fixed positioned elements are removed from the normal flow. The document and other elements behave like the fixed positioned element does not exist. Fixed positioned elements can overlap other elements.
Relative Positioning A relative positioned element is positioned relative to its normal position. Example Source Example h2.pos_left { position:relative; left:-20px; } h2.pos_right { position:relative; left:20px; }
The content of relatively positioned elements can be moved and overlap other elements, but the reserved space for the element is still preserved in the normal flow. Example Source Example h2.pos_top { position:relative; top:-50px; }
Absolute Positioning An absolute position element is positioned relative to the first parent element that has a position other than static. If no such element is found, the containing block is <html>: h2 { position:absolute; left:100px; top:150px; }
Absolutely positioned elements are removed from the normal flow. The document and other elements behave like the absolutely positioned element does not exist. Absolutely positioned elements can overlap other elements.
Overlapping Elements When elements are positioned outside the normal flow, they can overlap other elements. The z-index property specifies the stack order of an element (which element should be placed in front of, or behind, the others). An element can have a positive or negative stack order: Example Source Example img { position:absolute; left:0px; top:0px; z-index:-1 }
An element with greater stack order is always in front of an element with a lower stack order. Note:  If two positioned elements overlap, without a z-index specified, the element positioned last in the HTML code will be shown on top.
All CSS Positioning Properties The number in the &quot;CSS&quot; column indicates in which CSS version the property is defined (CSS1 or CSS2).
Property Description Values CSS bottom Sets the bottom margin edge for a positioned box auto length % inherit 2 Clip Clips an absolutely positioned element shape auto inherit 2 Cursor Specifies the type of cursor to be displayed url auto crosshair default pointer move e-resize ne-resize nw-resize n-resize se-resize sw-resize s-resize w-resize text wait help 2
Left Sets the left margin edge for a positioned box auto length % inherit 2 overflow Specifies what happens if content overflows an element's box auto hidden scroll visible inherit 2 Position Specifies the type of positioning for an element absolute fixed relative static inherit 2 Right Sets the right margin edge for a positioned box auto length % inherit 2 Top Sets the top margin edge for a positioned box auto length % inherit 2 z-index Sets the stack order of an element number auto inherit 2
What is CSS Float? With CSS float, an element can be pushed to the left or right, allowing other elements to wrap around it. Float is very often used for images, but it is also useful when working with layouts.
How Elements Float Elements are floated horizontally, this means that an element can only be floated left or right, not up or down. A floated element will move as far to the left or right as it can. Usually this means all the way to the left or right of the containing element. The elements after the floating element will flow around it. The elements before the floating element will not be affected.
If an image is floated to the right, a following text flows around it, to the left: Example Source Example img { float:right; }
Floating Elements Next to Each Other If you place several floating elements after each other, they will float next to each other if there is room. Here we have made an image gallery using the float property Example Source Example .thumbnail  { float:left; width:110px; height:90px; margin:5px; }
Turning off Float - Using Clear Elements after the floating element will flow around it. To avoid this, use the clear property. The clear property specifies which sides of an element other floating elements are not allowed. Add a text line into the image gallery, using the clear property: Example Source Example .text_line { clear:both; }
All CSS Float Properties The number in the &quot;CSS&quot; column indicates in which CSS version the property is defined (CSS1 or CSS2). Property Description Values CSS Clear Specifies which sides of an element where other floating elements are not allowed left right both none inherit 1 float Specifies whether or not a box should float left right none inherit 1

More Related Content

What's hot (20)

PDF
Introduction to CSS3
Seble Nigussie
 
PPT
cascading style sheet ppt
abhilashagupta
 
PDF
CSS Day: CSS Grid Layout
Rachel Andrew
 
PPT
CSS Basics
WordPress Memphis
 
PPTX
Beginners css tutorial for web designers
Singsys Pte Ltd
 
PPTX
Css Basics
Jay Patel
 
PPT
Box Model
Amit Kumar Singh
 
PPTX
Html form tag
shreyachougule
 
PPTX
html-css
Dhirendra Chauhan
 
PPTX
Css selectors
Parth Trivedi
 
PDF
Html / CSS Presentation
Shawn Calvert
 
PPTX
Introducing CSS Grid
Jason Yingling
 
PPTX
Css backgrounds
AbhishekMondal42
 
PPTX
html-table
Dhirendra Chauhan
 
PPTX
1 03 - CSS Introduction
apnwebdev
 
PPT
Html frames
Arslan Elahi
 
PPT
Web Development using HTML & CSS
Shashank Skills Academy
 
PPT
How Cascading Style Sheets (CSS) Works
Amit Tyagi
 
PPTX
Chapter 13: Colors and Backgrounds
Steve Guinan
 
Introduction to CSS3
Seble Nigussie
 
cascading style sheet ppt
abhilashagupta
 
CSS Day: CSS Grid Layout
Rachel Andrew
 
CSS Basics
WordPress Memphis
 
Beginners css tutorial for web designers
Singsys Pte Ltd
 
Css Basics
Jay Patel
 
Box Model
Amit Kumar Singh
 
Html form tag
shreyachougule
 
Css selectors
Parth Trivedi
 
Html / CSS Presentation
Shawn Calvert
 
Introducing CSS Grid
Jason Yingling
 
Css backgrounds
AbhishekMondal42
 
html-table
Dhirendra Chauhan
 
1 03 - CSS Introduction
apnwebdev
 
Html frames
Arslan Elahi
 
Web Development using HTML & CSS
Shashank Skills Academy
 
How Cascading Style Sheets (CSS) Works
Amit Tyagi
 
Chapter 13: Colors and Backgrounds
Steve Guinan
 

Viewers also liked (18)

PPTX
Cashcading stylesheets
reddivarihareesh
 
PPT
Cascading Style Sheets
Marc Steel
 
PPT
Cascading style sheets (css)
veasnarin
 
PPT
Cascading Style Sheets By Mukesh
Mukesh Kumar
 
ODP
An Introduction to Cascading Style Sheets (CSS3)
Ardee Aram
 
PPS
Cascading Style Sheets
Paul Dionysius
 
PDF
Html Css
pumas26
 
PPTX
Introduction to CSS
Shehzad Yaqoob
 
PPT
Introduction to Cascading Style Sheets
Tushar Joshi
 
PPTX
Cascading style sheets - CSS
iFour Institute - Sustainable Learning
 
PPT
Cascading Style Sheets(CSS)
Reshmi Rajan
 
PDF
CSS Selectors
Rachel Andrew
 
PPSX
CSS-Cascading Style Sheets - Introduction
Mukesh Tekwani
 
PPT
CSS, CSS Selectors, CSS Box Model
jamiecavanaugh
 
PPTX
Cascading Style Sheets - CSS
Sun Technlogies
 
PDF
LinkedIn SlideShare: Knowledge, Well-Presented
SlideShare
 
Cashcading stylesheets
reddivarihareesh
 
Cascading Style Sheets
Marc Steel
 
Cascading style sheets (css)
veasnarin
 
Cascading Style Sheets By Mukesh
Mukesh Kumar
 
An Introduction to Cascading Style Sheets (CSS3)
Ardee Aram
 
Cascading Style Sheets
Paul Dionysius
 
Html Css
pumas26
 
Introduction to CSS
Shehzad Yaqoob
 
Introduction to Cascading Style Sheets
Tushar Joshi
 
Cascading style sheets - CSS
iFour Institute - Sustainable Learning
 
Cascading Style Sheets(CSS)
Reshmi Rajan
 
CSS Selectors
Rachel Andrew
 
CSS-Cascading Style Sheets - Introduction
Mukesh Tekwani
 
CSS, CSS Selectors, CSS Box Model
jamiecavanaugh
 
Cascading Style Sheets - CSS
Sun Technlogies
 
LinkedIn SlideShare: Knowledge, Well-Presented
SlideShare
 
Ad

Similar to Css advanced – session 4 (20)

PPTX
Castro Chapter 11
Jeff Byrnes
 
PPT
CSS
ARJUN
 
PDF
CSS3 Refresher
Ivano Malavolta
 
PPTX
CSS_Dibbo
Sayanton Vhaduri
 
PPT
Css Positioning Elements
sanjay2211
 
PPTX
Css 101
Rhyan Mahazudin
 
PPTX
css3.pptx
ThiyaguPappu
 
PDF
Web Layout
Shawn Calvert
 
PPTX
CSS_Day_Three (W3schools)
Rafi Haidari
 
PPTX
Advanced CSS.pptx
DiyonaVas
 
PPT
Chapter6
DeAnna Gossett
 
PPTX
Working-With-The-Box-Model-Lesson-5.pptx
AxestetikrieyHales
 
PPTX
CSS3 notes
Rex Wang
 
PPTX
CSC PPT 9.pptx
DrRavneetSingh
 
PPT
gdg_workshop 4 on web development HTML & CSS
SaniyaKhan484230
 
PDF
Introduction 2 css
Md Tarik Mahmud
 
Castro Chapter 11
Jeff Byrnes
 
CSS
ARJUN
 
CSS3 Refresher
Ivano Malavolta
 
CSS_Dibbo
Sayanton Vhaduri
 
Css Positioning Elements
sanjay2211
 
css3.pptx
ThiyaguPappu
 
Web Layout
Shawn Calvert
 
CSS_Day_Three (W3schools)
Rafi Haidari
 
Advanced CSS.pptx
DiyonaVas
 
Chapter6
DeAnna Gossett
 
Working-With-The-Box-Model-Lesson-5.pptx
AxestetikrieyHales
 
CSS3 notes
Rex Wang
 
CSC PPT 9.pptx
DrRavneetSingh
 
gdg_workshop 4 on web development HTML & CSS
SaniyaKhan484230
 
Introduction 2 css
Md Tarik Mahmud
 
Ad

More from Dr. Ramkumar Lakshminarayanan (20)

PPT
IT security awareness
Dr. Ramkumar Lakshminarayanan
 
PPT
Basics of IT security
Dr. Ramkumar Lakshminarayanan
 
PDF
IT Security Awareness Posters
Dr. Ramkumar Lakshminarayanan
 
PPT
Normalisation revision
Dr. Ramkumar Lakshminarayanan
 
PPTX
Windows mobile programming
Dr. Ramkumar Lakshminarayanan
 
PPTX
Concurrency control
Dr. Ramkumar Lakshminarayanan
 
PPT
Web technology today
Dr. Ramkumar Lakshminarayanan
 
PDF
Phonegap for Android
Dr. Ramkumar Lakshminarayanan
 
PDF
Create and Sell Android App (in tamil)
Dr. Ramkumar Lakshminarayanan
 
PDF
Android app - Creating Live Wallpaper (tamil)
Dr. Ramkumar Lakshminarayanan
 
PDF
Android Tips (Tamil)
Dr. Ramkumar Lakshminarayanan
 
PDF
Android Animation (in tamil)
Dr. Ramkumar Lakshminarayanan
 
PDF
Creating List in Android App (in tamil)
Dr. Ramkumar Lakshminarayanan
 
PDF
Single Touch event view in Android (in tamil)
Dr. Ramkumar Lakshminarayanan
 
PDF
Android Application using seekbar (in tamil)
Dr. Ramkumar Lakshminarayanan
 
PDF
Rating Bar in Android Example
Dr. Ramkumar Lakshminarayanan
 
PDF
Creating Image Gallery - Android app (in tamil)
Dr. Ramkumar Lakshminarayanan
 
PDF
Create Android App using web view (in tamil)
Dr. Ramkumar Lakshminarayanan
 
PDF
Hardware Interface in Android (in tamil)
Dr. Ramkumar Lakshminarayanan
 
IT security awareness
Dr. Ramkumar Lakshminarayanan
 
Basics of IT security
Dr. Ramkumar Lakshminarayanan
 
IT Security Awareness Posters
Dr. Ramkumar Lakshminarayanan
 
Normalisation revision
Dr. Ramkumar Lakshminarayanan
 
Windows mobile programming
Dr. Ramkumar Lakshminarayanan
 
Concurrency control
Dr. Ramkumar Lakshminarayanan
 
Web technology today
Dr. Ramkumar Lakshminarayanan
 
Phonegap for Android
Dr. Ramkumar Lakshminarayanan
 
Create and Sell Android App (in tamil)
Dr. Ramkumar Lakshminarayanan
 
Android app - Creating Live Wallpaper (tamil)
Dr. Ramkumar Lakshminarayanan
 
Android Tips (Tamil)
Dr. Ramkumar Lakshminarayanan
 
Android Animation (in tamil)
Dr. Ramkumar Lakshminarayanan
 
Creating List in Android App (in tamil)
Dr. Ramkumar Lakshminarayanan
 
Single Touch event view in Android (in tamil)
Dr. Ramkumar Lakshminarayanan
 
Android Application using seekbar (in tamil)
Dr. Ramkumar Lakshminarayanan
 
Rating Bar in Android Example
Dr. Ramkumar Lakshminarayanan
 
Creating Image Gallery - Android app (in tamil)
Dr. Ramkumar Lakshminarayanan
 
Create Android App using web view (in tamil)
Dr. Ramkumar Lakshminarayanan
 
Hardware Interface in Android (in tamil)
Dr. Ramkumar Lakshminarayanan
 

Recently uploaded (20)

PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
Designing Production-Ready AI Agents
Kunal Rai
 
PDF
Advancing WebDriver BiDi support in WebKit
Igalia
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Designing Production-Ready AI Agents
Kunal Rai
 
Advancing WebDriver BiDi support in WebKit
Igalia
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 

Css advanced – session 4

  • 1. CSS Advanced – Session 4 Ramkumar Lakshminarayanan
  • 2. Grouping Selectors In style sheets there are often elements with the same style. h1 { color:green; } h2 { color:green; } p { color:green; }
  • 3. To minimize the code, you can group selectors. Separate each selector with a comma. In the example below we have grouped the selectors from the code above: Example Source Example h1,h2,p { color:green; }
  • 4. Nesting Selectors It is possible to apply a style for a selector within a selector. In the example below, one style is specified for all p elements, one style is specified for all elements with class=&quot;marked&quot;, and a third style is specified only for p elements with class=&quot;marked&quot;:
  • 5. Example Source Example p { color:blue; text-align:center; } .marked { background-color:red; } .marked p { color:white; }
  • 6. CSS Dimension The CSS dimension properties allow you to control the height and width of an element.
  • 7. All CSS Dimension Properties The number in the &quot;CSS&quot; column indicates in which CSS version the property is defined (CSS1 or CSS2). Example Property Description Values CSS Height Sets the height of an element auto length % inherit 1 max-height Sets the maximum height of an element none length % inherit 2 max-width Sets the maximum width of an element none length % inherit 2 min-height Sets the minimum height of an element length % inherit 2 min-width Sets the minimum width of an element length % inherit 2 width Sets the width of an element auto length % inherit 1
  • 8. CSS Display and Visibility The display property specifies if/how an element is displayed, and the visibility property specifies if an element should be visible or hidden.
  • 9. Hiding an Element - display:none or visibility:hidden Hiding an element can be done by setting the display property to &quot;none&quot; or the visibility property to &quot;hidden&quot;. However, notice that these two methods produce different results: visibility:hidden hides an element, but it will still take up the same space as before. The element will be hidden, but still affect the layout. Example Source Example h1.hidden {visibility:hidden;}
  • 10. display:none hides an element, and it will not take up any space. The element will be hidden, and the page will be displayed as the element is not there: Example Source Example h1.hidden {display:none;}
  • 11. CSS Display - Block and Inline Elements A block element is an element that takes up the full width available, and has a line break before and after it. Examples of block elements: <h1> <p> <div> An inline element only takes up as much width as necessary, and does not force line breaks. Examples of inline elements: <span> <a>
  • 12. Changing How an Element is Displayed Changing an inline element to a block element, or vice versa, can be useful for making the page look a specific way, and still follow web standards. The following example displays list items as inline elements: Example Source Example li {display:inline;}
  • 13. The following example displays span elements as block elements: Note:  Changing the display type of an element changes only how the element is displayed, NOT what kind of element it is. For example: An inline element set to display:block is not allowed to have a block element nested inside of it. Example Source Example span {display:block;}
  • 14. Positioning The CSS positioning properties allow you to position an element. It can also place an element behind another, and specify what should happen when an element's content is too big. Elements can be positioned using the top, bottom, left, and right properties. However, these properties will not work unless the position property is set first. They also work differently depending on the positioning method.
  • 15. There are four different positioning methods. Static Positioning Fixed Positioning Relative Positioning Absolute Positioning
  • 16. Static Positioning HTML elements are positioned static by default. A static positioned element is always positioned according to the normal flow of the page. Static positioned elements are not affected by the top, bottom, left, and right properties.
  • 17. Fixed Positioning An element with fixed position is positioned relative to the browser window. It will not move even if the window is scrolled: Example Source Example p.pos_fixed { position:fixed; top:30px; right:5px; }
  • 18. Note:  IE7 and IE8 support the fixed value only if a !DOCTYPE is specified. Fixed positioned elements are removed from the normal flow. The document and other elements behave like the fixed positioned element does not exist. Fixed positioned elements can overlap other elements.
  • 19. Relative Positioning A relative positioned element is positioned relative to its normal position. Example Source Example h2.pos_left { position:relative; left:-20px; } h2.pos_right { position:relative; left:20px; }
  • 20. The content of relatively positioned elements can be moved and overlap other elements, but the reserved space for the element is still preserved in the normal flow. Example Source Example h2.pos_top { position:relative; top:-50px; }
  • 21. Absolute Positioning An absolute position element is positioned relative to the first parent element that has a position other than static. If no such element is found, the containing block is <html>: h2 { position:absolute; left:100px; top:150px; }
  • 22. Absolutely positioned elements are removed from the normal flow. The document and other elements behave like the absolutely positioned element does not exist. Absolutely positioned elements can overlap other elements.
  • 23. Overlapping Elements When elements are positioned outside the normal flow, they can overlap other elements. The z-index property specifies the stack order of an element (which element should be placed in front of, or behind, the others). An element can have a positive or negative stack order: Example Source Example img { position:absolute; left:0px; top:0px; z-index:-1 }
  • 24. An element with greater stack order is always in front of an element with a lower stack order. Note:  If two positioned elements overlap, without a z-index specified, the element positioned last in the HTML code will be shown on top.
  • 25. All CSS Positioning Properties The number in the &quot;CSS&quot; column indicates in which CSS version the property is defined (CSS1 or CSS2).
  • 26. Property Description Values CSS bottom Sets the bottom margin edge for a positioned box auto length % inherit 2 Clip Clips an absolutely positioned element shape auto inherit 2 Cursor Specifies the type of cursor to be displayed url auto crosshair default pointer move e-resize ne-resize nw-resize n-resize se-resize sw-resize s-resize w-resize text wait help 2
  • 27. Left Sets the left margin edge for a positioned box auto length % inherit 2 overflow Specifies what happens if content overflows an element's box auto hidden scroll visible inherit 2 Position Specifies the type of positioning for an element absolute fixed relative static inherit 2 Right Sets the right margin edge for a positioned box auto length % inherit 2 Top Sets the top margin edge for a positioned box auto length % inherit 2 z-index Sets the stack order of an element number auto inherit 2
  • 28. What is CSS Float? With CSS float, an element can be pushed to the left or right, allowing other elements to wrap around it. Float is very often used for images, but it is also useful when working with layouts.
  • 29. How Elements Float Elements are floated horizontally, this means that an element can only be floated left or right, not up or down. A floated element will move as far to the left or right as it can. Usually this means all the way to the left or right of the containing element. The elements after the floating element will flow around it. The elements before the floating element will not be affected.
  • 30. If an image is floated to the right, a following text flows around it, to the left: Example Source Example img { float:right; }
  • 31. Floating Elements Next to Each Other If you place several floating elements after each other, they will float next to each other if there is room. Here we have made an image gallery using the float property Example Source Example .thumbnail  { float:left; width:110px; height:90px; margin:5px; }
  • 32. Turning off Float - Using Clear Elements after the floating element will flow around it. To avoid this, use the clear property. The clear property specifies which sides of an element other floating elements are not allowed. Add a text line into the image gallery, using the clear property: Example Source Example .text_line { clear:both; }
  • 33. All CSS Float Properties The number in the &quot;CSS&quot; column indicates in which CSS version the property is defined (CSS1 or CSS2). Property Description Values CSS Clear Specifies which sides of an element where other floating elements are not allowed left right both none inherit 1 float Specifies whether or not a box should float left right none inherit 1