SlideShare une entreprise Scribd logo
1  sur  22
Shaping up with CSS
               <understanding how true CSS layouts are built />




Advanced CSS                                                      Stephen Ireland
Understanding Elements

• HTML elements
• Marked up as <tags />
• Two types of HTML elements


    Block level elements       Inline elements
    <h1>, <h2>, <h3> etc       <span>

    <p>                        <strong>

    <div>                      <em>

    <blockquote>               <a>

    <ul> and <ol>
Advanced CSS                                     Stephen Ireland
Block level Elements

• Fundamental differences in use
• Identified as normally displayed on its own line
• Other elements appear above or below - not either side
• Can be used as a container for one or more other elements


    The rules

• A block level element can contain other block-level elements,
    as well as inline elements.
• An inline element cannot contain block-level elements.


Advanced CSS                                          Stephen Ireland
Block Element Rule

    The rule




                                           x
    <div>
        <a href=”#”><h1>My link</h1></a>
    </div>




                                           ✓
    <div>
        <h1><a href=”#”>My link</a></h1>
    </div>



Advanced CSS                               Stephen Ireland
Inline Element Rule

    The rule

    It’s okay to nest one inline element inside another;


    <div>




                                                           ✓
        <h1>
               <a href=”#”><span>My link</span></a>
        </h1>
    </div>



Advanced CSS                                               Stephen Ireland
Element Symmetry

    Opening & closing XHTML tags

    <div>




                                                     x
        <h1>
               <a href=”#”>
                 <span>My link</span>

                     ←
               </h1>
        </a>              h1 element should not close before a
    </div>

    Can be checked using online validators (validator.w3.org)

Advanced CSS                                                Stephen Ireland
Styling Elements

    Inline elements
• Changing colour (text and background)
• Changing font styles (size, typeface, bold, underline, etc.)


    Block-level elements
• Set fixed width or height
• Set padding or margin values
• Position a block to any location on a web page, regardless
    of where it appears in the XHTML markup

    This is why block-level elements are more powerful

Advanced CSS                                             Stephen Ireland
Sizing Defaults
    Block-level elements
• Will take 100% of available width
• Available width could be parent element
• Or could be browser window
• Takes whatever height it needs




Advanced CSS                                Stephen Ireland
Setting Heights & Widths
    Setting a width
    This CSS declaration will adjust a paragraph with the class
    value of ‘highlight’. The paragraph will become 50% the width
    of its containing element.


    CSS declaration

    p.highlight {
        width: 50%;
    }

Advanced CSS                                              Stephen Ireland
Units of Measurement

    When sizing and positioning elements we can use different
    units of measurement. Each unit type have their benefits and
    drawbacks. Although different unit types can be mixed within
    layouts, problems may occur.


    Units
• Pixels (px) for fixed sizing / positioning
• Percentages (%) for sizes relative to containing elements
• Ems (em) for sizes relative to base font size
• Points (pt) for print based styles

Advanced CSS                                            Stephen Ireland
Fixed Block-Level Sizing

    Setting a height as well as a width to a block-level element is
    just as simple, although be wary of possible consequences.


    CSS declaration

    #navigation {
        background-color: #cccccc;
        width: 200px;
        height: 400px;
    }


Advanced CSS                                               Stephen Ireland
Browser Behaviour

    If you set a height that is less than the room needed for the
    content of the element, that content will overflow.

    Firefox                         Internet Explorer




Advanced CSS                                              Stephen Ireland
Other Occurances

    If a visitor to your
    website increases the
    font-size, text may
    overflow the containing
    element of a fixed size.




Advanced CSS                   Stephen Ireland
Overflow:Hidden

    There is a way to stop elements escaping the bounds of
    their containing element - set the CSS overflow property
    to ‘hidden’. Bad practice in this situation as text becomes
    unreadable anyway...


    #navigation {
        background-color: #cccccc;
        width: 200px;
        height: 300px;
    	 overflow:	hidden;
    }
Advanced CSS                                              Stephen Ireland
Positioning Elements

    Full CSS layouts
• Without intervention from CSS, a web
    browser will display elements in the
    order they appear in the source file.
• By full CSS layouts, we mean layouts
    that use CSS entirely for positioning
    elements in the web browser window.
• There are many different ways to create CSS layouts.
• Best practice methods often harder to achieve.


Advanced CSS                                             Stephen Ireland
Full CSS Layouts

    Conventional layouts
• Comprise of
    • A header
    • Two or three columns
    • A footer
• Use <div> tags for layout hooks
• Use XHTML property ‘id’ to style div elements individually

    XHTML                        CSS
    <div id=”banner”></div>      #banner { width: 760px; }

Advanced CSS                                           Stephen Ireland
Layout Options

    Debate
• Fixed-width
• Fluid-width
• Semi-fluid (one fixed width column, one fluid width)
• Zoom (entire layout relative to font size)
• Resolution-dependent (Made possible with Javascript)


    All types of layouts are dependent on methods of sizing and
    positioning of the block-level elements.



Advanced CSS                                             Stephen Ireland
Positioning Block-Level Elements

    CSS	‘position’	property	
• Static
• Relative
                       #banner { position: absolute; }
• Absolute
• Fixed

    CSS	‘float’	property	
• Left
• Right                #left-col { float: left; }
• None

Advanced CSS                                         Stephen Ireland
Easiest positioning Method

    CSS	‘position’	property	
• Static
• Relative

               ←
                            #banner { position: absolute; }
• Absolute
• Fixed            Its absolute positioning

    CSS	‘float’	property	
• Left
• Right                     #left-col { float: left; }
• None

Advanced CSS                                              Stephen Ireland
Position:Absolute

    Absolute positioning gives you total control where a
    block-level element appears in the browser window. This
    declaration positions a div with id of ‘banner’ 10 pixels
    from the top and left of the browser window.


                                  ←
    #banner {
        position: absolute;
        top: 50px;
        left: 50px;
    }


Advanced CSS                                               Stephen Ireland
Top, right, Bottom, Left

• Absolute positioning relies on a
    position being set.
• If you don’t provide positions, your
    elements will overlap one another.
• Make sure to set one or two values
• In most cases you will work from the
    top-left corner of the browser window.
    Therefore, most commonly used
    properties are ‘top’ and ‘left’.



Advanced CSS                                 Stephen Ireland
Handy Tips

• Before moving on to more complex positioning schema,
    experiment with the control absolute positioning gives you.
• Set background-color on the different main elements, or
    give each element a border temporarily until you have
    your layout how you intended. You’ll be able to see where
    each element starts and ends, without holding a ruler in
    front of the screen!
• Nothing is ever nothing unless specified - most browsers
    have default margins and paddings which could upset
    your design. If in doubt - specify them with zero value.


Advanced CSS                                             Stephen Ireland

Contenu connexe

Tendances

Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersSuzette Franck
 
How to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - SacramentoHow to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - SacramentoSuzette Franck
 
Maintainable CSS
Maintainable CSSMaintainable CSS
Maintainable CSSStephen Hay
 
How to use CSS3 in WordPress
How to use CSS3 in WordPressHow to use CSS3 in WordPress
How to use CSS3 in WordPressSuzette Franck
 
WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...
WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...
WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...New Tricks
 
CSS For Backend Developers
CSS For Backend DevelopersCSS For Backend Developers
CSS For Backend Developers10Clouds
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media QueriesRuss Weakley
 
6 Steps to Make Your CSS Code More Maintainable
6 Steps to Make Your CSS Code More Maintainable6 Steps to Make Your CSS Code More Maintainable
6 Steps to Make Your CSS Code More Maintainable10Clouds
 
The Future Of CSS
The Future Of CSSThe Future Of CSS
The Future Of CSSAndy Budd
 

Tendances (20)

Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress Developers
 
How to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - SacramentoHow to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - Sacramento
 
Maintainable CSS
Maintainable CSSMaintainable CSS
Maintainable CSS
 
CSS Best practice
CSS Best practiceCSS Best practice
CSS Best practice
 
Sass
SassSass
Sass
 
CSS Reset
CSS ResetCSS Reset
CSS Reset
 
How to use CSS3 in WordPress
How to use CSS3 in WordPressHow to use CSS3 in WordPress
How to use CSS3 in WordPress
 
Srijan presentation on CSS
Srijan presentation on CSSSrijan presentation on CSS
Srijan presentation on CSS
 
Artdm171 Week5 Css
Artdm171 Week5 CssArtdm171 Week5 Css
Artdm171 Week5 Css
 
CSS Introduction
CSS IntroductionCSS Introduction
CSS Introduction
 
WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...
WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...
WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...
 
css-tutorial
css-tutorialcss-tutorial
css-tutorial
 
Less css
Less cssLess css
Less css
 
The ABCs of HTML
The ABCs of HTMLThe ABCs of HTML
The ABCs of HTML
 
CSS For Backend Developers
CSS For Backend DevelopersCSS For Backend Developers
CSS For Backend Developers
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
 
6 Steps to Make Your CSS Code More Maintainable
6 Steps to Make Your CSS Code More Maintainable6 Steps to Make Your CSS Code More Maintainable
6 Steps to Make Your CSS Code More Maintainable
 
Intro to SASS CSS
Intro to SASS CSSIntro to SASS CSS
Intro to SASS CSS
 
The Future Of CSS
The Future Of CSSThe Future Of CSS
The Future Of CSS
 
Sass presentation
Sass presentationSass presentation
Sass presentation
 

En vedette

Css Positioning Elements
Css Positioning ElementsCss Positioning Elements
Css Positioning Elementssanjay2211
 
Lesson 108 23 aug13-1430-ay
Lesson 108 23 aug13-1430-ayLesson 108 23 aug13-1430-ay
Lesson 108 23 aug13-1430-ayCodecademy Ren
 
5 domain name worksheet
5   domain name worksheet5   domain name worksheet
5 domain name worksheetviet nghiem
 
Anatomy Of A Domain Name and URL
Anatomy Of A Domain Name and URLAnatomy Of A Domain Name and URL
Anatomy Of A Domain Name and URLAndy Wibbels
 
Purchase Your Domain Name
Purchase Your Domain NamePurchase Your Domain Name
Purchase Your Domain NameCourtney Engle
 

En vedette (7)

Css Positioning Elements
Css Positioning ElementsCss Positioning Elements
Css Positioning Elements
 
Css positioning
Css positioningCss positioning
Css positioning
 
Lesson 108 23 aug13-1430-ay
Lesson 108 23 aug13-1430-ayLesson 108 23 aug13-1430-ay
Lesson 108 23 aug13-1430-ay
 
5 domain name worksheet
5   domain name worksheet5   domain name worksheet
5 domain name worksheet
 
CSS font-stacks
CSS font-stacksCSS font-stacks
CSS font-stacks
 
Anatomy Of A Domain Name and URL
Anatomy Of A Domain Name and URLAnatomy Of A Domain Name and URL
Anatomy Of A Domain Name and URL
 
Purchase Your Domain Name
Purchase Your Domain NamePurchase Your Domain Name
Purchase Your Domain Name
 

Similaire à Shaping Up With CSS

Designing for the web - 101
Designing for the web - 101Designing for the web - 101
Designing for the web - 101Ashraf Hamdy
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Erin M. Kidwell
 
High Performance Front-End Development
High Performance Front-End DevelopmentHigh Performance Front-End Development
High Performance Front-End Developmentdrywallbmb
 
Web Programming Basic topic.pptx
Web Programming Basic topic.pptxWeb Programming Basic topic.pptx
Web Programming Basic topic.pptxShouravPodder3
 
Basics of Rich Internet Applications
Basics of Rich Internet ApplicationsBasics of Rich Internet Applications
Basics of Rich Internet ApplicationsSubramanyan Murali
 
Web Design Course: CSS lecture 4
Web Design Course: CSS  lecture 4Web Design Course: CSS  lecture 4
Web Design Course: CSS lecture 4Gheyath M. Othman
 
CSS Layout Tutorial
CSS Layout TutorialCSS Layout Tutorial
CSS Layout Tutorialhstryk
 
Web-03-CSS.ppt
Web-03-CSS.pptWeb-03-CSS.ppt
Web-03-CSS.pptjoeveller
 
Style Your Site Part 1
Style Your Site Part 1Style Your Site Part 1
Style Your Site Part 1Ben MacNeill
 
Even faster web sites presentation 3
Even faster web sites presentation 3Even faster web sites presentation 3
Even faster web sites presentation 3Felipe Lavín
 
Html5 elements-Kip Academy
Html5 elements-Kip AcademyHtml5 elements-Kip Academy
Html5 elements-Kip Academykip academy
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. The University of Akron
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTMLAmit Tyagi
 

Similaire à Shaping Up With CSS (20)

Css tips & tricks
Css tips & tricksCss tips & tricks
Css tips & tricks
 
Designing for the web - 101
Designing for the web - 101Designing for the web - 101
Designing for the web - 101
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
Intro to CSS
Intro to CSSIntro to CSS
Intro to CSS
 
Css
CssCss
Css
 
High Performance Front-End Development
High Performance Front-End DevelopmentHigh Performance Front-End Development
High Performance Front-End Development
 
Web Programming Basic topic.pptx
Web Programming Basic topic.pptxWeb Programming Basic topic.pptx
Web Programming Basic topic.pptx
 
Basics of Rich Internet Applications
Basics of Rich Internet ApplicationsBasics of Rich Internet Applications
Basics of Rich Internet Applications
 
David Weliver
David WeliverDavid Weliver
David Weliver
 
Css3
Css3Css3
Css3
 
Web Design Course: CSS lecture 4
Web Design Course: CSS  lecture 4Web Design Course: CSS  lecture 4
Web Design Course: CSS lecture 4
 
CSS Layout Tutorial
CSS Layout TutorialCSS Layout Tutorial
CSS Layout Tutorial
 
Web Layout
Web LayoutWeb Layout
Web Layout
 
Web-03-CSS.ppt
Web-03-CSS.pptWeb-03-CSS.ppt
Web-03-CSS.ppt
 
Style Your Site Part 1
Style Your Site Part 1Style Your Site Part 1
Style Your Site Part 1
 
Web
WebWeb
Web
 
Even faster web sites presentation 3
Even faster web sites presentation 3Even faster web sites presentation 3
Even faster web sites presentation 3
 
Html5 elements-Kip Academy
Html5 elements-Kip AcademyHtml5 elements-Kip Academy
Html5 elements-Kip Academy
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors.
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 

Dernier

Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...pujan9679
 
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur DubaiUAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubaijaehdlyzca
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwaitdaisycvs
 
PHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation FinalPHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation FinalPanhandleOilandGas
 
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGBerhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGpr788182
 
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptxQSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptxDitasDelaCruz
 
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...meghakumariji156
 
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 MonthsSEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 MonthsIndeedSEO
 
Cannabis Legalization World Map: 2024 Updated
Cannabis Legalization World Map: 2024 UpdatedCannabis Legalization World Map: 2024 Updated
Cannabis Legalization World Map: 2024 UpdatedCannaBusinessPlans
 
Call 7737669865 Vadodara Call Girls Service at your Door Step Available All Time
Call 7737669865 Vadodara Call Girls Service at your Door Step Available All TimeCall 7737669865 Vadodara Call Girls Service at your Door Step Available All Time
Call 7737669865 Vadodara Call Girls Service at your Door Step Available All Timegargpaaro
 
Lucknow Housewife Escorts by Sexy Bhabhi Service 8250092165
Lucknow Housewife Escorts  by Sexy Bhabhi Service 8250092165Lucknow Housewife Escorts  by Sexy Bhabhi Service 8250092165
Lucknow Housewife Escorts by Sexy Bhabhi Service 8250092165meghakumariji156
 
Durg CALL GIRL ❤ 82729*64427❤ CALL GIRLS IN durg ESCORTS
Durg CALL GIRL ❤ 82729*64427❤ CALL GIRLS IN durg ESCORTSDurg CALL GIRL ❤ 82729*64427❤ CALL GIRLS IN durg ESCORTS
Durg CALL GIRL ❤ 82729*64427❤ CALL GIRLS IN durg ESCORTSkajalroy875762
 
Falcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting
 
New 2024 Cannabis Edibles Investor Pitch Deck Template
New 2024 Cannabis Edibles Investor Pitch Deck TemplateNew 2024 Cannabis Edibles Investor Pitch Deck Template
New 2024 Cannabis Edibles Investor Pitch Deck TemplateCannaBusinessPlans
 
Uneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration PresentationUneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration Presentationuneakwhite
 
PARK STREET 💋 Call Girl 9827461493 Call Girls in Escort service book now
PARK STREET 💋 Call Girl 9827461493 Call Girls in  Escort service book nowPARK STREET 💋 Call Girl 9827461493 Call Girls in  Escort service book now
PARK STREET 💋 Call Girl 9827461493 Call Girls in Escort service book nowkapoorjyoti4444
 
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfAdmir Softic
 
joint cost.pptx COST ACCOUNTING Sixteenth Edition ...
joint cost.pptx  COST ACCOUNTING  Sixteenth Edition                          ...joint cost.pptx  COST ACCOUNTING  Sixteenth Edition                          ...
joint cost.pptx COST ACCOUNTING Sixteenth Edition ...NadhimTaha
 
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...ssuserf63bd7
 

Dernier (20)

Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
 
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur DubaiUAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
 
PHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation FinalPHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation Final
 
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGBerhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
 
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptxQSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
 
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
 
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 MonthsSEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
 
Cannabis Legalization World Map: 2024 Updated
Cannabis Legalization World Map: 2024 UpdatedCannabis Legalization World Map: 2024 Updated
Cannabis Legalization World Map: 2024 Updated
 
Call 7737669865 Vadodara Call Girls Service at your Door Step Available All Time
Call 7737669865 Vadodara Call Girls Service at your Door Step Available All TimeCall 7737669865 Vadodara Call Girls Service at your Door Step Available All Time
Call 7737669865 Vadodara Call Girls Service at your Door Step Available All Time
 
Lucknow Housewife Escorts by Sexy Bhabhi Service 8250092165
Lucknow Housewife Escorts  by Sexy Bhabhi Service 8250092165Lucknow Housewife Escorts  by Sexy Bhabhi Service 8250092165
Lucknow Housewife Escorts by Sexy Bhabhi Service 8250092165
 
Durg CALL GIRL ❤ 82729*64427❤ CALL GIRLS IN durg ESCORTS
Durg CALL GIRL ❤ 82729*64427❤ CALL GIRLS IN durg ESCORTSDurg CALL GIRL ❤ 82729*64427❤ CALL GIRLS IN durg ESCORTS
Durg CALL GIRL ❤ 82729*64427❤ CALL GIRLS IN durg ESCORTS
 
Falcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investors
 
New 2024 Cannabis Edibles Investor Pitch Deck Template
New 2024 Cannabis Edibles Investor Pitch Deck TemplateNew 2024 Cannabis Edibles Investor Pitch Deck Template
New 2024 Cannabis Edibles Investor Pitch Deck Template
 
HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024
 
Uneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration PresentationUneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration Presentation
 
PARK STREET 💋 Call Girl 9827461493 Call Girls in Escort service book now
PARK STREET 💋 Call Girl 9827461493 Call Girls in  Escort service book nowPARK STREET 💋 Call Girl 9827461493 Call Girls in  Escort service book now
PARK STREET 💋 Call Girl 9827461493 Call Girls in Escort service book now
 
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
 
joint cost.pptx COST ACCOUNTING Sixteenth Edition ...
joint cost.pptx  COST ACCOUNTING  Sixteenth Edition                          ...joint cost.pptx  COST ACCOUNTING  Sixteenth Edition                          ...
joint cost.pptx COST ACCOUNTING Sixteenth Edition ...
 
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
 

Shaping Up With CSS

  • 1. Shaping up with CSS <understanding how true CSS layouts are built /> Advanced CSS Stephen Ireland
  • 2. Understanding Elements • HTML elements • Marked up as <tags /> • Two types of HTML elements Block level elements Inline elements <h1>, <h2>, <h3> etc <span> <p> <strong> <div> <em> <blockquote> <a> <ul> and <ol> Advanced CSS Stephen Ireland
  • 3. Block level Elements • Fundamental differences in use • Identified as normally displayed on its own line • Other elements appear above or below - not either side • Can be used as a container for one or more other elements The rules • A block level element can contain other block-level elements, as well as inline elements. • An inline element cannot contain block-level elements. Advanced CSS Stephen Ireland
  • 4. Block Element Rule The rule x <div> <a href=”#”><h1>My link</h1></a> </div> ✓ <div> <h1><a href=”#”>My link</a></h1> </div> Advanced CSS Stephen Ireland
  • 5. Inline Element Rule The rule It’s okay to nest one inline element inside another; <div> ✓ <h1> <a href=”#”><span>My link</span></a> </h1> </div> Advanced CSS Stephen Ireland
  • 6. Element Symmetry Opening & closing XHTML tags <div> x <h1> <a href=”#”> <span>My link</span> ← </h1> </a> h1 element should not close before a </div> Can be checked using online validators (validator.w3.org) Advanced CSS Stephen Ireland
  • 7. Styling Elements Inline elements • Changing colour (text and background) • Changing font styles (size, typeface, bold, underline, etc.) Block-level elements • Set fixed width or height • Set padding or margin values • Position a block to any location on a web page, regardless of where it appears in the XHTML markup This is why block-level elements are more powerful Advanced CSS Stephen Ireland
  • 8. Sizing Defaults Block-level elements • Will take 100% of available width • Available width could be parent element • Or could be browser window • Takes whatever height it needs Advanced CSS Stephen Ireland
  • 9. Setting Heights & Widths Setting a width This CSS declaration will adjust a paragraph with the class value of ‘highlight’. The paragraph will become 50% the width of its containing element. CSS declaration p.highlight { width: 50%; } Advanced CSS Stephen Ireland
  • 10. Units of Measurement When sizing and positioning elements we can use different units of measurement. Each unit type have their benefits and drawbacks. Although different unit types can be mixed within layouts, problems may occur. Units • Pixels (px) for fixed sizing / positioning • Percentages (%) for sizes relative to containing elements • Ems (em) for sizes relative to base font size • Points (pt) for print based styles Advanced CSS Stephen Ireland
  • 11. Fixed Block-Level Sizing Setting a height as well as a width to a block-level element is just as simple, although be wary of possible consequences. CSS declaration #navigation { background-color: #cccccc; width: 200px; height: 400px; } Advanced CSS Stephen Ireland
  • 12. Browser Behaviour If you set a height that is less than the room needed for the content of the element, that content will overflow. Firefox Internet Explorer Advanced CSS Stephen Ireland
  • 13. Other Occurances If a visitor to your website increases the font-size, text may overflow the containing element of a fixed size. Advanced CSS Stephen Ireland
  • 14. Overflow:Hidden There is a way to stop elements escaping the bounds of their containing element - set the CSS overflow property to ‘hidden’. Bad practice in this situation as text becomes unreadable anyway... #navigation { background-color: #cccccc; width: 200px; height: 300px; overflow: hidden; } Advanced CSS Stephen Ireland
  • 15. Positioning Elements Full CSS layouts • Without intervention from CSS, a web browser will display elements in the order they appear in the source file. • By full CSS layouts, we mean layouts that use CSS entirely for positioning elements in the web browser window. • There are many different ways to create CSS layouts. • Best practice methods often harder to achieve. Advanced CSS Stephen Ireland
  • 16. Full CSS Layouts Conventional layouts • Comprise of • A header • Two or three columns • A footer • Use <div> tags for layout hooks • Use XHTML property ‘id’ to style div elements individually XHTML CSS <div id=”banner”></div> #banner { width: 760px; } Advanced CSS Stephen Ireland
  • 17. Layout Options Debate • Fixed-width • Fluid-width • Semi-fluid (one fixed width column, one fluid width) • Zoom (entire layout relative to font size) • Resolution-dependent (Made possible with Javascript) All types of layouts are dependent on methods of sizing and positioning of the block-level elements. Advanced CSS Stephen Ireland
  • 18. Positioning Block-Level Elements CSS ‘position’ property • Static • Relative #banner { position: absolute; } • Absolute • Fixed CSS ‘float’ property • Left • Right #left-col { float: left; } • None Advanced CSS Stephen Ireland
  • 19. Easiest positioning Method CSS ‘position’ property • Static • Relative ← #banner { position: absolute; } • Absolute • Fixed Its absolute positioning CSS ‘float’ property • Left • Right #left-col { float: left; } • None Advanced CSS Stephen Ireland
  • 20. Position:Absolute Absolute positioning gives you total control where a block-level element appears in the browser window. This declaration positions a div with id of ‘banner’ 10 pixels from the top and left of the browser window. ← #banner { position: absolute; top: 50px; left: 50px; } Advanced CSS Stephen Ireland
  • 21. Top, right, Bottom, Left • Absolute positioning relies on a position being set. • If you don’t provide positions, your elements will overlap one another. • Make sure to set one or two values • In most cases you will work from the top-left corner of the browser window. Therefore, most commonly used properties are ‘top’ and ‘left’. Advanced CSS Stephen Ireland
  • 22. Handy Tips • Before moving on to more complex positioning schema, experiment with the control absolute positioning gives you. • Set background-color on the different main elements, or give each element a border temporarily until you have your layout how you intended. You’ll be able to see where each element starts and ends, without holding a ruler in front of the screen! • Nothing is ever nothing unless specified - most browsers have default margins and paddings which could upset your design. If in doubt - specify them with zero value. Advanced CSS Stephen Ireland