Category: Codes

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:…

Basic CSS: Adjust 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: 10px;}.red-box {background-color: crimson;color: #fff;padding:…

Basic CSS: Adjust 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: 10px;}.red-box {background-color: crimson;color: #fff;padding:…

Basic CSS: Use an id Attribute to Style an Element

<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css"><style>.red-text {color: red;}h2 {font-family: Lobster, monospace;}p {font-size: 16px;font-family: monospace;}.thick-green-border {border-color: green;border-width: 10px;border-style:…

Basic CSS: Set the id of an Element

<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css"><style> .red-text { color: red; } h2 { font-family: Lobster, monospace; }…