Sikau

JavaScript · Day 42 · about 30 min

HTML and CSS in one lesson

Just enough to build a page.

Back to the web

On Day 2 you met the trio: HTML (the skeleton), CSS (the clothes) and JavaScript (the behaviour). Before JavaScript can change a page, you need just enough HTML and CSS to build one. Let's go!

HTML: tags

HTML is made of tags in angle brackets. Most come in pairs: an opening tag and a closing tag with a slash. Together with what's between them, that's an element.

Tags can have attributes that add extra information. The two you'll use most from JavaScript are id (a unique name) and class (a group name):

The rest of this lesson

  • CSS: rulesexplain
  • The hooks JavaScript usesexplain
  • Predictpredict
  • Selector to elementmatch
  • Your turnwrite code
  • Challenge: add stylechallenge
  • Badge quizquiz
  • What you learnedrecap

Continue this lesson free — run real code in your browser

Continue with Google

See all 68 lessons of JavaScript