Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
- Course Overview 1:49
- Attribute Selectors 8:44
- Styling Form Buttons and Links with Attribute Selectors 3:34
- Attribute Selectors Challenge 3 objectives
- DRY CSS 10:51
- Child, Adjacent, and General Sibling Combinators 9:03
- Combinators Challenge 2 objectives
- Attribute Selectors and Combinators Review 5 questions

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
DRY stands for "Don’t Repeat Yourself." The main idea with DRY in CSS is to avoid repeating the same bits of code in our style sheet. In this video, we'll take a look at a few examples of writing DRY'er CSS.
Related Videos
DRY Example
CSS:
.btn {
cursor: pointer;
color: #fff;
padding-left: 20px;
padding-right: 20px;
}
.default-theme {
background-color: coral;
}
HTML:
<input class="btn default-theme" type="submit" value="submit">
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Peter Huang
5,427 Points1 Answer
-
Kim B
4,991 Points1 Answer
-
Ashley Ferenchak
8,066 Points1 Answer
-
nicolaspeterson
8,569 Points2 Answers
-
Ubo Town
3,227 Points2 Answers
-
Gerald Susanteo
Front End Web Development Techdegree Student 7,117 Points1 Answer
-
Scott Bailey
13,190 PointsSelector Problem - Using previous video with this one
Posted by Scott BaileyScott Bailey
13,190 Points1 Answer
-
PLUS
kami
Courses Plus Student 6,825 Points2 Answers
-
Tobias Graefe
11,934 Points1 Answer
-
Lasse Pedersen
10,416 Points1 Answer
-
maya sophie
5,754 PointsThe 'submit' and 'reset' buttons are not displayed inline when 769 px or more
Posted by maya sophiemaya sophie
5,754 Points5 Answers
-
Nicholas Wallen
12,278 Points1 Answer
-
babasariffodeen
6,475 Points1 Answer
-
babasariffodeen
6,475 Points1 Answer
-
Aakash Srivastav
Full Stack JavaScript Techdegree Student 11,638 Points2 Answers
-
Jeff T
9,672 PointsNormalize.css
Posted by Jeff TJeff T
9,672 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up