Show how you would give all elements that have a class of 'class1', a green background.

.class1{ background-color: 'green'; } The full-stop before the text indicates that this css rule applies to a class with the name 'class1'.Inside the rule, the background-color attribute is given a value of 'green' which will give the class a green background colour.

JC
Answered by Jamie C. HTML and CSS tutor

1730 Views

See similar HTML and CSS Mentoring tutors

Related HTML and CSS Mentoring answers

All answers ▸

Many different data types can be stored on a computer system. Five common data types are string, Boolean, real, character and integer. Give suitable examples of data that could be held in each data type.


What’s the difference between a block-level element and an inline element in html?


Explain what a pseudo class selector is


How can I express x^2 - 7*x + 2 as (x - p)^2 + q ?


We're here to help

contact us iconContact ustelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

MyTutor is part of the IXL family of brands:

© 2025 by IXL Learning