Question

In: Computer Science

Using this code snippet: Answer the following questions <div id=”mainContent”>      <p>I’m a cool paragraph <span>...

Using this code snippet: Answer the following questions

<div id=”mainContent”>

     <p>I’m a cool paragraph

<span>

    that has some

                  <span class=”coolClass”>yellow</span>

                  text

            </span>

     </p>

     <p class=”blue”>

            I’m just some blue text

      </p>

      <p class=”coolClass”> I should be un-touched text </p>

</div>

<div id=”footer”>

     <p class=”tagLine”>Copyright &copy; 2014</p>

</div>

1. Write the CSS rule (selector/declaration) to change all elements with a class of ‘blue’ to have blue foreground text. Hint: color

2. Write the CSS rule to change just the span with a class of “coolClass” to have a text color of yellow.

3. Write the CSS rule to change the element with and id of ‘footer’ to have a font size of 12px. Hint: font-size

4. Write the CSS needed to make all paragraphs in the document have a font weight of bold. Hint: font-weight

Solutions

Expert Solution

Please find the answer below.

SOURCE CODE:

*Please follow the comments to better understand the code.

**Please look at the Screenshot below and use this code to copy-paste.

***The code in the below screenshot is neatly indented for better understanding.

<!DOCTYPE html>

<html>

  <head>

    <title>Page Title</title>

    <!-- Write the styles here -->

    <style>

      /* 1.Blue class should have blue color */

      .”blue” {

        color: blue;

      }

      /* 2. coolClass of span text yellow color */

      span.”coolClass” {

        color: yellow;

      }

      /* 3. footer id should have font size 12px  */

      #”footer” {

        font-size: 12px;

      }

      /* 4. all <p> paragraphs should have a bold font weight */

      p {

        font-weight: bold;

      }

    </style>

  </head>

  <body>

    <div id="”mainContent”">

      <p>

        I’m a cool paragraph

        <span>

          that has some

          <span class="”coolClass”">yellow</span>

          text

        </span>

      </p>

      <p class="”blue”">

        I’m just some blue text

      </p>

      <p class="”coolClass”">I should be un-touched text</p>

    </div>

    <div id="”footer”">

      <p class="”tagLine”">Copyright &copy; 2014</p>

    </div>

  </body>

</html>

===========

OUTPUT:

CSS CODE:


Related Solutions

Which of the following tags is NOT a container tag? <p> <span> <div> <img> <table> What...
Which of the following tags is NOT a container tag? <p> <span> <div> <img> <table> What is the correct order for table tags <table><td><tr> <tr><td> <table><tr><td></tr></td></table> <table><tr><td></td></tr></table> <table><td><tr></tr></td></table> For the list shown below which of the following is the proper HTML5 code for the list. 1.         A 2.         B 3.         C <ul> <li> A <li> B <li> C </ul> <ul> <li> A </li> <li> B </li> <li> C </li> </ul> <ol> <li> A <li> B <li> C </ol> <ol> <li>...
Viewing the code snippet below answer the following questions: int num=10; do {      cout << “Hello”...
Viewing the code snippet below answer the following questions: int num=10; do {      cout << “Hello” << endl;      num--; } while(num > 1); After the above code is executed: “Hello” printed how many times: ___________ What is value ofnum:  ____________ language is c++
The following code snippet is free of errors (issues that will prevent the code from compiling)...
The following code snippet is free of errors (issues that will prevent the code from compiling) but it does contain a major bug that will cause the program to hang (not finish running). Identify the problem and create a line of code to fix it. #include <stdio.h> char get_input(); int main() { printf("The user's inputted letter is %c\n", get_input()); return 0; } char get_input() { printf("Please enter a letter: \n"); char input = getchar(); while (!(input >= 'a' && input...
Please answer the following questions in paragraph form using citations (text and/or web) to support your...
Please answer the following questions in paragraph form using citations (text and/or web) to support your responses. 1. Provide reasons why Freud’s principles of psychoanalytic theory have been called into question. 2. Provide reasons why Erikson’s principles of psychosocial theory have been called into question.
What is the output of the following code snippet? (If there is some kind of syntax...
What is the output of the following code snippet? (If there is some kind of syntax error indicate this by marking "error" in your answer choice) 1.        int laps = 8;        if (laps++ > --laps)               laps += 2;        else if (--laps > (laps - 1))               laps += 4;        else if (++laps)               laps -= 3;        cout << laps << endl; 2. What is the output of the following code snippet?     int j = 47;     int i = 8;     j =...
I'm having trouble understanding the following code (a snippet of a code). What does it do?...
I'm having trouble understanding the following code (a snippet of a code). What does it do? The whole code is about comparing efficiencies of different algorithms. def partition(list,first,last): piv = list[first] lmark = first+1 rmark = last done = False while not done: while lmark <= rmark and list[lmark]<=piv: lmark=lmark+1 while list[rmark]>=piv and rmark>=lmark: rmark=rmark-1 if rmark<lmark: done = True else: temp = list[lmark] list[lmark]=list[rmark] list[rmark]=temp temp = list[first] list[first]=list[rmark] list[rmark]=temp return rmark
What is the output of the following code? Explain your answer in a paragraph or two....
What is the output of the following code? Explain your answer in a paragraph or two. class ExceptionThrown { static int divideByZero(int a, int b){ int i = a/b; return i; }    static int computeDivision(int a, int b) { int res =0; try{    res = divideByZero(a,b); } catch(NumberFormatException ex){ System.out.println("NumberFormatException is occured"); }    return res; }    public static void main(String args[]){ int a = 1;    int b = 0; try{ int i = computeDivision(a,b); }...
• Based on the following code snippet and plan attributes, provide the output for Plan A,...
• Based on the following code snippet and plan attributes, provide the output for Plan A, Plan B and Plan C. Code Snippet • {{IF:[Copay]=Not Covered && [Coinsurance]=Not Covered, show ‘Not covered’}} • {{IF:[Copay]!=$0.00 && [Copay]!=Blank, show value from {{Copay}} copayment}} • {{IIF:[Copay]!=$0.00 && [CopayFrequency]!=Blank, show {{Copay}} copayment/{{CopayFrequency}}}} • {{IF:[CopayMax]=$0.00 OR [Copay]=$0.00, show No Charge}} • {{IF:[[CopayMax]!=$0.00 && [CopayMax] contains ‘$’ && [Coinsurance] contains ‘%’ && [CopayMaxFrequency]=Blank, show {{CopayMax}} copayment then {{Coinsurance}} coinsurance]}} Plan Copay CopayFrequency CopayMax CopayMaxFrequency Coinsurance Plan...
Using JAVA 2. A run is a sequence of adjacent repeated values. Write a code snippet...
Using JAVA 2. A run is a sequence of adjacent repeated values. Write a code snippet that generates a sequence of 20 random die tosses in an array and that prints the die values, marking the runs by including them in parentheses, like this: 1 2 (5 5) 3 1 2 4 3 (2 2 2 2) 3 6 (5 5) 6 (3 3) Use the following pseudocode: inRun = false for each valid index i in the array If...
When talking about wounded worriers suffering with PTSD answer the following questions using the code of...
When talking about wounded worriers suffering with PTSD answer the following questions using the code of ethics. What moral obligation do nurses have to prevent human entrapment rather than just caring for victims of violence? When nurses observe an underserved population trapped by this external factor, what should be done? How should a nurse begin to mobilize awareness to address issues entrapping the population being served?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT