Comments in CSS can be used to help organize the code. In this video, look at the syntax and usage and update your projects.
- Comments in CSS start with a slash…and asterisk and must close in the opposite order.…The browser doesn't read comments,…so we can use it help us read our code better.…Let's talk about a few ways we can use comments.…You can use it to leave notes for yourself…or for others.…You can also use comments to organize your…code blocks into related groups.…Or, just comment out a line,…or a whole block of CSS to…hide it from the browser temporarily.…Sometimes we're not ready to use…a certain block of CSS…but we also don't want to delete it either,…so commenting out the code helps us hide it…from the browser without actually deleting it.…
You'll probably notice that…everybody has a personal preference for how…they write their comments.…You can include any characters you like…as long as they are contained between the asterisks.…Let's go back to our project's CSS file…and add some comments to organize it…before it gets long and unruly.…CSS files should start with the general styles…at the top, such as the ones…using type selectors,…
- Creating a CSS file
- Writing basic selectors
- Setting properties
- Using different typefaces and web-safe fonts
- Understanding cascading and inheritance
- Setting a font family, font size, text color, and more
- Understanding the box model
- Using the float property
Skill Level Beginner
1. Getting Started
2. CSS Core
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.