Knowee
Questions
Features
Study Tools

You are creating a web page. Some of the code is as follows:<p class =”short”>This is a short paragraph. </p> <p class = “long”>Once I’m done with short paragraphs I tend to move on to long paragraphs.</p> <h2 class=”long”>About Long Paragraphs</h2>You want to create one style rule that will change the font for the text “Once I’m done with short paragraphs I tend to move on to long paragraphs.” and the text “About Long Paragraphs”. Your rule should not affect the text “This is a short paragraph.”Which rule should you create?1 point#long { font-family: “Arial” }.long { font-family: “Arial” }h2.long { font-family: “Arial” }p.long { font-family: “Arial” }

Question

You are creating a web page. Some of the code is as follows:<p class =”short”>This is a short paragraph. </p> <p class = “long”>Once I’m done with short paragraphs I tend to move on to long paragraphs.</p> <h2 class=”long”>About Long Paragraphs</h2>You want to create one style rule that will change the font for the text “Once I’m done with short paragraphs I tend to move on to long paragraphs.” and the text “About Long Paragraphs”. Your rule should not affect the text “This is a short paragraph.”Which rule should you create?1 point#long { font-family: “Arial” }.long { font-family: “Arial” }h2.long { font-family: “Arial” }p.long { font-family: “Arial” }

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

The correct rule to create would be .long { font-family: “Arial” }. This rule targets all elements with the class "long", which includes the long paragraph and the h2 heading. The other rules either target specific elements or use an incorrect selector, and therefore would not apply to both the paragraph and the heading.

Similar Questions

You are creating a web page. In the heading element of the web page is the following code:<link rel=”stylesheet” href=”styles.css”><style> h2 { font-family: “Arial”; } h3 { font-family: “Calibri”; } </style>The code in the styles.css document is the following:h2 { font-family: “Times New Roman”; } .ad { font-family: “Courier-New”; }On the web page you have the following paragraph:<h2 id=”ad”>The best place to eat in town!<h2>What font will be used to display “The best place to eat in town!”?1 pointTimes New RomanArialCourier-NewCalibri

Consider the following content from a web page:If you wanted to add more paragraphs to this document, which of the following code blocks could you use to make sure that all of the new paragraphs will appear with a salmon background color?Group of answer choices<!DOCTYPE html><html><head><style>body {background-color:salmon}p {background-color:salmon}</style></head><body><h1>Salmon</h1><p style=”font-family: Comic Sans MS”>Did you know that there are many different species of salmon? Each of the salmon species in the Pacific has at least two names. The largest are called Chinooks or king salmon. While all salmon have silvery sides, only the Coho salmon are also known as silvers. Sockeyes, which have a deep red color inside, are also referred to as red salmon. Traditionally, the Chum or dog salmon, was fed to sled dogs in Alaska. Pinks, the smallest of the salmon, are also called humpies because the males take on a hump-shaped appearance before they swim upstream!</p></body></html><!DOCTYPE html><html><head><style>h1 {background-color:salmon}p {background: salmon}</style></head><body><h1>Salmon</h1><p style=”font-family:comic san ms”>Did you know that there are many different species of salmon? Each of the salmon species in the Pacific has at least two names. The largest are called Chinooks or king salmon. While all salmon have silvery sides, only the Coho salmon are also known as silvers. Sockeyes, which have a deep red color inside, are also referred to as red salmon. Traditionally, the Chum or dog salmon, was fed to sled dogs in Alaska. Pinks, the smallest of the salmon, are also called humpies because the males take on a hump-shaped appearance before they swim upstream!</p></body></html><!DOCTYPE html><html><head><style>h1 {background-color:salmon}p {font-family:Comic Sans MS}</style></head><body><h1>Salmon</h1><p style=”background-color:salmon”>Did you know that there are many different species of salmon? Each of the salmon species in the Pacific has at least two names. The largest are called Chinooks or king salmon. While all salmon have silvery sides, only the Coho salmon are also known as silvers. Sockeyes, which have a deep red color inside, are also referred to as red salmon. Traditionally, the Chum or dog salmon, was fed to sled dogs in Alaska. Pinks, the smallest of the salmon, are also called humpies because the males take on a hump-shaped appearance before they swim upstream!</p></body></html><!DOCTYPE html><html><head><style>body {background-color:salmon}</style></head><body><h1>Salmon</h1><p style=”background-color:salmon”>Did you know that there are many different species of salmon? Each of the salmon species in the Pacific has at least two names. The largest are called Chinooks or king salmon. While all salmon have silvery sides, only the Coho salmon are also known as silvers. Sockeyes, which have a deep red color inside, are also referred to as red salmon. Traditionally, the Chum or dog salmon, was fed to sled dogs in Alaska. Pinks, the smallest of the salmon, are also called humpies because the males take on a hump-shaped appearance before they swim upstream!</p></body></html>

You are creating a headline for a web page advertising a sale. You have the following code in the web page:<h1>Today Only! All items <font class=”slashed”>twenty</font> fifty percent off!</h1>You need to create a style rule that will run a horizontal line through the center of the word twenty so it looks like this: twentyWhat style rule should you create?1 pointh1.slashed { text-decoration: line-through; }h1.slashed { text-decoration: strike-through; }h1.slashed { text-transform: strike-through; }h1.slashed { text-indent: top; }

You have created the following HTML code:<p>This is a sample paragraph.</p>You create a style rule to shade the background of the paragraph:p { background-color: blue; border-radius: 25px; color: white; }However, when you test the web page, you notice that the text appears very close to the edges of the shading. You want there to be more room between the text and the edges of the shading.What should you add to your style rule?1 pointpadding: 25px;margin: 25px;position: sticky;display: inline;

You are creating a web page for an online magazine. You want to pull out a quote from the content. The quote should appear to the right of the main paragraphs in a shaded box. You add the following to the main web page:<aside><q>It was a nightmare.</q></aside>In the linked stylesheet, you create the following style rule:aside { width: 10%; padding: 10px; font-style: italic; background-color: lightgray; margin-left: 20px; }When you test the web page, the quote does not appear to the right of the main text.What should you add to the style rule?1 pointfloat: right;text-align: right;margin-right: 30px;position: right;

1/2

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.