WDD 130: Web Fundamentals

W03 Learning Activities: Code Comments

Overview

Comments written in code by developers provide a way to explain the purpose and function of that code. Since the code will need to be maintained and will change, comments can serve as reminders, 'to do' lists, code snippets, and notes for potential improvement during development. Comments are not processed or displayed to the user in the rendered document in HTML or CSS. Comments can be placed in any available white space.

Prepare

Activity Instructions

  1. Open any HTML or CSS document in VS Code.
  2. Use ctrl+/ (Mac ⌘+/) to comment out the line of code where you cursor is currently located or lines of code that you have selected.
  3. Pressing ctrl+/ again will toggle the commented out line(s) of code.