SlideShare a Scribd company logo
Up here

BEGINNING HTML AND CSS
CLASS 4

HTML/CSS ~ Girl Develop It ~
WHAT WE'LL LEARN IN THIS SECTION
Positioning elements with CSS
Static position
Relative position
Absolute position
The "float" property
POSITIONING
The placement of elements on your webpage
The default position is called "static"
STATIC POSITIONING FOR INLINE
ELEMENTS
In normal flow, inline boxes flow from left to right, wrapping
to next line when needed.
<m sc"mgscoi1pg/
ig r=iae/oke.n">
<m sc"mgscoi2pg/
ig r=iae/oke.n">
<m sc"mgscoi3pg/
ig r=iae/oke.n">
..
.
<m sc"mgscoi2pg/
ig r=iae/oke.n">
<m sc"mgscoi3pg/
ig r=iae/oke.n">
STATIC POSITIONING FOR BLOCK
ELEMENTS
In normal flow, block boxes flow from top to bottom,
making a new line after every box.
<>reig<p
pGetns/>
<>el<p
pHlo/>
<>itee<p
pH hr!/>

Greetings
Hello
Hi there!
RELATIVE POSITIONING
Tells an element to be displayed in a different place
relative to its static position.
How? By defining where the top, right, bottom, or left edge
should be.
The elements around it behave like it is still in the static
spot.
RELATIVE POSITIONING
Example:
.eaie
rltv{
psto:rltv;
oiin eaie
lf:8p;
et 0x
tp 2p;
o: 0x
hih:10x
egt 0p;
bcgon-oo:ylo;
akrudclr elw
}

This sentence "sees" the relatively positioned div as if it
were still in its static position.
Hello, hi!
This sentence does the same.
ABSOLUTE POSITIONING
Tells an element exactly where you want it placed within
a defined container element.
You define the container element by giving it a position
of "relative".
Use the top, bottom, left, or right of the defined container
as coordinates.
Other elements completely ignore the absolutely
positioned element.
ABSOLUTE POSITIONING
Example:
.o{
tp
psto:aslt;
oiin boue
tp -0x
o: 2p;
rgt 4p;
ih: 0x
bcgon-oo:ylo
akrudclr elw
}

.otm
bto{
psto:aslt;
oiin boue
bto:-0x
otm 2p;
lf:0x
et6p;
bcgon-oo:gen
akrudclr re
}
EXAMPLE: ABSOLUTE POSITIONING
Here's an example of an
image with a caption
absolutely positioned over
top of it.
The containing div has a
position of relative, and
the caption has a position
of absolute.
Z­INDEX
When positioned elements overlap others, use "z-index" to
define "who's on top".
The element with highest z-index goes on top.
.otm
bto{
psto:aslt;
oiin boue
bto:1p;
otm 0x
lf:0x
et6p;
bcgon-oo:ylo;
akrudclr elw
zidx 1
-ne: ;
}

.o{
tp
psto:aslt;
oiin boue
bto:1p;
otm 5x
lf:0x
et6p;
bcgon-oo:gen
akrudclr re;
zidx 2
-ne: ;
}
LET'S SEE A DEMO!
FLOAT
"Floating" an element causes it to move left or right till it
bumps against another element or its container.
Elements below it will "rise up" to fill the space it
vacated.
Inline elements and text will make room for the floated
element by wrapping.
FLOAT: EXAMPLE
Below a <blockquote> is floated to the left, allowing text to
wrap around it on the right
FLOAT
.la{
fot
fotlf;
la:et
wdh20x
it:0p;
bcgon:elw
akrudylo;
}

Inline content wraps around the
floated div. The parent div
containing the inline content occupies all
the space behind the "float". The inline content moves over
to make room.
Hi, I'm a yellow box
with black text.
I like to hang out on
the left side.
USING FLOATS TO PLACE ELEMENTS SIDE
BY SIDE
If you want two block elements to be side by side:
float both elements.
give them the same "float" value.
give them widths.
CLEAR
The "clear" property tells the element not to "rise up"
behind the floated div.
"Clear: right" tells the element not to rise up behind a
right-floated element.
"Clear: left" tells the element not to rise up behind a leftfloated element.
There is also "clear: both" and "clear: none"
CLEAR
.la{
fot
fotlf;
la:et
wdh5p;
it:0x
bcgon:elw
akrudylo;
}
.la-et
cerlf{
cerlf
la:et
}

hi This element has no clear property.
hi This element has no clear property.
hi
This element has a class of .clear-left
Floated elements and the elements around them often
behave unexpectedly!
Floated elements get "hung up" underneath others.
If all the contents of a div are floated, the div collapses.
A div that "rises up" below a floated div will sometimes
leave its content stuck below.
Despite its shortcomings, the "float" property is used
extensively.
For a good slideshow explaining floats, go to:
http://www.slideshare.net/maxdesign/css-floats-explained
LET'S DEMO IT
QUESTIONS?

?
Top here
Bottom
Down

More Related Content

Viewers also liked (10)

Barangay san agustin 2
Barangay san agustin 2Barangay san agustin 2
Barangay san agustin 2
Rhema Anne
 
Csis110 trzos-c1 ms access
Csis110 trzos-c1 ms accessCsis110 trzos-c1 ms access
Csis110 trzos-c1 ms access
tomtrzos
 
 Instructional Design for the Active: Employing Interactive Technologies and...
	Instructional Design for the Active: Employing Interactive Technologies and...	Instructional Design for the Active: Employing Interactive Technologies and...
 Instructional Design for the Active: Employing Interactive Technologies and...
Anthony Holderied
 
melssCRM brochure
melssCRM brochuremelssCRM brochure
melssCRM brochure
morrisraja
 
Introducing NCLOR: Finding, Using, and Sharing Digital Learning Objects.
Introducing NCLOR: Finding, Using, and Sharing Digital Learning Objects.Introducing NCLOR: Finding, Using, and Sharing Digital Learning Objects.
Introducing NCLOR: Finding, Using, and Sharing Digital Learning Objects.
Anthony Holderied
 
Galane gold company presentation
Galane gold company presentationGalane gold company presentation
Galane gold company presentation
GalaneGold
 
 Creating Effective Research Assignments: Bridging the Gap Between Students ...
	Creating Effective Research Assignments: Bridging the Gap Between Students ...	Creating Effective Research Assignments: Bridging the Gap Between Students ...
 Creating Effective Research Assignments: Bridging the Gap Between Students ...
Anthony Holderied
 
Management Presentation
Management PresentationManagement Presentation
Management Presentation
GalaneGold
 
PhD Dissertation Powerpoint
PhD Dissertation PowerpointPhD Dissertation Powerpoint
PhD Dissertation Powerpoint
Hemal Mehta
 
Communication as a process 25 06-2012 4-47pm
Communication as a process 25 06-2012 4-47pmCommunication as a process 25 06-2012 4-47pm
Communication as a process 25 06-2012 4-47pm
lisahli.opiyo
 
Barangay san agustin 2
Barangay san agustin 2Barangay san agustin 2
Barangay san agustin 2
Rhema Anne
 
Csis110 trzos-c1 ms access
Csis110 trzos-c1 ms accessCsis110 trzos-c1 ms access
Csis110 trzos-c1 ms access
tomtrzos
 
 Instructional Design for the Active: Employing Interactive Technologies and...
	Instructional Design for the Active: Employing Interactive Technologies and...	Instructional Design for the Active: Employing Interactive Technologies and...
 Instructional Design for the Active: Employing Interactive Technologies and...
Anthony Holderied
 
melssCRM brochure
melssCRM brochuremelssCRM brochure
melssCRM brochure
morrisraja
 
Introducing NCLOR: Finding, Using, and Sharing Digital Learning Objects.
Introducing NCLOR: Finding, Using, and Sharing Digital Learning Objects.Introducing NCLOR: Finding, Using, and Sharing Digital Learning Objects.
Introducing NCLOR: Finding, Using, and Sharing Digital Learning Objects.
Anthony Holderied
 
Galane gold company presentation
Galane gold company presentationGalane gold company presentation
Galane gold company presentation
GalaneGold
 
 Creating Effective Research Assignments: Bridging the Gap Between Students ...
	Creating Effective Research Assignments: Bridging the Gap Between Students ...	Creating Effective Research Assignments: Bridging the Gap Between Students ...
 Creating Effective Research Assignments: Bridging the Gap Between Students ...
Anthony Holderied
 
Management Presentation
Management PresentationManagement Presentation
Management Presentation
GalaneGold
 
PhD Dissertation Powerpoint
PhD Dissertation PowerpointPhD Dissertation Powerpoint
PhD Dissertation Powerpoint
Hemal Mehta
 
Communication as a process 25 06-2012 4-47pm
Communication as a process 25 06-2012 4-47pmCommunication as a process 25 06-2012 4-47pm
Communication as a process 25 06-2012 4-47pm
lisahli.opiyo
 

Similar to GDI Seattle Intro to HTML and CSS - Class 4 (20)

CSC PPT 9.pptx
CSC PPT 9.pptxCSC PPT 9.pptx
CSC PPT 9.pptx
DrRavneetSingh
 
1 07-2-css floats-and_positioning
1 07-2-css floats-and_positioning1 07-2-css floats-and_positioning
1 07-2-css floats-and_positioning
apnwebdev
 
Lecture17-Floating Elements.pptx
Lecture17-Floating Elements.pptxLecture17-Floating Elements.pptx
Lecture17-Floating Elements.pptx
GIRISHKUMARBC1
 
Displaying.pptx
Displaying.pptxDisplaying.pptx
Displaying.pptx
naresh414857
 
Css advanced – session 4
Css advanced – session 4Css advanced – session 4
Css advanced – session 4
Dr. Ramkumar Lakshminarayanan
 
CSS_Dibbo
CSS_DibboCSS_Dibbo
CSS_Dibbo
Sayanton Vhaduri
 
Chapter6
Chapter6Chapter6
Chapter6
DeAnna Gossett
 
CSS_Day_Three (W3schools)
CSS_Day_Three (W3schools)CSS_Day_Three (W3schools)
CSS_Day_Three (W3schools)
Rafi Haidari
 
animation for designing elements and botto
animation for designing elements and bottoanimation for designing elements and botto
animation for designing elements and botto
zahidyousuf9
 
CSS Layout
CSS LayoutCSS Layout
CSS Layout
Doncho Minkov
 
Lesson2
Lesson2Lesson2
Lesson2
hstryk
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
Eliran Eliassy
 
Chapter05-Presentation.pptx
Chapter05-Presentation.pptxChapter05-Presentation.pptx
Chapter05-Presentation.pptx
ssuserf3db48
 
Css Positioning Elements
Css Positioning ElementsCss Positioning Elements
Css Positioning Elements
sanjay2211
 
Chapter 6 - Web Design
Chapter 6 - Web DesignChapter 6 - Web Design
Chapter 6 - Web Design
tclanton4
 
Css layout
Css layoutCss layout
Css layout
club23
 
Castro Chapter 11
Castro Chapter 11Castro Chapter 11
Castro Chapter 11
Jeff Byrnes
 
ClaFundamentalsof Web Developmentss12 .pdf
ClaFundamentalsof Web Developmentss12 .pdfClaFundamentalsof Web Developmentss12 .pdf
ClaFundamentalsof Web Developmentss12 .pdf
kasperkey106
 
Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning
Steve Guinan
 
WEBD 162: display property, Float and Clear
WEBD 162: display property, Float and ClearWEBD 162: display property, Float and Clear
WEBD 162: display property, Float and Clear
palomateach
 
1 07-2-css floats-and_positioning
1 07-2-css floats-and_positioning1 07-2-css floats-and_positioning
1 07-2-css floats-and_positioning
apnwebdev
 
Lecture17-Floating Elements.pptx
Lecture17-Floating Elements.pptxLecture17-Floating Elements.pptx
Lecture17-Floating Elements.pptx
GIRISHKUMARBC1
 
CSS_Day_Three (W3schools)
CSS_Day_Three (W3schools)CSS_Day_Three (W3schools)
CSS_Day_Three (W3schools)
Rafi Haidari
 
animation for designing elements and botto
animation for designing elements and bottoanimation for designing elements and botto
animation for designing elements and botto
zahidyousuf9
 
Lesson2
Lesson2Lesson2
Lesson2
hstryk
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
Eliran Eliassy
 
Chapter05-Presentation.pptx
Chapter05-Presentation.pptxChapter05-Presentation.pptx
Chapter05-Presentation.pptx
ssuserf3db48
 
Css Positioning Elements
Css Positioning ElementsCss Positioning Elements
Css Positioning Elements
sanjay2211
 
Chapter 6 - Web Design
Chapter 6 - Web DesignChapter 6 - Web Design
Chapter 6 - Web Design
tclanton4
 
Css layout
Css layoutCss layout
Css layout
club23
 
Castro Chapter 11
Castro Chapter 11Castro Chapter 11
Castro Chapter 11
Jeff Byrnes
 
ClaFundamentalsof Web Developmentss12 .pdf
ClaFundamentalsof Web Developmentss12 .pdfClaFundamentalsof Web Developmentss12 .pdf
ClaFundamentalsof Web Developmentss12 .pdf
kasperkey106
 
Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning
Steve Guinan
 
WEBD 162: display property, Float and Clear
WEBD 162: display property, Float and ClearWEBD 162: display property, Float and Clear
WEBD 162: display property, Float and Clear
palomateach
 
Ad

More from Heather Rock (7)

GDI Seattle - Web Accessibility Class 1
GDI Seattle - Web Accessibility Class 1GDI Seattle - Web Accessibility Class 1
GDI Seattle - Web Accessibility Class 1
Heather Rock
 
GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4
Heather Rock
 
GDI Seattle - Intro to JavaScript Class 2
GDI Seattle - Intro to JavaScript Class 2GDI Seattle - Intro to JavaScript Class 2
GDI Seattle - Intro to JavaScript Class 2
Heather Rock
 
GDI Seattle - Intro to JavaScript Class 1
GDI Seattle - Intro to JavaScript Class 1GDI Seattle - Intro to JavaScript Class 1
GDI Seattle - Intro to JavaScript Class 1
Heather Rock
 
GDI Seattle - Intermediate HTML and CSS Class 3 Slides
GDI Seattle - Intermediate HTML and CSS Class 3 SlidesGDI Seattle - Intermediate HTML and CSS Class 3 Slides
GDI Seattle - Intermediate HTML and CSS Class 3 Slides
Heather Rock
 
GDI Seattle Intro to HTML and CSS - Class 3
GDI Seattle Intro to HTML and CSS - Class 3GDI Seattle Intro to HTML and CSS - Class 3
GDI Seattle Intro to HTML and CSS - Class 3
Heather Rock
 
GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1
Heather Rock
 
GDI Seattle - Web Accessibility Class 1
GDI Seattle - Web Accessibility Class 1GDI Seattle - Web Accessibility Class 1
GDI Seattle - Web Accessibility Class 1
Heather Rock
 
GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4
Heather Rock
 
GDI Seattle - Intro to JavaScript Class 2
GDI Seattle - Intro to JavaScript Class 2GDI Seattle - Intro to JavaScript Class 2
GDI Seattle - Intro to JavaScript Class 2
Heather Rock
 
GDI Seattle - Intro to JavaScript Class 1
GDI Seattle - Intro to JavaScript Class 1GDI Seattle - Intro to JavaScript Class 1
GDI Seattle - Intro to JavaScript Class 1
Heather Rock
 
GDI Seattle - Intermediate HTML and CSS Class 3 Slides
GDI Seattle - Intermediate HTML and CSS Class 3 SlidesGDI Seattle - Intermediate HTML and CSS Class 3 Slides
GDI Seattle - Intermediate HTML and CSS Class 3 Slides
Heather Rock
 
GDI Seattle Intro to HTML and CSS - Class 3
GDI Seattle Intro to HTML and CSS - Class 3GDI Seattle Intro to HTML and CSS - Class 3
GDI Seattle Intro to HTML and CSS - Class 3
Heather Rock
 
GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1
Heather Rock
 
Ad

Recently uploaded (20)

Secure Access with Azure Active Directory
Secure Access with Azure Active DirectorySecure Access with Azure Active Directory
Secure Access with Azure Active Directory
VICTOR MAESTRE RAMIREZ
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Infrassist Technologies Pvt. Ltd.
 
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
Edge AI and Vision Alliance
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
NTT DATA Technology & Innovation
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdfvertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationAI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
Christine Shepherd
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Cisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdfCisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdf
superdpz
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too LateKubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely
 
How to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptxHow to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
If You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FMEIf You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FME
Safe Software
 
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdfBoosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Alkin Tezuysal
 
Secure Access with Azure Active Directory
Secure Access with Azure Active DirectorySecure Access with Azure Active Directory
Secure Access with Azure Active Directory
VICTOR MAESTRE RAMIREZ
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Infrassist Technologies Pvt. Ltd.
 
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
Edge AI and Vision Alliance
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
NTT DATA Technology & Innovation
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdfvertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationAI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
Christine Shepherd
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Cisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdfCisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdf
superdpz
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too LateKubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely
 
How to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptxHow to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
If You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FMEIf You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FME
Safe Software
 
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdfBoosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Alkin Tezuysal
 

GDI Seattle Intro to HTML and CSS - Class 4

  • 1. Up here BEGINNING HTML AND CSS CLASS 4 HTML/CSS ~ Girl Develop It ~
  • 2. WHAT WE'LL LEARN IN THIS SECTION Positioning elements with CSS Static position Relative position Absolute position The "float" property
  • 3. POSITIONING The placement of elements on your webpage The default position is called "static"
  • 4. STATIC POSITIONING FOR INLINE ELEMENTS In normal flow, inline boxes flow from left to right, wrapping to next line when needed. <m sc"mgscoi1pg/ ig r=iae/oke.n"> <m sc"mgscoi2pg/ ig r=iae/oke.n"> <m sc"mgscoi3pg/ ig r=iae/oke.n"> .. . <m sc"mgscoi2pg/ ig r=iae/oke.n"> <m sc"mgscoi3pg/ ig r=iae/oke.n">
  • 5. STATIC POSITIONING FOR BLOCK ELEMENTS In normal flow, block boxes flow from top to bottom, making a new line after every box. <>reig<p pGetns/> <>el<p pHlo/> <>itee<p pH hr!/> Greetings Hello Hi there!
  • 6. RELATIVE POSITIONING Tells an element to be displayed in a different place relative to its static position. How? By defining where the top, right, bottom, or left edge should be. The elements around it behave like it is still in the static spot.
  • 7. RELATIVE POSITIONING Example: .eaie rltv{ psto:rltv; oiin eaie lf:8p; et 0x tp 2p; o: 0x hih:10x egt 0p; bcgon-oo:ylo; akrudclr elw } This sentence "sees" the relatively positioned div as if it were still in its static position. Hello, hi! This sentence does the same.
  • 8. ABSOLUTE POSITIONING Tells an element exactly where you want it placed within a defined container element. You define the container element by giving it a position of "relative". Use the top, bottom, left, or right of the defined container as coordinates. Other elements completely ignore the absolutely positioned element.
  • 9. ABSOLUTE POSITIONING Example: .o{ tp psto:aslt; oiin boue tp -0x o: 2p; rgt 4p; ih: 0x bcgon-oo:ylo akrudclr elw } .otm bto{ psto:aslt; oiin boue bto:-0x otm 2p; lf:0x et6p; bcgon-oo:gen akrudclr re }
  • 10. EXAMPLE: ABSOLUTE POSITIONING Here's an example of an image with a caption absolutely positioned over top of it. The containing div has a position of relative, and the caption has a position of absolute.
  • 11. Z­INDEX When positioned elements overlap others, use "z-index" to define "who's on top". The element with highest z-index goes on top. .otm bto{ psto:aslt; oiin boue bto:1p; otm 0x lf:0x et6p; bcgon-oo:ylo; akrudclr elw zidx 1 -ne: ; } .o{ tp psto:aslt; oiin boue bto:1p; otm 5x lf:0x et6p; bcgon-oo:gen akrudclr re; zidx 2 -ne: ; }
  • 12. LET'S SEE A DEMO!
  • 13. FLOAT "Floating" an element causes it to move left or right till it bumps against another element or its container. Elements below it will "rise up" to fill the space it vacated. Inline elements and text will make room for the floated element by wrapping.
  • 14. FLOAT: EXAMPLE Below a <blockquote> is floated to the left, allowing text to wrap around it on the right
  • 15. FLOAT .la{ fot fotlf; la:et wdh20x it:0p; bcgon:elw akrudylo; } Inline content wraps around the floated div. The parent div containing the inline content occupies all the space behind the "float". The inline content moves over to make room. Hi, I'm a yellow box with black text. I like to hang out on the left side.
  • 16. USING FLOATS TO PLACE ELEMENTS SIDE BY SIDE If you want two block elements to be side by side: float both elements. give them the same "float" value. give them widths.
  • 17. CLEAR The "clear" property tells the element not to "rise up" behind the floated div. "Clear: right" tells the element not to rise up behind a right-floated element. "Clear: left" tells the element not to rise up behind a leftfloated element. There is also "clear: both" and "clear: none"
  • 18. CLEAR .la{ fot fotlf; la:et wdh5p; it:0x bcgon:elw akrudylo; } .la-et cerlf{ cerlf la:et } hi This element has no clear property. hi This element has no clear property. hi This element has a class of .clear-left
  • 19. Floated elements and the elements around them often behave unexpectedly! Floated elements get "hung up" underneath others. If all the contents of a div are floated, the div collapses. A div that "rises up" below a floated div will sometimes leave its content stuck below.
  • 20. Despite its shortcomings, the "float" property is used extensively. For a good slideshow explaining floats, go to: http://www.slideshare.net/maxdesign/css-floats-explained