Month: April 2019

Basic JavaScript: Manipulate Arrays With push()

// Setupvar myArray = [["John", 23], ["cat", 2]];// Add a dog... ezmyArray.push(["dog",3]);

Basic JavaScript: Understand String Immutability

// Setupvar myStr = "Jello World";// Only change code below this linemyStr[0] = "H"; //…

Basic JavaScript: Constructing Strings with Variables

// Examplevar ourName = "freeCodeCamp";var ourStr = "Hello, our name is " + ourName +…

Basic JavaScript: Understanding Case Sensitivity in Variables

// Declarationsvar StUdLyCapVaR;var properCamelCase;var TitleCaseOver;// AssignmentsSTUDLYCAPVAR = 10;PRoperCAmelCAse = "A String";tITLEcASEoVER = 9000;

Basic JavaScript: Understanding Uninitialized Variables

// Initialize these three variablesvar a;var b;var c;// Do not change code below this linea…

Basic CSS: Use RGB to Mix Colors

<style>.red-text {color: #000000;}.orchid-text {color: #000000;}.sienna-text {color: #000000;}.blue-text {color: #000000;}</style><h1 class="red-text">I am red!</h1><h1 class="orchid-text">I am orchid!</h1><h1…

Basic CSS: Use Abbreviated Hex Code

<style> .red-text { color: #000000; } .fuchsia-text { color: #000000; } .cyan-text { color: #000000;…

Basic CSS: Override All Other Styles by using Important

<style>body {background-color: black;font-family: monospace;color: green;}#orange-text {color: orange;}.pink-text {color: pink;}.blue-text {color: blue;}</style><h1 id="orange-text" class="pink-text blue-text" style="color:…

Basic CSS: Override Class Declarations by Styling ID Attributes

<style>body {background-color: black;font-family: monospace;color: green;}.pink-text {color: pink;}.blue-text {color: blue;}</style><h1 class="pink-text blue-text">Hello World!</h1>

Basic CSS: Override Styles in Subsequent CSS

<style>body {background-color: black;font-family: monospace;color: green;}.pink-text {color: pink;}</style><h1 class="pink-text">Hello World!</h1>

Basic CSS: Prioritize One Style Over Another

<style>body {background-color: black;font-family: monospace;color: green;}</style><h1>Hello World!</h1>

Basic CSS: Use Clockwise Notation to Specify the Margin of an Element

<style>.injected-text {margin-bottom: -25px;text-align: center;}.box {border-style: solid;border-color: black;border-width: 5px;text-align: center;}.yellow-box {background-color: yellow;padding: 20px 40px 20px 40px;}.red-box…

Basic CSS: Use Clockwise Notation to Specify the Padding of an Element

<style>.injected-text {margin-bottom: -25px;text-align: center;}.box {border-style: solid;border-color: black;border-width: 5px;text-align: center;}.yellow-box {background-color: yellow;padding: 20px 40px 20px 40px;}.red-box…

Basic CSS: Add Different Margins to Each Side of an Element

<style>.injected-text {margin-bottom: -25px;text-align: center;}.box {border-style: solid;border-color: black;border-width: 5px;text-align: center;}.yellow-box {background-color: yellow;padding: 10px;}.red-box {background-color: crimson;color: #fff;margin-top:…

Basic CSS: Add Different Padding to Each Side of an Element

<style>.injected-text {margin-bottom: -25px;text-align: center;}.box {border-style: solid;border-color: black;border-width: 5px;text-align: center;}.yellow-box {background-color: yellow;padding: 10px;}.red-box {background-color: crimson;color: #fff;padding-top:…

Basic CSS: Add a Negative Margin to an Element

<style>.injected-text {margin-bottom: -25px;text-align: center;}.box {border-style: solid;border-color: black;border-width: 5px;text-align: center;}.yellow-box {background-color: yellow;padding: 10px;}.red-box {background-color: crimson;color: #fff;padding:…