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

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



Duration: 34:27
63 views
2


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-01How to Print in Lua Programming, Output in Lua, Learn Lua Programming Syntax, Lua Programming Guide
2022-11-29Tron and Sony Partnership, Tron Games on PlayStation, PS5 Tron Games, Tron Games PS5, Sony Tron News
2022-11-18How to Create a Simple Hello World Program Using Lua Programming, Intro to Lua Programming
2022-11-17Introduction to Lua, Codecademy Learn Lua Course, Lua Programming for Beginners, Programming Basics
2022-11-17Learn Lua Programming, Is Lua a Good Programming Language, Lua Language Review for Beginners
2022-10-23Learn Typography by Building a Nutrition Label, freeCodeCamp free 2023 Web Development Explained
2022-10-22Learn CSS Flexbox by Building a Photo Gallery, freeCodeCamp Guide for Beginners, CSS Course
2022-10-21Learn the CSS Box Model by Building a Rothko Painting, Understand CSS Box Model 2023
2022-10-20Yugioh Random 10 Cards 1 rare from Dollar General, is it worth it? Review MJ Holding Company LLC
2022-10-17Learn HTML Forms by Building a Registration Form, Forms in HTML, How do Forms Work in HTML
2022-10-16Learn CSS Colors by Building a Set of Colored Markers, Free CSS Beginners Course freeCodeCamp 2023
2022-10-14Learn CSS 2023, Full CSS Course for Beginners, freeCodeCamp Learn Basic CSS by Building a Cafe Menu
2022-10-11Learn Web Development, how To Build a Website 2023, Learn HTML by Building a Cat Photo App, Part 1
2022-10-11Intro, Learn to Code For Absolute Beginners 2023, Learn Web Development, how To Build a Website 2023
2022-10-04Add Global Header and Footer, CSS and Admin Bar to Custom WordPress Theme, Explain Custom WP Theme
2022-09-29Truthy and Falsy in PHP Programming 2023, Truth and False Conditions in Programming with PHP Code
2022-09-29Customize, Develop WordPress Theme from Scratch, Loop Through WP Posts and Pages, Get Post Content
2022-09-28Learn PHP Ternary Operator, Using Ternary Operator with PHP, Ternary Operator Explained in PHP Code
2022-09-28What are Arrays in WordPress, How to Become a WordPress Developer 2023, WordPress Beginner Course
2022-09-25What are Functions in WordPress, Easy Intro to Functions, Using WordPress Functions, WP Functions
2022-09-23How to Create A Wordpress Theme 2023, Become a Wordpress Developer, Make Custom Theme in Wordpress



Other Statistics

Counter-Strike: Source Statistics For We Will Code

We Will Code currently has 842 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.40% of the total overall content on We Will Code's YouTube channel.