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 insert a comment in a CSS file?

2

Which is the correct CSS syntax?

3

Which HTML attribute is used to define inline styles?

4

Which HTML tag is used to define an internal style sheet?

5

Where in an HTML document is the correct place to refer to an external style sheet?

Comments