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.

Related HTML and CSS Mentoring answers

All answers ▸

Describe the advantages and disadvantages of the three main ways of adding CSS to a website


What is the correct HTML to link a stylesheet?


What is the difference between HTML and CSS?


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.


We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2024

Terms & Conditions|Privacy Policy