SlideShare a Scribd company logo
PAGE DESIGN CSS

Tuesday, April 16, 13
The Web is made of


           boxes



Tuesday, April 16, 13
Boxes inside of boxes
Tuesday, April 16, 13
Boxes inside of boxes
Tuesday, April 16, 13
Boxes inside of boxes
Tuesday, April 16, 13
Boxes inside of boxes
Tuesday, April 16, 13
What do we already know about boxes?




Tuesday, April 16, 13
(Block-level elements are boxes)




Tuesday, April 16, 13
Headers (h1 - h6)




Tuesday, April 16, 13
Paragraphs




Tuesday, April 16, 13
List items




Tuesday, April 16, 13
Any observations about boxes?




Tuesday, April 16, 13
Boxes take up space
              By default they
                   • inherit their width
                   • inherit their height
                   • inherit their padding
                   • inherit their margin
                   • have no borders, but can




Tuesday, April 16, 13
Boxes take up space
              By default they
                   • inherit their width
                   • inherit their height
                   • inherit their padding
                   • inherit their margin
                   • have no borders, but can




Tuesday, April 16, 13
Boxes take up space
              By default they
                   • inherit their width
                   • inherit their height
                   • inherit their padding
                   • inherit their margin
                   • have no borders, but can




Tuesday, April 16, 13
Boxes take up space
              By default they
                   • inherit their width
                   • inherit their height
                   • inherit their padding
                   • inherit their margin
                   • have no borders, but can




Tuesday, April 16, 13
Boxes take up space
              By default they
                   • inherit their width
                   • inherit their height
                   • inherit their padding
                   • inherit their margin
                   • have no borders, but can




Tuesday, April 16, 13
Terminology
                                         ome m at h!)
                                (and s




                        boxes.html
Tuesday, April 16, 13
300px




                        p{
                             width: 300px;
                         }




               Width
Tuesday, April 16, 13
310px

                                       300px



                        5px                                5px

                         p{
                              width: 300px;
                              border: 5px solid #000000;
                          }




               Border
Tuesday, April 16, 13
300px
                         5px                                           5px
                               25                                 25




                                                  360px
                                    p{
                                         width: 300px;
                                         border: 5px solid #000000;
                                         padding: 25px;
                                     }



               Padding
Tuesday, April 16, 13
padding: 25px;


                             padding: 25px 25px 25px 25px;

                25      25
                             padding-top: 25px;
                             padding-right: 25px;
                             padding-bottom: 25px;
                             padding-left: 25px;




Tuesday, April 16, 13
300px
                         5px                                    5px
                        25                                            25
                        25




                                            360px
                             p{
                                   width: 300px;
                                   border: 5px solid #000000;
                                   margin: 25px;
                               }



               Margin
Tuesday, April 16, 13
25                        25   25                    25




                             360px                     360px

                        margin: 25px;             padding: 25px;




                          Margin                  Padding
Tuesday, April 16, 13
300px
                          5px                                         5px

                                    25                           25

                                         25




                                                360px
                                                410px

                            p{
                                    width: 300px;
                                    border: 5px solid #000000;
                                    margin: 25px;
                                    padding: 25px;
                                }



               Margin + Padding
Tuesday, April 16, 13
300px                     300px                      300px

     25                                 25   25                    225                     2
                                                                         2




                              360px                     360px                      360px

                                                                                   410px



                                                                             padding: 25px;
                        margin: 25px;             padding: 25px;
                                                                             margin: 25px;




               Compare padding & margin
Tuesday, April 16, 13
Margin + Border + Padding + (content) Width




                                                        content
                                           This is my 300px paragraph. It has
                                           20x of padding, 50px of margin and
                                 padding
                                 border




                                                                                          border
                        margin




                                                                                                   margin
                                                                                         padding
                                           a 10px border.



                                                50 + 10 + 20 + 300 + 20 + 10 + 50
                                                                =
                                                              460px
Tuesday, April 16, 13
boxes1-1.html
Tuesday, April 16, 13
Tuesday, April 16, 13
400px




Tuesday, April 16, 13
h1, h2, p, blockquote{
                             width: 400px;
                             background-color: #cccccc;
                        }	





Tuesday, April 16, 13
Tuesday, April 16, 13
h2{
                              margin-top: 0;
                              margin-bottom: 5px;
                              margin-left: 0;
                              margin-right: 0;

                              padding: 0;
                        }
                        	

                        	

                        .date, .byline{
                        	

   margin: 0;
                              	

                              padding: 0;
                        }




Tuesday, April 16, 13
5px
                                10px
                          5px   10px




Tuesday, April 16, 13
blockquote{
                             margin-left: 10px;
                             padding-left: 5px;
                             border-left: 5px solid #000000;
                             padding-top: 10px;
                             padding-bottom: 10px;
                        }




Tuesday, April 16, 13
Tuesday, April 16, 13
400px




                                       400px
                        10       5


                             5




Tuesday, April 16, 13
blockquote{
                             margin-left: 10px;
                             padding-left: 5px;
                             border-left: 5px solid #000000;
                             padding-top: 10px;
                             padding-bottom: 10px;
                             width: 380px;
                        }




Tuesday, April 16, 13
blockquote{
                             margin-left: 10px;
                             padding-left: 5px;
                             border-left: 5px solid #000000;
                             padding-top: 10px;
                             padding-bottom: 10px;
                             width: 380px;
                        }

                        blockquote:first-letter{
                             font-size: 1.9em;
                        }




Tuesday, April 16, 13
boxes2-1.html
Tuesday, April 16, 13
Tuesday, April 16, 13
header




                  content




                   footer




Tuesday, April 16, 13
header
                             #nav




                   article




                   footer

                                    wrapper




Tuesday, April 16, 13
<body>                            header
                                                       #nav
          <div id=”wrapper”>
            <header>
              <h1>North Gate</h1>
              <div id=”nav”> UL ...</div>
            </header>                     article


                  <article> .... </article>

                  <footer>...</footer>
                                              footer

          </div>                                              wrapper
        </body>




Tuesday, April 16, 13
#wrapper{
              width: 700px;
              background-color: #ffffff;
              margin: 10px auto 30px auto;
           }




Tuesday, April 16, 13
Sometimes you want a box to
                               not be a box




Tuesday, April 16, 13
What if LI could be inline?

Tuesday, April 16, 13
What if LI could be inline?

Tuesday, April 16, 13
#nav ul, #nav li {
                   margin: 0;
                   padding: 0;
                   list-style: none;
               }

               #nav ul {
                   background-color: #000000;
                   margin-top: 10px;
                   margin-bottom: 10px;
               }

               #nav li {
                   display: inline;
                   color: #FFF;
                   padding-left: 10px;
                   line-height: 25px;
               }


Tuesday, April 16, 13
Designing on a Grid



Tuesday, April 16, 13
Building On A Grid




Tuesday, April 16, 13
Tuesday, April 16, 13
Tuesday, April 16, 13
Tuesday, April 16, 13
Margin + Border + Padding + (content) Width


Tuesday, April 16, 13
Tuesday, April 16, 13
Tuesday, April 16, 13
<body>
      <div id=”wrapper”>
        <div id=”header”>
           <h1>North Gate</h1>
           <div id=”nav”> UL ...</div>
        </div>

              <div id=”content”> .... </div>

              <div id=”sidebar”> .... </div>

        <div id=”footer”>...</div>
      </div>
    </body>




Tuesday, April 16, 13
<body>
      <div id=”wrapper”>
        <div id=”header”>
           <h1>North Gate</h1>
           <div id=”nav”> UL ...</div>
        </div>

              <div id=”content”> .... </div>

              <div id=”sidebar”> .... </div>

        <div id=”footer”>...</div>
      </div>
    </body>




Tuesday, April 16, 13
<body>
      <div id=”wrapper”>
        <div id=”header”>
           <h1>North Gate</h1>
           <div id=”nav”> UL ...</div>
        </div>

              <div id=”content”> .... </div>

              <div id=”sidebar”> .... </div>

              <div id=”footer”>...</div>

      </div>
    </body>




Tuesday, April 16, 13
<body>
      <div id=”wrapper”>
        <div id=”header”>
           <h1>North Gate</h1>
           <div id=”nav”> UL ...</div>
        </div>

              <div id=”content”>
                <div id=”article-inline”>
                   <h3>MacArthur</h3>
                 </div>
                <p>lorem</p>
              </div>

              <div id=”sidebar”> .... </div>




Tuesday, April 16, 13
<body>
      <div id=”wrapper”>
        <div id=”header”>
           <h1>North Gate</h1>
           <div id=”nav”> UL ...</div>
        </div>

              <div id=”content”> .... </div>

              <div id=”sidebar”> .... </div>

              <div id=”footer”>...</div>

      </div>
    </body>




Tuesday, April 16, 13
How wide?




Tuesday, April 16, 13
How wide?




Tuesday, April 16, 13
How wide?




Tuesday, April 16, 13
How wide?




Tuesday, April 16, 13
No Consistency
Tuesday, April 16, 13
No Consistency
Tuesday, April 16, 13
Consistency
Tuesday, April 16, 13
How wide?




Tuesday, April 16, 13
BTW, is that margin


   on the #content?

   on the #sidebar?

   on both?




Tuesday, April 16, 13
BTW, is that margin or padding


   on the #content?

   on the #sidebar?

   on both?




Tuesday, April 16, 13
I propose a tradeoff



Tuesday, April 16, 13
Let me take away a little of your flexibility
              and I’ll answer a lot of those questions.



Tuesday, April 16, 13
Tuesday, April 16, 13
                        GRID
Tuesday, April 16, 13
940px
                         620px                          300px


                  10px                                    10px

                                                 20px




                                         220px
Tuesday, April 16, 13
Tuesday, April 16, 13
Tuesday, April 16, 13
Tuesday, April 16, 13
Tuesday, April 16, 13
Tuesday, April 16, 13
Tuesday, April 16, 13
Tuesday, April 16, 13
Tuesday, April 16, 13
Tuesday, April 16, 13
Tuesday, April 16, 13
Tuesday, April 16, 13
Tuesday, April 16, 13
How it works



Tuesday, April 16, 13
940px




Tuesday, April 16, 13
940? 960?



Tuesday, April 16, 13
width=940px
                        margin-left: 10px
                        margin-right: 10px


                        940 + 10 + 10 = 960



Tuesday, April 16, 13
940px


                        10           10




Tuesday, April 16, 13
12 column layout




                        60px         20px




Tuesday, April 16, 13
5 columns                                               7 columns

                                    380px                                                   540px
            60          20   60    20   60   20   60   20   60   60   20   60   20   60    20   60   20   60   20   60   20   60




Tuesday, April 16, 13
5 columns                                               7 columns
                                                                                5 columns                           2 col
                                    380px
            60          20   60    20   60   20   60   20   60
                                                                                     380px                          140px
                                                                 60   20   60   20   60    20   60   20   60   60     20    60




                                                                                                 540px



Tuesday, April 16, 13
5 columns

                                       380px




                        Your boxes must go to the lines, not the gutters

Tuesday, April 16, 13
Many Grids to Choose From



Tuesday, April 16, 13
Tuesday, April 16, 13
Tuesday, April 16, 13
cascade is the “C” in




                           CSS
Tuesday, April 16, 13
Tuesday, April 16, 13
body {
                          background-color: #ffffff;
                        }



Tuesday, April 16, 13
unless told otherwise, a child element inherits
                        applicable rules from its parents




Tuesday, April 16, 13
body{
          	 background-color: #ffffff;
          }


Tuesday, April 16, 13
<body>
                          <p>Because this paragraph is inside the body tag (like all page elements) it inherits the
                          text properties of the body. </p>
                        </body>




Tuesday, April 16, 13
But what about the other element
           backgrounds that aren’t white?

Tuesday, April 16, 13
#header{                       #nav{
          	 background-color: #F3F5F9;   	 background-color: #CBD7E7;
          }                              }

Tuesday, April 16, 13
Now add a link and see what happens




Tuesday, April 16, 13
body {
                          color: #FF0000;
                          font-size: 15px;
                        }

                        p{
                             font-size: 10px;
                        }

                        a{
                             color: #0000FF;
                        }




Tuesday, April 16, 13
specific
                             ity
Tuesday, April 16, 13
p{
                             color: #FF0000;
                             background-color: #000000;
                        }




                        Unless a more specific rule applies to a
                        paragraph, this “type” selector defines how all
                        paragraphs in your document will look.




Tuesday, April 16, 13
.alert {
                               color: #00FF00;
                               background-color: #0000FF;
                           }




                        <p class=“alert”>
                          This is a paragraph with the “alert” class rules applied to it.
                          Where its rules conflict with a less specific “type” selector, the
                          class selector takes precedence.
                        </p>




Tuesday, April 16, 13
selectors2.html




Tuesday, April 16, 13
CSS Selectors have weight

                          High Value                         Low Value              Tie Breaker




                              ID       |    Class |   Type               Position


                           (#nav)             (.byline)            (p)



                        SELECTOR CONFLICTS
                        CSS SELECTORS

Tuesday, April 16, 13

More Related Content

Recently uploaded

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 

Recently uploaded (20)

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

CSS Page Design

  • 2. The Web is made of boxes Tuesday, April 16, 13
  • 3. Boxes inside of boxes Tuesday, April 16, 13
  • 4. Boxes inside of boxes Tuesday, April 16, 13
  • 5. Boxes inside of boxes Tuesday, April 16, 13
  • 6. Boxes inside of boxes Tuesday, April 16, 13
  • 7. What do we already know about boxes? Tuesday, April 16, 13
  • 8. (Block-level elements are boxes) Tuesday, April 16, 13
  • 9. Headers (h1 - h6) Tuesday, April 16, 13
  • 12. Any observations about boxes? Tuesday, April 16, 13
  • 13. Boxes take up space By default they • inherit their width • inherit their height • inherit their padding • inherit their margin • have no borders, but can Tuesday, April 16, 13
  • 14. Boxes take up space By default they • inherit their width • inherit their height • inherit their padding • inherit their margin • have no borders, but can Tuesday, April 16, 13
  • 15. Boxes take up space By default they • inherit their width • inherit their height • inherit their padding • inherit their margin • have no borders, but can Tuesday, April 16, 13
  • 16. Boxes take up space By default they • inherit their width • inherit their height • inherit their padding • inherit their margin • have no borders, but can Tuesday, April 16, 13
  • 17. Boxes take up space By default they • inherit their width • inherit their height • inherit their padding • inherit their margin • have no borders, but can Tuesday, April 16, 13
  • 18. Terminology ome m at h!) (and s boxes.html Tuesday, April 16, 13
  • 19. 300px p{ width: 300px; } Width Tuesday, April 16, 13
  • 20. 310px 300px 5px 5px p{ width: 300px; border: 5px solid #000000; } Border Tuesday, April 16, 13
  • 21. 300px 5px 5px 25 25 360px p{ width: 300px; border: 5px solid #000000; padding: 25px; } Padding Tuesday, April 16, 13
  • 22. padding: 25px; padding: 25px 25px 25px 25px; 25 25 padding-top: 25px; padding-right: 25px; padding-bottom: 25px; padding-left: 25px; Tuesday, April 16, 13
  • 23. 300px 5px 5px 25 25 25 360px p{ width: 300px; border: 5px solid #000000; margin: 25px; } Margin Tuesday, April 16, 13
  • 24. 25 25 25 25 360px 360px margin: 25px; padding: 25px; Margin Padding Tuesday, April 16, 13
  • 25. 300px 5px 5px 25 25 25 360px 410px p{ width: 300px; border: 5px solid #000000; margin: 25px; padding: 25px; } Margin + Padding Tuesday, April 16, 13
  • 26. 300px 300px 300px 25 25 25 225 2 2 360px 360px 360px 410px padding: 25px; margin: 25px; padding: 25px; margin: 25px; Compare padding & margin Tuesday, April 16, 13
  • 27. Margin + Border + Padding + (content) Width content This is my 300px paragraph. It has 20x of padding, 50px of margin and padding border border margin margin padding a 10px border. 50 + 10 + 20 + 300 + 20 + 10 + 50 = 460px Tuesday, April 16, 13
  • 31. h1, h2, p, blockquote{ width: 400px; background-color: #cccccc; } Tuesday, April 16, 13
  • 33. h2{ margin-top: 0; margin-bottom: 5px; margin-left: 0; margin-right: 0; padding: 0; } .date, .byline{ margin: 0; padding: 0; } Tuesday, April 16, 13
  • 34. 5px 10px 5px 10px Tuesday, April 16, 13
  • 35. blockquote{ margin-left: 10px; padding-left: 5px; border-left: 5px solid #000000; padding-top: 10px; padding-bottom: 10px; } Tuesday, April 16, 13
  • 37. 400px 400px 10 5 5 Tuesday, April 16, 13
  • 38. blockquote{ margin-left: 10px; padding-left: 5px; border-left: 5px solid #000000; padding-top: 10px; padding-bottom: 10px; width: 380px; } Tuesday, April 16, 13
  • 39. blockquote{ margin-left: 10px; padding-left: 5px; border-left: 5px solid #000000; padding-top: 10px; padding-bottom: 10px; width: 380px; } blockquote:first-letter{ font-size: 1.9em; } Tuesday, April 16, 13
  • 42. header content footer Tuesday, April 16, 13
  • 43. header #nav article footer wrapper Tuesday, April 16, 13
  • 44. <body> header #nav <div id=”wrapper”> <header> <h1>North Gate</h1> <div id=”nav”> UL ...</div> </header> article <article> .... </article> <footer>...</footer> footer </div> wrapper </body> Tuesday, April 16, 13
  • 45. #wrapper{ width: 700px; background-color: #ffffff; margin: 10px auto 30px auto; } Tuesday, April 16, 13
  • 46. Sometimes you want a box to not be a box Tuesday, April 16, 13
  • 47. What if LI could be inline? Tuesday, April 16, 13
  • 48. What if LI could be inline? Tuesday, April 16, 13
  • 49. #nav ul, #nav li { margin: 0; padding: 0; list-style: none; } #nav ul { background-color: #000000; margin-top: 10px; margin-bottom: 10px; } #nav li { display: inline; color: #FFF; padding-left: 10px; line-height: 25px; } Tuesday, April 16, 13
  • 50. Designing on a Grid Tuesday, April 16, 13
  • 51. Building On A Grid Tuesday, April 16, 13
  • 55. Margin + Border + Padding + (content) Width Tuesday, April 16, 13
  • 58. <body> <div id=”wrapper”> <div id=”header”> <h1>North Gate</h1> <div id=”nav”> UL ...</div> </div> <div id=”content”> .... </div> <div id=”sidebar”> .... </div> <div id=”footer”>...</div> </div> </body> Tuesday, April 16, 13
  • 59. <body> <div id=”wrapper”> <div id=”header”> <h1>North Gate</h1> <div id=”nav”> UL ...</div> </div> <div id=”content”> .... </div> <div id=”sidebar”> .... </div> <div id=”footer”>...</div> </div> </body> Tuesday, April 16, 13
  • 60. <body> <div id=”wrapper”> <div id=”header”> <h1>North Gate</h1> <div id=”nav”> UL ...</div> </div> <div id=”content”> .... </div> <div id=”sidebar”> .... </div> <div id=”footer”>...</div> </div> </body> Tuesday, April 16, 13
  • 61. <body> <div id=”wrapper”> <div id=”header”> <h1>North Gate</h1> <div id=”nav”> UL ...</div> </div> <div id=”content”> <div id=”article-inline”> <h3>MacArthur</h3> </div> <p>lorem</p> </div> <div id=”sidebar”> .... </div> Tuesday, April 16, 13
  • 62. <body> <div id=”wrapper”> <div id=”header”> <h1>North Gate</h1> <div id=”nav”> UL ...</div> </div> <div id=”content”> .... </div> <div id=”sidebar”> .... </div> <div id=”footer”>...</div> </div> </body> Tuesday, April 16, 13
  • 71. BTW, is that margin on the #content? on the #sidebar? on both? Tuesday, April 16, 13
  • 72. BTW, is that margin or padding on the #content? on the #sidebar? on both? Tuesday, April 16, 13
  • 73. I propose a tradeoff Tuesday, April 16, 13
  • 74. Let me take away a little of your flexibility and I’ll answer a lot of those questions. Tuesday, April 16, 13
  • 77. 940px 620px 300px 10px 10px 20px 220px Tuesday, April 16, 13
  • 90. How it works Tuesday, April 16, 13
  • 93. width=940px margin-left: 10px margin-right: 10px 940 + 10 + 10 = 960 Tuesday, April 16, 13
  • 94. 940px 10 10 Tuesday, April 16, 13
  • 95. 12 column layout 60px 20px Tuesday, April 16, 13
  • 96. 5 columns 7 columns 380px 540px 60 20 60 20 60 20 60 20 60 60 20 60 20 60 20 60 20 60 20 60 20 60 Tuesday, April 16, 13
  • 97. 5 columns 7 columns 5 columns 2 col 380px 60 20 60 20 60 20 60 20 60 380px 140px 60 20 60 20 60 20 60 20 60 60 20 60 540px Tuesday, April 16, 13
  • 98. 5 columns 380px Your boxes must go to the lines, not the gutters Tuesday, April 16, 13
  • 99. Many Grids to Choose From Tuesday, April 16, 13
  • 102. cascade is the “C” in CSS Tuesday, April 16, 13
  • 104. body { background-color: #ffffff; } Tuesday, April 16, 13
  • 105. unless told otherwise, a child element inherits applicable rules from its parents Tuesday, April 16, 13
  • 106. body{ background-color: #ffffff; } Tuesday, April 16, 13
  • 107. <body> <p>Because this paragraph is inside the body tag (like all page elements) it inherits the text properties of the body. </p> </body> Tuesday, April 16, 13
  • 108. But what about the other element backgrounds that aren’t white? Tuesday, April 16, 13
  • 109. #header{ #nav{ background-color: #F3F5F9; background-color: #CBD7E7; } } Tuesday, April 16, 13
  • 110. Now add a link and see what happens Tuesday, April 16, 13
  • 111. body { color: #FF0000; font-size: 15px; } p{ font-size: 10px; } a{ color: #0000FF; } Tuesday, April 16, 13
  • 112. specific ity Tuesday, April 16, 13
  • 113. p{ color: #FF0000; background-color: #000000; } Unless a more specific rule applies to a paragraph, this “type” selector defines how all paragraphs in your document will look. Tuesday, April 16, 13
  • 114. .alert { color: #00FF00; background-color: #0000FF; } <p class=“alert”> This is a paragraph with the “alert” class rules applied to it. Where its rules conflict with a less specific “type” selector, the class selector takes precedence. </p> Tuesday, April 16, 13
  • 116. CSS Selectors have weight High Value Low Value Tie Breaker ID | Class | Type Position (#nav) (.byline) (p) SELECTOR CONFLICTS CSS SELECTORS Tuesday, April 16, 13