SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
WDES105
Day 1 -- CSS




               about.me/babon
Positioning
The CSS position property lets you control how
and where a web browser displays particular
elements.

Four types:
● Absolute
● Relative
● Fixed
● Static
                                  about.me/babon
Positioning: Absolute
Absolute positioning lets you determine an
element's location by specifying one of the
following positions:

● left, right, top or bottom

... using one of the following measurements:

● pixels, ems or percentages
                                   about.me/babon
Positioning: Absolute
Exercise: Positioning a banner

● Go to cosmofarmer.com
● Copy banner image
● Create a new page called absolute.html




                                 about.me/babon
Positioning: Absolute
Notes:

● The float property does not play well with the
  following positions:
   ○ absolute
   ○ fixed


So, avoid using floats and absolute or fixed
position on the same elements.

                                   about.me/babon
Positioning: Relative
A relatively positioned element is placed
relative to its current position in the HTML flow.

The main benefit of relative positioning isn't to
move an element, but to set a new point of
reference for absolutely positioned elements
that are nested inside it.



                                     about.me/babon
Positioning: Relative
Exercise: Positioning a banner inside a wrapper

● Create a new page called relative.html




                                  about.me/babon
Positioning: Fixed
A fixed element is locked into place on the
screen.

Similar to the fixed value for the background-
attachment property.




                                    about.me/babon
Positioning: Fixed
Exercise: Positioning a banner in a fixed
position

● Create a new page called fixed.

Assignment: Position the banner in a fixed
position at the top center of page so that it sits
on top of the wrapper.

                                      about.me/babon
Positioning: Fixed
Inspiration:

22 Examples of Fixed Position Navigation in
Web Design




                                  about.me/babon
Positioning: Static
Static positioning simply means that the content
follows the normal top-down flow of HTML.

Static is the normal positioning method.

Probably never use this attribute.




                                     about.me/babon
Top | Bottom | Left | Right
Typically use Top or Left with absolute or fixed
positioning. Can also use Bottom or Right.

Can also use negative values to position
elements "away from the middle."

Experiment with absolute.html and fixed.html.



                                    about.me/babon
Z-index
z-index is used to position an element in the
third dimension -- out and away from the page.

The higher the number, the further away from
the page.




                                  about.me/babon
Z-index
z-index will only work on an element whose
position property has been explicitly set to
absolute, fixed or relative.

● Create a new page called z-index.html.




                                   about.me/babon

Weitere ähnliche Inhalte

Ähnlich wie Wdes105 day 1

Ähnlich wie Wdes105 day 1 (7)

Exp13 write up
Exp13 write upExp13 write up
Exp13 write up
 
Chapter05-Presentation.pptx
Chapter05-Presentation.pptxChapter05-Presentation.pptx
Chapter05-Presentation.pptx
 
Css Positioning Elements
Css Positioning ElementsCss Positioning Elements
Css Positioning Elements
 
Constraint layout - Cutting edge Android layout design
Constraint layout - Cutting edge Android layout designConstraint layout - Cutting edge Android layout design
Constraint layout - Cutting edge Android layout design
 
CSS Positioning
CSS PositioningCSS Positioning
CSS Positioning
 
CSS Positioning Elements.pdf
CSS Positioning Elements.pdfCSS Positioning Elements.pdf
CSS Positioning Elements.pdf
 
Parallax effect in css by Khubaib
Parallax effect in css by KhubaibParallax effect in css by Khubaib
Parallax effect in css by Khubaib
 

Mehr von Gene Babon

Job Search | Tropical Depressions | Bowling Alleys
Job Search | Tropical Depressions | Bowling AlleysJob Search | Tropical Depressions | Bowling Alleys
Job Search | Tropical Depressions | Bowling AlleysGene Babon
 
Tech Over Fifty Launch Meeting
Tech Over Fifty Launch MeetingTech Over Fifty Launch Meeting
Tech Over Fifty Launch MeetingGene Babon
 
Anatomy Virtual Self Study Group NEPHP 2018
Anatomy Virtual Self Study Group NEPHP 2018Anatomy Virtual Self Study Group NEPHP 2018
Anatomy Virtual Self Study Group NEPHP 2018Gene Babon
 
Become a Front End Web Developer
Become a Front End Web DeveloperBecome a Front End Web Developer
Become a Front End Web DeveloperGene Babon
 
Navigating a Career in Web Technology
Navigating a Career in Web TechnologyNavigating a Career in Web Technology
Navigating a Career in Web TechnologyGene Babon
 
Getting Things Done
Getting Things DoneGetting Things Done
Getting Things DoneGene Babon
 
jQuery Mobile Hour 4
jQuery Mobile Hour 4jQuery Mobile Hour 4
jQuery Mobile Hour 4Gene Babon
 

Mehr von Gene Babon (20)

Job Search | Tropical Depressions | Bowling Alleys
Job Search | Tropical Depressions | Bowling AlleysJob Search | Tropical Depressions | Bowling Alleys
Job Search | Tropical Depressions | Bowling Alleys
 
Tech Over Fifty Launch Meeting
Tech Over Fifty Launch MeetingTech Over Fifty Launch Meeting
Tech Over Fifty Launch Meeting
 
Anatomy Virtual Self Study Group NEPHP 2018
Anatomy Virtual Self Study Group NEPHP 2018Anatomy Virtual Self Study Group NEPHP 2018
Anatomy Virtual Self Study Group NEPHP 2018
 
Become a Front End Web Developer
Become a Front End Web DeveloperBecome a Front End Web Developer
Become a Front End Web Developer
 
Navigating a Career in Web Technology
Navigating a Career in Web TechnologyNavigating a Career in Web Technology
Navigating a Career in Web Technology
 
Info Session
Info SessionInfo Session
Info Session
 
Info session
Info sessionInfo session
Info session
 
Getting Things Done
Getting Things DoneGetting Things Done
Getting Things Done
 
jQuery Mobile Hour 4
jQuery Mobile Hour 4jQuery Mobile Hour 4
jQuery Mobile Hour 4
 
Lesson 17
Lesson 17Lesson 17
Lesson 17
 
Lesson 18
Lesson 18Lesson 18
Lesson 18
 
Lesson 17
Lesson 17Lesson 17
Lesson 17
 
Lesson 16
Lesson 16Lesson 16
Lesson 16
 
Lesson 15
Lesson 15Lesson 15
Lesson 15
 
Lesson 11
Lesson 11Lesson 11
Lesson 11
 
Lesson 10
Lesson 10Lesson 10
Lesson 10
 
Lesson 09
Lesson 09Lesson 09
Lesson 09
 
Lesson 04
Lesson 04Lesson 04
Lesson 04
 
Lesson 03
Lesson 03Lesson 03
Lesson 03
 
Lesson 01
Lesson 01Lesson 01
Lesson 01
 

Wdes105 day 1

  • 1. WDES105 Day 1 -- CSS about.me/babon
  • 2. Positioning The CSS position property lets you control how and where a web browser displays particular elements. Four types: ● Absolute ● Relative ● Fixed ● Static about.me/babon
  • 3. Positioning: Absolute Absolute positioning lets you determine an element's location by specifying one of the following positions: ● left, right, top or bottom ... using one of the following measurements: ● pixels, ems or percentages about.me/babon
  • 4. Positioning: Absolute Exercise: Positioning a banner ● Go to cosmofarmer.com ● Copy banner image ● Create a new page called absolute.html about.me/babon
  • 5. Positioning: Absolute Notes: ● The float property does not play well with the following positions: ○ absolute ○ fixed So, avoid using floats and absolute or fixed position on the same elements. about.me/babon
  • 6. Positioning: Relative A relatively positioned element is placed relative to its current position in the HTML flow. The main benefit of relative positioning isn't to move an element, but to set a new point of reference for absolutely positioned elements that are nested inside it. about.me/babon
  • 7. Positioning: Relative Exercise: Positioning a banner inside a wrapper ● Create a new page called relative.html about.me/babon
  • 8. Positioning: Fixed A fixed element is locked into place on the screen. Similar to the fixed value for the background- attachment property. about.me/babon
  • 9. Positioning: Fixed Exercise: Positioning a banner in a fixed position ● Create a new page called fixed. Assignment: Position the banner in a fixed position at the top center of page so that it sits on top of the wrapper. about.me/babon
  • 10. Positioning: Fixed Inspiration: 22 Examples of Fixed Position Navigation in Web Design about.me/babon
  • 11. Positioning: Static Static positioning simply means that the content follows the normal top-down flow of HTML. Static is the normal positioning method. Probably never use this attribute. about.me/babon
  • 12. Top | Bottom | Left | Right Typically use Top or Left with absolute or fixed positioning. Can also use Bottom or Right. Can also use negative values to position elements "away from the middle." Experiment with absolute.html and fixed.html. about.me/babon
  • 13. Z-index z-index is used to position an element in the third dimension -- out and away from the page. The higher the number, the further away from the page. about.me/babon
  • 14. Z-index z-index will only work on an element whose position property has been explicitly set to absolute, fixed or relative. ● Create a new page called z-index.html. about.me/babon