HTML and CSS Certification Practice Test

Question: 1 / 400

How can you display h1 header text in blue, Arial font, with 20px size, bold and center-aligned?

h1 {color: blue; font-family: arial; font-size: 20px; font-weight: bold; text-align: center;}

The definition given accurately meets all the specified requirements for styling the h1 header text. Each property within the style rule addresses a specific aspect of the design:

1. **color: blue;** - This sets the text color to blue as requested.

2. **font-family: arial;** - This specifies the font as Arial, which is one of the specified font requirements.

3. **font-size: 20px;** - This defines the size of the font as 20 pixels, complying with the size request.

4. **font-weight: bold;** - This ensures the text is bold, matching the requirement for emphasis.

5. **text-align: center;** - This centers the text on the page, fulfilling the alignment request.

It's worth noting that the order of properties in CSS does not affect their functionality, so properties can be listed in any order, as seen in the correct choice where they follow a logical and clear sequence. Each property directly contributes to achieving the desired overall appearance of the h1 header.

Get further explanation with Examzify DeepDiveBeta

h1 {color: blue; font-size: 20px; font-weight: bold; text-align: center; font-family: Arial;}

h1 {font-family: arial; text-align: center; color: blue; font-size: 20px;}

h1 {text-align: center; font-size: 20px; color: blue; font-weight: bold;}

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy