Question

What is the correct HTML for adding a background color? <body style="background-color:yellow;"> <background>yellow</background> <body bg="yellow">

What is the correct HTML for adding a background color?

<body style="background-color:yellow;">

<background>yellow</background>

<body bg="yellow">

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. <body style="background-color:yellow;">

2. <background>yellow</background>

3. <body bg="yellow">

------------------------------------------------------

Solution:

In the above mentioned options, option-1 [<body style="background-color:yellow;">] - is the correct one to set the background to specific color. This one uses style attribute and so sets the background color.

-----------------------------------------------------

Remaining options has to be modified to work as expected..

Option 2 : <background>yellow</background>

                  There is no such type of attribute as <background>in html.

Option 3 : 3. <body bg="yellow">   Corect format is [ <body bgcolor="yellow">

----------------------------------------------------

Kindly up-vote if satisfied with this solution..

Thanks

Add a comment
Know the answer?
Add Answer to:
What is the correct HTML for adding a background color? <body style="background-color:yellow;"> <background>yellow</background> <body bg="yellow">
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • body { color: black; background-color:white; } p { color: orange; } Given the css rules above,...

    body { color: black; background-color:white; } p { color: orange; } Given the css rules above, predict what the following HTML code in a web page will look like. <body> <p style="color:blue;background-color:yellow;"> Here is the first paragraph </p> </body> a. The text "Here is the first paragraph" will be black with white background color. b. The text "Here is the first paragraph" will be orange with white background color. c. The text "Here is the first paragraph" will be orange...

  • Create a webpage in which the user is allowed to select the page's background and color...

    Create a webpage in which the user is allowed to select the page's background and color whether the page uses serif or sans serif fonts. The change the body element's style attribute accordingly. If the user onclicks any of the options, the webpage will turn into that format. For example, if the user clicks "Gray background", the background color of the webpage will be Gray. If the user clicks Serif-text, the text in the web page will be in Serif...

  • In the DOM of the HTML document of the previous question (included again below), which of...

    In the DOM of the HTML document of the previous question (included again below), which of the following statements is FALSE? <!DOCTYPE html> <html> <head> <title>Question 4</title> <style> body em { font-size: 1.4em; color: yellow; } р { color: blue; font-size: 1.2em; font-family: arial, sans-serif; } #q7 { color: green; } </style> </head> <body> <p>The magician said <em id="q7">abracadabra</em>, and the exam disappeared...</p> </body> </html> O the <html> element has 2 children the grandfather of the <title> element is <html>...

  • use the sample html file below with a submit button to modify the style of the...

    use the sample html file below with a submit button to modify the style of the paragraph text through JavaScript code. By clicking on the button, the font, the font size, and the color of the paragraph text will be changed. <!DOCTYPE html> ·         <html> ·         <head> ·         <meta charset=utf-8 /> ·         <title>Change Paragraph Text</title> ·         </head>   ·         <body> ·         <p id ='text'>I’m going to change this text, I hope.</p>   ·         <div> ·         <button id="jschange" ·         onclick="js_style()">Style</button> ·         </div> ·         </body> ·         </html>

  • Question 23 2.86/2.86 pts In Drosophila yellow body color is caused by a sex-linked recessive allele...

    Question 23 2.86/2.86 pts In Drosophila yellow body color is caused by a sex-linked recessive allele and brown eye color is an autosomal recessive trait. A phenotypically normal female fly, heterozygous for both genes, is crossed to a male with normal body color and brown eyes. What proportion of their offspring should have yellow body color and brown eyes? Correct! 1/B 1/3 1/4 1/2

  • Create an external style sheet named Lab05.css. In this style sheet put the following styles: At the top of the style sheet, add the line: @charset "utf-8"; Add this comment: /* Lab 5 Extern...

    Create an external style sheet named Lab05.css. In this style sheet put the following styles: At the top of the style sheet, add the line: @charset "utf-8"; Add this comment: /* Lab 5 External Style Sheet - Brandon  */ Style the h1 element with a background color of lightgreen and center the text. Style the p element with a blue text color and yellow background color. Style the p element of class .firstclass with a green text color. Style the...

  • Can someone please verify if the answers are correct? thanks 1₧Which type of select does the...

    Can someone please verify if the answers are correct? thanks 1₧Which type of select does the # symbol represent? id class tag 2- Which selector controls the style of an element when the mouse moves over the element? :onHover :mouseOver :over :hover 3- Which property changes the background color of an element? background-color: bground: bg-color: b-color: 4-In which way can a set of CSS styles be inserted into multiple HTML pages? All of the above External style sheet Internal style...

  • Homework 8   Re-write this code using a style sheet not in-line styles <html> <head><title>position</title> </head> <body>...

    Homework 8   Re-write this code using a style sheet not in-line styles <html> <head><title>position</title> </head> <body> <img src= "snow.jpg" style="positon: absolute; top:0px; left: 0px; z-index: 1"> <img src="nagano_1.jpg" Style = "position: absolute; top:70px; left: 150px; z-index:2"> <h1 style= "position: fixed; top:50px; left: 50px; color:2338ee; z-index:3";> this is a test of position</h1> </body></html> 1. Create an HTML file that uses an alert dialog box to display the message "Hi There!" when the page loads 2. Create an HTML file that creates...

  • <!-- DOCTYPE declaration --> <!DOCTYPE html> <!-- HTML boilerplate code --> <html lang="en">    <!-- head...

    <!-- DOCTYPE declaration --> <!DOCTYPE html> <!-- HTML boilerplate code --> <html lang="en">    <!-- head tag -->    <head>                 <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Personal Webpage</title>    </head>    <!-- body tag -->     <body>             <style>        .sidenav {            height: 100%;             width: 160px;            position: fixed;            z-index: 1;             top: 0;            left: 0;           ...

  • //--------// // Events // //--------// console.log("Events"); // 1. Change the link (the <a> tag) in the...

    //--------// // Events // //--------// console.log("Events"); // 1. Change the link (the <a> tag) in the HTML body below such that a hello // message is displayed on a click event. //--------------// // Input Fields // //--------------// console.log("Input Fields"); // 1. Change the background color to red for the input text field (the <input> // tag) in the HTML body when obtaining the focus and change it back to // white when the focus is lost. // 2. Read the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT