Question

In: Computer Science

What does it mean that the style sheets are cascading? What is the order of priority...

What does it mean that the style sheets are cascading? What is the order of priority of CSS? List 5 things you can do with CSS, which cannot be done easily in HTML.

Solutions

Expert Solution

CSS styles:
CSS stands for cascading style sheet. CSS helps the html page to format the web page layout with uniform design.

Css file defines styles of the elements in the html tags like body head, h1 ,h2...h6, p and link as per user wishers or override the existing look of the html tags on web pages using the css propery and value .

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

Order of css properties:

  • The order of the css styles overrides the most specific rules first and general rules as last .
  • If two ids or class names are same, then most recent declaration is effected the html tag.

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

Sample html page ,sample.html


<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>This is heading 1</h1>
<h2>Sub heading</h2>
<p>New had happen unable uneasy. Drawings can followed improved out sociable not. Earnestly so do instantly pretended. See general </p>
<p>Seeing rather her you not esteem men settle genius excuse. Deal say over you age from. Comparison new ham melancholy son themselves.
</p>
</body>
</html>

------------------------------------------------------------------------------------------------------------------------
Now let us want to apply the styles for this page
as
body back ground as grey color
All h1 text blue color
All h2 text as green .
All paragraph text as white and background color as black


All the above can be simply done using css styles as shown below

<!DOCTYPE html>
<html>
<head>
<style>
body
{
background:grey;
}
h1{
color:blue;
}
h2{
color:green;
}
p{
color:white;
background:black;
}
</style>

</head>
<body>
<h1>This is heading 1</h1>
<h2>Sub heading</h2>
<p>New had happen unable uneasy. Drawings can followed improved out sociable not. Earnestly so do instantly pretended. See general </p>
<p>Seeing rather her you not esteem men settle genius excuse. Deal say over you age from. Comparison new ham melancholy son themselves.
</p>
</body>
</html>

Sample Output:


Related Solutions

What does it mean that the style sheets are cascading? What is the order of priority...
What does it mean that the style sheets are cascading? What is the order of priority of CSS? List 5 things you can do with CSS, which cannot be done easily in HTML.
What does it mean that the style sheets are cascading? What is the order of priority of CSS?
What does it mean that the style sheets are cascading? What is the order of priority of CSS? List 5 things you can do with CSS, which cannot be done easily in HTML?
how does a cascading tariff structure work?
How does a cascading tariff structure work? How does it promote import substitution and " shallow industrialization"? What are the consequences of "shallow industrialization"?
What does a stop order to sell at $2 mean? When might it be used? What does a limit order to sell at $2 mean?
What does a stop order to sell at $2 mean? When might it be used? What does a limit order to sell at $2 mean?
What does it mean for a relation is a partial order relation?
What does it mean for a relation is a partial order relation?
What does liquidity mean for accounting purposes? In what order should assets be listed on the...
What does liquidity mean for accounting purposes? In what order should assets be listed on the balance sheet? Can an account that is not listed in the chart of accounts be used to prepare journal entries? Why or why not? What does posting to the general ledger mean? What is the purpose of the trial balance?
What does a stop order to sell at $2 mean? When might it be used?
Part 1 What does a stop order to sell at $2 mean? When might it be used? Part 2Six-month call options with strike prices of $35 and $40 cost $7 and $4, respectively. What is the maximum gain when a bull spread is created from the calls?
Priority of Interrupts i. Priority values – high priority/low number User defined interrupts How does a...
Priority of Interrupts i. Priority values – high priority/low number User defined interrupts How does a high priority interrupt impact the execution of a lower priority interrupt?
What is the integrated solid waste management hierarchy, define each components in order priority.
What is the integrated solid waste management hierarchy, define each components in order priority.
What does it mean to have a good life? What does it mean to be a...
What does it mean to have a good life? What does it mean to be a good person?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT