software-development-lessons

CSS

This lesson goes over CSS: why and how we use it

Slides

Topics

Story

CSS (Cascading Style Sheets)

CSS Syntax

h1 {
  color: maroon;
  font-weight: 700;
}

Selectors

h1 {
  color: maroon;
  font-weight: 700;
}
 
ul {
  list-style-type: none;
  padding-left: none;
}
.company-name {
  color: maroon;
  font-weight: 700;
}
 
.unstyled-list {
  list-style-type: none;
  padding-left: 0;
}
	
<h1 class="company-name">Our Awesome Company</h1>
 
<ul class="unstyled-list">
  <li>Our Work</li>
  <li>About Us</li>
  <li>Give Support</li>
</ul>

Multiple classes

.medium-border {
  border-bottom: 5px grey solid;
}
 
.big-padding {
  padding: 100px;
}
<div class="medium-border big-padding">
  <h1 class="company-name">Our Awesome Company</h1>
 
  <ul class="unstyled-list">
    <li>Our Work</li>
    <li>About Us</li>
    <li>Give Support</li>
  </ul>
</div>
.medium-border {
  border-bottom: 5px grey solid;
}
 
.big-padding {
  padding: 200px;
}
<div class="medium-border">
  « Homepage
</div>
 
<p class="big-padding">
  Our mission is to...
</p>

CSS Fundamentals Practice

CSS Fundamentals workspace in Replit

External style sheets

<p style="padding: 100px;">Our mission is to...</p>
<link rel="stylesheet" href="/my_styles.css">

External style sheets workspace in Replit

Resources

Next Up

Asking Questions