What is the preferred way for adding a background color in html?
Answers
The preferred way for adding a background color in HTML is by assigning background-color:colorvalue to the style attribute. Here, colorvalue is replaced by the name of the color to be assigned. The style attribute can be used along with one of the header tags or the paragraph tag.
Examples:
<h3 style=”background-color:red; ”>I like red</h3>
The text I like Red appears on a red background in h3 heading size.
<p style=”background-color:green; ”>Nature is green</p>
The paragraph containing the text Nature is green appears on a green background.
The preferred way for adding a background color in HTML is:
<body style="background-color:yellow">
HTML or Hypertext Markup Language is a standardized system for tagging text files to achieve colour, hyperlink, graphic, and font effects on World Wide Web pages. It is a computer language used for website creation.