Question

In step 10) you modied the rules for the header as follows: nav, #content, footer {...

In step 10) you modied the rules for the header as follows:
nav, #content, footer { background-color: #4CA6FF;
padding: 10px;
}
header { background-color: #4CA6FF;
padding: 0 2% 2% 0; }
Given that the same background-color rule is found in two areas, rewrite these rules so that
the background-color property is referenced only once. (Hint: You will need to create three
selectors to do this.) What is the benet of listing the same declaration only once?

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

PLEASE GIVE IT A THUMBS UP

<!DOCTYPE html>
<html>

<head>
   <title></title>
   <style type="text/css">
       nav, #content, footer {
           padding: 10px;
       }

       header {
           padding: 0 2% 2% 0;
       }

       nav, #content, footer, header{
           background-color: #4CA6FF;
       }

   </style>
</head>

<body>
   <header></header>
   <footer></footer>
</body>

</html>

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

Here, the benefit of listing the same declaration only once is that in case we need to change the value of the attribute, then, in that case, we need to make the change only once, and will be applied to all.

Add a comment
Know the answer?
Add Answer to:
In step 10) you modied the rules for the header as follows: nav, #content, footer {...
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
  • 2 Apply Your Knowledge Reinforce the skills and apply the concepts you learned in this chapter Styling a Webpage Instru...

    2 Apply Your Knowledge Reinforce the skills and apply the concepts you learned in this chapter Styling a Webpage Instructions: In this exercise, you will use your text editor to create external, embedded, and inline styles for the Durango Jewelry and Gem Shop home page. You will style the sections of the semantic wireframe header, nav, main, and tooter and a div element that surrounds all of the content to center the content on the page. You will also float...

  • Hello, I am designing a website for my class. I am using HTML/CSS/Jscript. I need to...

    Hello, I am designing a website for my class. I am using HTML/CSS/Jscript. I need to have my text in the body, white. All text and the picture centered but how do I have margins on the left and right side?. I have a figcaption and I dont know have to place it under the picture but I am having a hard time. Can you help me? Thank you! HTML <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet"...

  • n the Labs Labs 1 and 2, which increase in difficulty, require you to create webpages based on what you learned in the...

    n the Labs Labs 1 and 2, which increase in difficulty, require you to create webpages based on what you learned in the chapter; Lab 3 requires you to dive deeper into a topic covered in the chapter. Lab 1: Creating an External Style Sheet for City Farmer Problem: You work for a local but rapidly growing gardening supply company called City Farmer that specializes in products that support food self-sufficiency. The company has hired you to help create the...

  • How do I get my HTML and CSS to look similar to this mockup? HTML: <!DOCTYPE...

    How do I get my HTML and CSS to look similar to this mockup? HTML: <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>nitro site</title>     <link href="css/main.css" rel="stylesheet"/> </head> <body>     <header class="header">     <section class="navlist">         <img class="logo" src="assets/logobeans.png"/>         <h2 class="headertitle">nitro</h2>     <nav>         <ul>             <li><a href="index.html" target="_parent">About</a></li>             <li><a href="/html/menu.html" target="_blank">Menu</a></li>             <li><a href="/html/menu.html">Shop Now</a></li>         </ul>     </nav>     </section>     <section class="headerContainer">         <h1 class="heading">Nitro Coffee</h1>         <p class="productDesc">Coffee is a brewed drink prepared from roasted coffee beans, the seeds of berries from certain Coffea species.</p>...

  • Creating the Home and Template Pages Overview In this assignment, you will start building your Web...

    Creating the Home and Template Pages Overview In this assignment, you will start building your Web site for your fictional organization by creating a homepage using HTML5 and some of the key elements that define a Web page. You are required to use either a simple text editor to write your code, or an enhanced text editor such as Brackets. Note: Microsoft Word is not a good tool for developing code because it is a document processor and not a...

  • Assignment:Super Lotto This exercise is JavaScript only. No jQuery, please. Your page should work as follows: Ask the user the highest number that they want to generate. (Some lotteries are 1 ‐ 47, so...

    Assignment:Super Lotto This exercise is JavaScript only. No jQuery, please. Your page should work as follows: Ask the user the highest number that they want to generate. (Some lotteries are 1 ‐ 47, some 1 ‐ 49, etc.) Ask the user how many numbers they want to generate. Create a function that returns a random number between 1 and the highest number (see "Additional Info" below). Create an array of numbers. Run the function the correct number of times, putting...

  • For milestone #1, we will start the CARIT site with three static HTML pages and a...

    For milestone #1, we will start the CARIT site with three static HTML pages and a CSS file. Create a dedicated folder for this project. This folder should contain all related files in this project. The future milestones are cumulative and built directly on top of your prior work. Function/content requirements: A home page named “index.html”, which include these contents at least: Description of the center. You may reference the example sites. Latest news: use list tags; make up some...

  • An array of class objects is similar to an array of some other data type. To...

    An array of class objects is similar to an array of some other data type. To create an array of Points, we write Point parray [4]; To access the object at position i of the array, we write parray [i] and to call a method on that object method, we write parray [i]. methodName (arg1 , arg2 , ...) ; To initialize an array of objects whose values are known at compile time, we can write Point parray [4] =...

  • Activity: Writing Classes Page 1 of 10 Terminology attribute / state behavior class method header class...

    Activity: Writing Classes Page 1 of 10 Terminology attribute / state behavior class method header class header instance variable UML class diagram encapsulation client visibility (or access) modifier accessor method mutator method calling method method declaration method invocation return statement parameters constructor Goals By the end of this activity you should be able to do the following: > Create a class with methods that accept parameters and return a value Understand the constructor and the toString method of a class...

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