SlideShare a Scribd company logo
1 of 15
Week 02
Box Model, IDs, Classes, Divs
The Box Model

                                                                              padding
<p>Lorem ipsum dolor sit amet, consectetur
adipiscing elit. In ut lacus ac felis auctor egestas ac
                                                                               border
consequat nisi. Donec dapibus congue sapien.
Suspendisse vulputate egestas eros ac egestas.
Suspendisse vitae justo nunc, et consectetur mi.                               margin
Aenean consequat, leo in malesuada faucibus,
eros lorem malesuada ligula, et sagittis velit lorem
nec nisi. Curabitur non enim nibh, posuere
interdum dolor. Cras neque tortor, ornare eu
condimentum non, pellentesque nec risus. In
convallis mi at sapien consequat elementum
blandit nulla porttitor. </p>




                                                          p {
                                                                padding: 15px;
                                                                border: 4px solid #000;
                                                                margin: 20px;
                                                          }
The Box Model


<p>Lorem ipsum dolor sit amet, consectetur
adipiscing elit. In ut lacus ac felis auctor egestas ac
consequat nisi. Donec dapibus congue sapien.
Suspendisse vulputate egestas eros ac egestas.
Suspendisse vitae justo nunc, et consectetur mi.
Aenean consequat, leo in malesuada faucibus,
eros lorem malesuada ligula, et sagittis velit lorem
nec nisi. Curabitur non enim nibh, posuere
interdum dolor. Cras neque tortor, ornare eu
condimentum non, pellentesque nec risus. In
convallis mi at sapien consequat elementum
blandit nulla porttitor. </p>




                                                          p {
                                                                padding-left: 10px;
                                                                padding-right: 50px;
                                                                border: 4px solid black;
                                                                border-top: 5px solid green;
                                                                margin-top: 10px;
                                                                margin-bottom: 10px;
                                                                margin-left: 3px;
                                                                margin-right: 3px
                                                          }
The Box Model


              <p>Lorem ipsum dolor sit amet, consectetur
              adipiscing elit. In ut lacus ac felis auctor egestas ac
              consequat nisi. Donec dapibus congue sapien.
              Suspendisse vulputate egestas eros ac egestas.
              Suspendisse vitae justo nunc, et consectetur mi.
              Aenean consequat, leo in malesuada faucibus,
              eros lorem malesuada ligula, et sagittis velit lorem
              nec nisi. Curabitur non enim nibh, posuere
              interdum dolor. Cras neque tortor, ornare eu
              condimentum non, pellentesque nec risus. In
              convallis mi at sapien consequat elementum
              blandit nulla porttitor. </p>




                                                                                       top right bottom left
p {
      margin-top: 5px;
                                                                        p {
      margin-right: 50px;
                                                                              margin: 5px 50px 0px 5px;
      margin-bottom: 0px;                           OR                  }
      margin-left: 5px;
}
The Box Model


                        Lorem ipsum dolor sit amet, consectetur adipiscing
                        elit. In ut lacus ac felis auctor egestas ac
                        consequat nisi. Donec dapibus congue sapien.
                        Suspendisse vulputate egestas eros ac egestas.
                        Suspendisse vitae justo nunc, et consectetur mi.
                        Aenean consequat, leo in malesuada faucibus,
                        eros lorem malesuada ligula, et sagittis velit lorem
                        nec nisi. Curabitur non enim nibh, posuere
                        interdum dolor. Cras neque tortor, ornare eu
                        condimentum non, pellentesque nec risus. In
                        convallis mi at sapien consequat elementum
                        blandit nulla porttitor.


                                                                                       border-width
                                                                                           border-style
                                                                                                 border-color
p {                                                                    p {
      border-style: dashed;                                                  border: 5px dashed blue;
      border-width: 5px;                       OR                      }
      border-color: blue;
}
CENTERING DIVS USING MARGINS


                           Lorem ipsum dolor sit amet, consectetur adipiscing
                           elit. In ut lacus ac felis auctor egestas ac
                           consequat nisi. Donec dapibus congue sapien.
                           Suspendisse vulputate egestas eros ac egestas.
                           Suspendisse vitae justo nunc, et consectetur mi.
                                                                                         margin
                           Aenean consequat, leo in malesuada faucibus,
                           eros lorem malesuada ligula, et sagittis velit lorem
                           nec nisi. Curabitur non enim nibh, posuere
                           interdum dolor. Cras neque tortor, ornare eu
                           condimentum non, pellentesque nec risus. In
                           convallis mi at sapien consequat elementum
                           blandit nulla porttitor.




                                                                      #box {
<div id="box">                                                           padding: 15px;
      <p>                                                                border: 4px solid #000;
          Lorem ipsum dolor ...                                          width: 250px;
     </p>                                                                height: 250px;
</div>                                                                   margin: 10px auto 10px auto;
                                                                      }
IDs - FOR INDIVIDUAL ELEMENTS
           HTML                       CSS




<p id="apple">Apples.<p>      #apple {
                                     font-size; 12px;
<h1 id="orange">Hello!</h1>   }

                              #orange {
                                     font-size: 20px;
                              }
CLASSES - FOR GROUPS OF ELEMENTS
           HTML                           CSS




<p class="animals">Monkeys.<p>    .animals {
                                         font-size; 12px;
<p class="animals">Lions.<p>      }
<p class="animals">Eagles.<p>     .plants {
                                         font-size: 20px;
<p class="plants">Pine-Tree.<p>   }
IDs & Classes

          HTML                            CSS                             Browser


<body>                         body {
                                          background-color:     This sentence is the introduction
     <p id="intro">            grey;                                   to this paragraph.
                       This    }
     sentence is the                                            Lorem ipsum dolor sit amet, consectetur
     introduction to this      p {                               adipiscing elit. Curabitur eu ante odio.
     paragraphs.                          font-size: 12px;
     </p>                                 color: blue;          Lorem ipsum dolor sit amet, consectetur
                                          text-align: center;              adipiscing elit.
     <p class="main">          }
     Lorem ipsum dolor sit                                                     The End.
     amet, consectetur         #intro {
     adipiscing elit.                     font-size: 14px;
     Curabitur eu ante odio.              color: red;
     </p>                      }

                               .main {
     <p class="main">                     font-size: 10px;
     Lorem ipsum dolor sit                color: black;
     amet, consectetur         }
     adipiscing elit.
     </p>

     <p>The End.</p>

</body>
IDs & Classes

          HTML                            CSS                             Browser


<body>                         body {
                                          background-color:     This sentence is the introduction
     <p id="intro">            grey;                                   to this paragraph.
                       This    }
     sentence is the                                            Lorem ipsum dolor sit amet, consectetur
     introduction to this      p {                               adipiscing elit. Curabitur eu ante odio.
     paragraphs.                          font-size: 12px;
     </p>                                 color: blue;          Lorem ipsum dolor sit amet, consectetur
                                          text-align: center;              adipiscing elit.
     <p class="main">          }
     Lorem ipsum dolor sit                                                     The End.
     amet, consectetur         #intro {
     adipiscing elit.                     font-size: 14px;
     Curabitur eu ante odio.              color: red;
     </p>                      }

                               .main {
     <p class="main">                     font-size: 10px;
     Lorem ipsum dolor sit                color: black;
     amet, consectetur         }
     adipiscing elit.
     </p>

     <p>The End.</p>

</body>
IDs & Classes

          HTML                            CSS                             Browser


<body>                         body {
                                          background-color:     This sentence is the introduction
     <p id="intro">            grey;                                   to this paragraph.
                       This    }
     sentence is the                                            Lorem ipsum dolor sit amet, consectetur
     introduction to this      p {                               adipiscing elit. Curabitur eu ante odio.
     paragraphs.                          font-size: 12px;
     </p>                                 color: blue;          Lorem ipsum dolor sit amet, consectetur
                                          text-align: center;              adipiscing elit.
     <p class="main">          }
     Lorem ipsum dolor sit                                                     The End.
     amet, consectetur         #intro {
     adipiscing elit.                     font-size: 14px;
     Curabitur eu ante odio.              color: red;
     </p>                      }

                               .main {
     <p class="main">                     font-size: 10px;
     Lorem ipsum dolor sit                color: black;
     amet, consectetur         }
     adipiscing elit.
     </p>

     <p>The End.</p>

</body>
IDs & Classes

          HTML                            CSS                             Browser


<body>                         body {
                                          background-color:     This sentence is the introduction
     <p id="intro">            grey;                                   to this paragraph.
                       This    }
     sentence is the                                            Lorem ipsum dolor sit amet, consectetur
     introduction to this      p {                               adipiscing elit. Curabitur eu ante odio.
     paragraphs.                          font-size: 12px;
     </p>                                 color: blue;          Lorem ipsum dolor sit amet, consectetur
                                          text-align: center;              adipiscing elit.
     <p class="main">          }
     Lorem ipsum dolor sit                                                     The End.
     amet, consectetur         #intro {
     adipiscing elit.                     font-size: 14px;
     Curabitur eu ante odio.              color: red;
     </p>                      }

                               .main {
     <p class="main">                     font-size: 10px;
     Lorem ipsum dolor sit                color: black;
     amet, consectetur         }
     adipiscing elit.
     </p>

     <p>The End.</p>

</body>
IDs

          HTML                            CSS                             Browser


<body>                         body {
                                          background-color:     This sentence is the introduction
     <p id="intro">            grey;                                   to this paragraph.
                       This    }
     sentence is the                                            Lorem ipsum dolor sit amet, consectetur
     introduction to this      p {                               adipiscing elit. Curabitur eu ante odio.
     paragraphs.                          font-size: 12px;
     </p>                                 color: blue;          Lorem ipsum dolor sit amet, consectetur
                                          text-align: center;              adipiscing elit.
     <p class="main">          }
     Lorem ipsum dolor sit                                                     The End.
     amet, consectetur         #intro {
     adipiscing elit.                     font-size: 14px;
     Curabitur eu ante odio.              color: red;
     </p>                      }

                               .main {
     <p class="main">                     font-size: 10px;
     Lorem ipsum dolor sit                color: black;
     amet, consectetur         }
     adipiscing elit.
     </p>

     <p>The End.</p>

</body>
DIVs

            HTML                           Browser


<body>

   <div id="box">

     <h1>My First Div</h1>

   </div>

</body>



            CSS                         My First Div
body {
   background-color: #fff;
}

#box {
   height: 250px;
   weight: 250px;
   border: 10px solid #00FF00;
   background-color: blue;
   margin: 50px;
}

h1 {
   margin-top: 125px;
   text-align: center;
   font-size: 36px;
   color: #fff;
}
DIVs

            HTML                         Browser


<body>

   <div id="box">

     <h1>My First Div</h1>

   </div>

</body>



            CSS
body {
                                        My First Div
   background-color: #fff;
}

#box {
   height: 250px;
   weight: 250px;
   border: 10px solid #00FF00;
   background-color: blue;
   margin: 50px;
}

h1 {
   margin-top: 125px;
   text-align: center;
   font-size: 36px;
   color: #fff;
}

More Related Content

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 HubspotMarius 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 ChatGPTExpeed 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 EngineeringsPixeldarts
 
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 HealthThinkNow
 
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.pdfmarketingartwork
 
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 2024Neil 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 2024Albert 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 InsightsKurio // 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 2024Search 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 summarySpeakerHub
 
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 IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit 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 managementMindGenius
 
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...
 

ID01 W2

  • 1. Week 02 Box Model, IDs, Classes, Divs
  • 2. The Box Model padding <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ut lacus ac felis auctor egestas ac border consequat nisi. Donec dapibus congue sapien. Suspendisse vulputate egestas eros ac egestas. Suspendisse vitae justo nunc, et consectetur mi. margin Aenean consequat, leo in malesuada faucibus, eros lorem malesuada ligula, et sagittis velit lorem nec nisi. Curabitur non enim nibh, posuere interdum dolor. Cras neque tortor, ornare eu condimentum non, pellentesque nec risus. In convallis mi at sapien consequat elementum blandit nulla porttitor. </p> p { padding: 15px; border: 4px solid #000; margin: 20px; }
  • 3. The Box Model <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ut lacus ac felis auctor egestas ac consequat nisi. Donec dapibus congue sapien. Suspendisse vulputate egestas eros ac egestas. Suspendisse vitae justo nunc, et consectetur mi. Aenean consequat, leo in malesuada faucibus, eros lorem malesuada ligula, et sagittis velit lorem nec nisi. Curabitur non enim nibh, posuere interdum dolor. Cras neque tortor, ornare eu condimentum non, pellentesque nec risus. In convallis mi at sapien consequat elementum blandit nulla porttitor. </p> p { padding-left: 10px; padding-right: 50px; border: 4px solid black; border-top: 5px solid green; margin-top: 10px; margin-bottom: 10px; margin-left: 3px; margin-right: 3px }
  • 4. The Box Model <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ut lacus ac felis auctor egestas ac consequat nisi. Donec dapibus congue sapien. Suspendisse vulputate egestas eros ac egestas. Suspendisse vitae justo nunc, et consectetur mi. Aenean consequat, leo in malesuada faucibus, eros lorem malesuada ligula, et sagittis velit lorem nec nisi. Curabitur non enim nibh, posuere interdum dolor. Cras neque tortor, ornare eu condimentum non, pellentesque nec risus. In convallis mi at sapien consequat elementum blandit nulla porttitor. </p> top right bottom left p { margin-top: 5px; p { margin-right: 50px; margin: 5px 50px 0px 5px; margin-bottom: 0px; OR } margin-left: 5px; }
  • 5. The Box Model Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ut lacus ac felis auctor egestas ac consequat nisi. Donec dapibus congue sapien. Suspendisse vulputate egestas eros ac egestas. Suspendisse vitae justo nunc, et consectetur mi. Aenean consequat, leo in malesuada faucibus, eros lorem malesuada ligula, et sagittis velit lorem nec nisi. Curabitur non enim nibh, posuere interdum dolor. Cras neque tortor, ornare eu condimentum non, pellentesque nec risus. In convallis mi at sapien consequat elementum blandit nulla porttitor. border-width border-style border-color p { p { border-style: dashed; border: 5px dashed blue; border-width: 5px; OR } border-color: blue; }
  • 6. CENTERING DIVS USING MARGINS Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ut lacus ac felis auctor egestas ac consequat nisi. Donec dapibus congue sapien. Suspendisse vulputate egestas eros ac egestas. Suspendisse vitae justo nunc, et consectetur mi. margin Aenean consequat, leo in malesuada faucibus, eros lorem malesuada ligula, et sagittis velit lorem nec nisi. Curabitur non enim nibh, posuere interdum dolor. Cras neque tortor, ornare eu condimentum non, pellentesque nec risus. In convallis mi at sapien consequat elementum blandit nulla porttitor. #box { <div id="box"> padding: 15px; <p> border: 4px solid #000; Lorem ipsum dolor ... width: 250px; </p> height: 250px; </div> margin: 10px auto 10px auto; }
  • 7. IDs - FOR INDIVIDUAL ELEMENTS HTML CSS <p id="apple">Apples.<p> #apple { font-size; 12px; <h1 id="orange">Hello!</h1> } #orange { font-size: 20px; }
  • 8. CLASSES - FOR GROUPS OF ELEMENTS HTML CSS <p class="animals">Monkeys.<p> .animals { font-size; 12px; <p class="animals">Lions.<p> } <p class="animals">Eagles.<p> .plants { font-size: 20px; <p class="plants">Pine-Tree.<p> }
  • 9. IDs & Classes HTML CSS Browser <body> body { background-color: This sentence is the introduction <p id="intro"> grey; to this paragraph. This } sentence is the Lorem ipsum dolor sit amet, consectetur introduction to this p { adipiscing elit. Curabitur eu ante odio. paragraphs. font-size: 12px; </p> color: blue; Lorem ipsum dolor sit amet, consectetur text-align: center; adipiscing elit. <p class="main"> } Lorem ipsum dolor sit The End. amet, consectetur #intro { adipiscing elit. font-size: 14px; Curabitur eu ante odio. color: red; </p> } .main { <p class="main"> font-size: 10px; Lorem ipsum dolor sit color: black; amet, consectetur } adipiscing elit. </p> <p>The End.</p> </body>
  • 10. IDs & Classes HTML CSS Browser <body> body { background-color: This sentence is the introduction <p id="intro"> grey; to this paragraph. This } sentence is the Lorem ipsum dolor sit amet, consectetur introduction to this p { adipiscing elit. Curabitur eu ante odio. paragraphs. font-size: 12px; </p> color: blue; Lorem ipsum dolor sit amet, consectetur text-align: center; adipiscing elit. <p class="main"> } Lorem ipsum dolor sit The End. amet, consectetur #intro { adipiscing elit. font-size: 14px; Curabitur eu ante odio. color: red; </p> } .main { <p class="main"> font-size: 10px; Lorem ipsum dolor sit color: black; amet, consectetur } adipiscing elit. </p> <p>The End.</p> </body>
  • 11. IDs & Classes HTML CSS Browser <body> body { background-color: This sentence is the introduction <p id="intro"> grey; to this paragraph. This } sentence is the Lorem ipsum dolor sit amet, consectetur introduction to this p { adipiscing elit. Curabitur eu ante odio. paragraphs. font-size: 12px; </p> color: blue; Lorem ipsum dolor sit amet, consectetur text-align: center; adipiscing elit. <p class="main"> } Lorem ipsum dolor sit The End. amet, consectetur #intro { adipiscing elit. font-size: 14px; Curabitur eu ante odio. color: red; </p> } .main { <p class="main"> font-size: 10px; Lorem ipsum dolor sit color: black; amet, consectetur } adipiscing elit. </p> <p>The End.</p> </body>
  • 12. IDs & Classes HTML CSS Browser <body> body { background-color: This sentence is the introduction <p id="intro"> grey; to this paragraph. This } sentence is the Lorem ipsum dolor sit amet, consectetur introduction to this p { adipiscing elit. Curabitur eu ante odio. paragraphs. font-size: 12px; </p> color: blue; Lorem ipsum dolor sit amet, consectetur text-align: center; adipiscing elit. <p class="main"> } Lorem ipsum dolor sit The End. amet, consectetur #intro { adipiscing elit. font-size: 14px; Curabitur eu ante odio. color: red; </p> } .main { <p class="main"> font-size: 10px; Lorem ipsum dolor sit color: black; amet, consectetur } adipiscing elit. </p> <p>The End.</p> </body>
  • 13. IDs HTML CSS Browser <body> body { background-color: This sentence is the introduction <p id="intro"> grey; to this paragraph. This } sentence is the Lorem ipsum dolor sit amet, consectetur introduction to this p { adipiscing elit. Curabitur eu ante odio. paragraphs. font-size: 12px; </p> color: blue; Lorem ipsum dolor sit amet, consectetur text-align: center; adipiscing elit. <p class="main"> } Lorem ipsum dolor sit The End. amet, consectetur #intro { adipiscing elit. font-size: 14px; Curabitur eu ante odio. color: red; </p> } .main { <p class="main"> font-size: 10px; Lorem ipsum dolor sit color: black; amet, consectetur } adipiscing elit. </p> <p>The End.</p> </body>
  • 14. DIVs HTML Browser <body> <div id="box"> <h1>My First Div</h1> </div> </body> CSS My First Div body { background-color: #fff; } #box { height: 250px; weight: 250px; border: 10px solid #00FF00; background-color: blue; margin: 50px; } h1 { margin-top: 125px; text-align: center; font-size: 36px; color: #fff; }
  • 15. DIVs HTML Browser <body> <div id="box"> <h1>My First Div</h1> </div> </body> CSS body { My First Div background-color: #fff; } #box { height: 250px; weight: 250px; border: 10px solid #00FF00; background-color: blue; margin: 50px; } h1 { margin-top: 125px; text-align: center; font-size: 36px; color: #fff; }

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n