Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

              
                
              
            
!

CSS

              
                
              
            
!

JS

              
                ///////////////////////////////// Assignment Operators ////////////////////////////////

   // JavaScript's assignment operators are used to assign variables to different values. 
   // Assignment operators each have a symbol known as the operator that is used to perform the operation.

      // 1. Equals : used to assign a variable to a value
         // Operator: =
         // Examples:
         let example = 5;
         let name = "Alex";
         name = example;
         // Q : What is the value of the variable named "name"?

      // 2. Plus-Equals : assigning a variable to its original value plus some specified value
         // Operator: += 
         // Examples:
         x = 5;
         y = 30;
         x += 10;
         x += y;
         y += x;
         // Q : What is the value of variable y?

      // 3. Minus-Equals : assigning a variable to its original value minus some specified value
         // Operator: -= 
         // Examples:
         x = 50;
         y = 23;
         x -= 12;
         x -= y;
         y -= x;
         // Q : What is the value of variable y?

      // 4. Times-Equals : assigning a variable to its original value times some specified value
         // Operator: *= 
         // Examples:
         x = 13;
         y = 9;
         x *= 3;
         x *= y;
         y *= x;
         // Q : What is the value of variable y?

      // 5. Divide-Equals : assigning a variable to its original value divided by some specified value
         // Operator: /= 
         // Examples:
         x = 348;
         y = 24;
         x /= 58;
         y /= x;
         // Q : What is the value of variable y?

      // 6. Modulus-Equals : assigning a variable to its original value modulus some specified value
         // Operator: %= 
         // Examples:
         x = 49;
         y = 17;
         x %= 12;
         y %= x;
         // Q : What is the value of variable y?

///////////////////////// Exercises /////////////////////////
// 1. Declare two variables: before and after. Assign 'before' to 0 and 'after' to 500. Print both variables to the console on separate lines.
// 2. Assign 'before' to the value of after. Print this to the console.
// 3. Assign 'after' to its original value times 3, using only one operation. Print this to the console.
// 4. Declare a new variable named 'product' and set it equal to 19.75
// 5. Declare a new variable named 'tax' and set it equal to .05. 
  // Next, reassign product to the value of itself plus the tax on the product, on one line.
  // Note that "tax on the product" means the rate of the tax times the price of the product
  // Print the value to the console.

              
            
!
999px

Console