CSS Multiple choices


Total available count: 25
Subject - Web Development
Subsubject - CSS

Which property is used to change the background color?


 

 

 

 



C


Solution:-

To set the background color in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <body> tag, with the CSS property background-color. HTML5 do not support the <body> tag bg-color attribute, so the CSS style is used to add background color. The bg-color attribute deprecated in HTML5.

Just keep in mind that the usage of style attribute overrides any style set globally. It will override any style set in the HTML <style> tag or external style sheet.

You can try to run the following example code to set the background color in HTML,

<!DOCTYPE html>
<html>
  <head>
     <title>Set HTML Backgorund Color</title>
  </head>
  <body style="background-color:red;">
     <h1>Cources</h1>
     <p>We have developed and make it live around 20 Courses and 5 tutorials till now in SlightBook.</p>
   </body>
</html>

 




Next 5 multiple choice(s)

1

How do you add a background color for all <h1> elements?

2

Which CSS property is used to change the text color of an element?

3

Which CSS property controls the text size?

4

What are the correct CSS syntax for making all the <p> elements bold?

5

How do you display hyperlinks without an underline?

Comments