Learn CSS Colors by Building a Set of Colored Markers, Free CSS Beginners Course freeCodeCamp 2023

Channel:
Subscribers:
7,760
Published on ● Video Link: https://www.youtube.com/watch?v=Tl_vQKOvzWo



Duration: 34:27
169 views
3


Learn CSS Colors by Building a Set of Colored Markers, Free CSS Beginners Course freeCodeCamp 2023. In this lesson, we go over the freeCodeCamp course "Learn CSS Colors by Building a Set of Colored Markers. This lesson continues us on our way to learning web development from scratch. This is from the course "Responsive Web Design"

The steps we go through are:

Step 1: Add a DOCTYPE html declaration at the top of the document, and an html element after that. Give the html element a lang attribute with en as its value.

Step 2: Nest a head element within the html element. Just after the head element, add a body element.

Step 3: Within the head element, nest a title element with the text Colored Markers.

Step 4: Inside the head element, nest a meta element with the attribute charset set to utf-8. Remember that meta elements are self-closing, and do not need a closing tag.

Step 5: Add another self-closing meta element within the head. Give it a name attribute set to viewport and a content attribute set to width=device-width, initial-scale=1.0 so your page looks the same on all devices.

Step 6: Within the body, nest an h1 element with the text CSS Color Markers.

Step 7: Nest a link element within the head. Give it a rel attribute set to stylesheet and an href attribute set to styles.css.

Step 8: Create a new CSS rule that targets the h1 element, and set its text-align property to center.

Step 9: Within the body, add a div element and set its class attribute to container. Make sure the div element is below the h1 element.

Step 10: Next, within the div, add another div element and give it a class of marker.

Step 11: Create a new CSS rule that targets the class marker, and set its background-color property to red.

Step 12: In your .marker CSS rule, set the width property to 200px and the height property to 25px.

Step 13: The margin shorthand property makes it easy to set multiple margin areas at the same time. To center your marker on the page, set its margin property to auto. This sets margin-top, margin-right, margin-bottom, and margin-left all to auto.

Step 14: In the container div, add two more div elements and give them each a class of marker.

Step 15: When the shorthand margin property has two values, it sets margin-top and margin-bottom to the first value, and margin-left and margin-right to the second value. In your .marker CSS rule, set the margin property to 10px auto.

Step 16: To begin, add the class one to the first marker div element.

Step 17: Next, remove the background-color property and its value from the .marker CSS rule.

Step 18: Then, create a new CSS rule that targets the class one and set its background-color property to red.

Step 19: Add the class two to the second marker div, and the class three to the third marker div.

Step 20: Also, create a separate CSS rule that targets the class three and set its background-color to blue.

Step 21: RGB Colors begin as black, and change as different levels of red, green, and blue are introduced. An easy way to see this is with the CSS rgb function. Create a new CSS rule that targets the class container and set its background-color to black with rgb(0, 0, 0).

Step 22: In the .one CSS rule, replace the color keyword red with the rgb function. For the rgb function, set the value for red to 255, the value for green to 0, and the value for blue to 0.

Step 23: In the .two CSS rule, use the rgb function to set the background-color to the max value for green, and 0 for the other values. And in the .three CSS rule, use the rgb function to set the background-color to the max value for blue, and 0 for the other values.

Step 24: In the .two CSS rule, set the green value in the rgb function to 127 to lower its intensity.

Step 25: In the .container CSS rule, use the shorthand padding property to add 10px of top and bottom padding, and set the left and right padding to 0. This works similarly to the shorthand margin property you used earlier.

Step 26: Before you combine colors, set your green marker back to pure green. For the rgb function in the .two CSS rule, set green back to the max value of 255.

Step 27: For the rgb function in the .container rule, set the red, green, and blue values to the max of 255.

Step 28: To create the first secondary color, yellow, update the rgb function in the .one CSS rule to combine pure red and pure green.

Step 29: To create the next secondary color, cyan, update the rgb function in the .two CSS rule to combine pure green and pure blue.

Step 30: To create the final secondary color, magenta, update the rgb function in the .three CSS rule to combine pure blue and pure red.

Step 31: To create the tertiary color orange, update the rgb function in the .one CSS rule so that red is at the max value, and set green to 127.

Step 32: Update the rgb function in the .two CSS rule so that green is at the max value, & set blue to 127.

And More with RGBA, HSLA & others. Learn with free 2023 freeCodeCamp course




Other Videos By We Will Code


2022-12-01Review of Codecademy's Introduction to Lua, Learn Lua Programming, Review of Lua Basics, Learn Code
2022-12-01Categorizing Data with Types in Lua Program, Data Types and Operators in Lua String, Number Bool Nil
2022-11-30How to Print in Lua Programming, Output in Lua, Learn Lua Programming Syntax, Lua Programming Guide
2022-11-30Single Line Comments in Lua Programming, How to Comment in Lua, Intro to Lua Comments, Codecademy
2022-11-30Lua Multi-Line Comments, Codecademy's Intro to Lua Programming, Use Multi-Line Comments in Lua
2022-11-28Tron and Sony Partnership, Tron Games on PlayStation, PS5 Tron Games, Tron Games PS5, Sony Tron News
2022-11-17How to Create a Simple Hello World Program Using Lua Programming, Intro to Lua Programming
2022-11-16Introduction to Lua, Codecademy Learn Lua Course, Lua Programming for Beginners, Programming Basics
2022-11-16Learn Lua Programming, Is Lua a Good Programming Language, Lua Language Review for Beginners
2022-10-19Yugioh Random 10 Cards 1 rare from Dollar General, is it worth it? Review MJ Holding Company LLC
2022-10-15Learn CSS Colors by Building a Set of Colored Markers, Free CSS Beginners Course freeCodeCamp 2023
2022-10-02Add Global Header and Footer, CSS and Admin Bar to Custom WordPress Theme, Explain Custom WP Theme
2022-09-27Learn PHP Ternary Operator, Using Ternary Operator with PHP, Ternary Operator Explained in PHP Code
2022-09-27Truthy and Falsy in PHP Programming 2023, Truth and False Conditions in Programming with PHP Code
2022-09-27Customize, Develop WordPress Theme from Scratch, Loop Through WP Posts and Pages, Get Post Content
2022-09-26What are Arrays in WordPress, How to Become a WordPress Developer 2023, WordPress Beginner Course
2022-09-23What are Functions in WordPress, Easy Intro to Functions, Using WordPress Functions, WP Functions
2022-09-22How to Create A Wordpress Theme 2023, Become a Wordpress Developer, Make Custom Theme in Wordpress
2022-09-22Become a Wordpress Developer 2023, What is PHP, Use PHP in Wordpress Explained, Run PHP in Wordpress
2022-09-21Become a Wordpress Developer in 2023, Where to Begin, Free Local Wordpress Environment Installation
2022-09-19More About PHP Switch Statements, Fall Through Explained, Exclude Break in PHP Switch Statements



Other Statistics

Counter-Strike: Source Statistics For We Will Code

We Will Code currently has 948 views spread across 2 videos for Counter-Strike: Source. His channel published less than an hour of Counter-Strike: Source content, making up less than 0.42% of the total overall content on We Will Code's YouTube channel.