hands-on lab

Selecting HTML Elements using CSS

Difficulty: Beginner
Duration: Up to 25 minutes
Students: 185
Rating: 4/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

Cascading Style Sheets (CSS) allow you to flexibly write rules that apply to a single HTML element or to multiple HTML elements. As well as applying a rule by class or identifier, you can create rules that set the same style properties on multiple HTML elements or on elements that have a specific parent HTML element.

Learning how to select HTML elements in different ways will help you write CSS more efficiently.

Learning Objectives

Upon completion of this beginner level lab, you will be able to write CSS rules that:

  • Select by HTML element type, identifier, and class
  • Select multiple HTML elements
  • Select by parent HTML element

Intended Audience

  • Beginners learning front-end development
  • Software Engineers who need to learn front-end technologies to expand their skillset

Prerequisites

Familiarity with the following will be beneficial but is not required:

  • Cascading Style Sheets (CSS)
  • Hypertext Markup Language (HTML)

The following content can be used to fulfill the prerequisites:

Covered topics

Lab steps

Introduction to HTML and CSS Labs
Selecting by Element Type, Class, and Identifier
Selecting Multiple Elements and Selecting by Parent Element