207k views
1 vote
Explain Cascading Style Sheets and what they do. Describe their primary function, two effects that this function has on programming, and explain why this is such a benefit to the programmer.

User Kolosy
by
5.2k points

2 Answers

3 votes

Answer:

Cascading Style Sheets are special codes that is used to style or format a web page.

Step-by-step explanation:

fj43jf4kjfhfj4

User Lem
by
5.6k points
4 votes

Answer:

Cascading Style Sheets are special codes that is used to style or format a web page.

Step-by-step explanation:

Imagine, you have two web pages, and you have to style them both, using a single format. For example, in two linked web pages, you wanted both information, can be read in uniform colors, style and font size. It would be much easier if you apply only one formatting tag to them right? But that is not the case in HTML (Hypertext Mark Up Language). You have to create formatting tags that is mixed with them to be able to style or format the page or text. CSS can make this easier. All you have to do is use a single format the call on the style by means of tag. The purpose of this is to create uniformity to all web pages and to minimize the coder's efforts. It can also be used in formatting tables (like cellpaddings, border styles, border thickness, color and other things that requires formatting in HTML. Listed below is a sample CSS codes for two different web pages.

This file is saved as try.html

<html>

<head>

<link rel="stylesheet" type="text/css" href="style.css">

</head>

<body>

<p> The quick brown fox </p>

</body>

</html>

And another file is saved as trytwo.html

<html>

<head>

<link rel="stylesheet "type="text/css" href="style.css">

</head>

<body>

<p> Jumps over the lazy dog </p>

</body>

</html>

style.css

body{

background-color: lightblue; }

p{

color: navy; }

Both webpage will be using the same font color which is navy blue. This would prevent the coder or programmer to redo the font formatting tags.With a single file, he can re use the styles to other webpages.

It would benefit the programmer to save himself effort and time. And it would allow him to debug the codes in much easier way.

User LRE
by
5.7k points