Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
9 views

Chapter3 CSS assignment

CSS was introduced in 1994 to provide a more efficient method for styling websites, addressing the limitations of HTML's formatting tags. The CSS syntax consists of properties, values, selectors, declaration blocks, rulesets, and comments, allowing for precise control over web page presentation. The cascading order determines how conflicting styles are resolved, prioritizing inline styles over internal and external styles, with '!important' declarations taking the highest precedence.

Uploaded by

sammythompson202
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Chapter3 CSS assignment

CSS was introduced in 1994 to provide a more efficient method for styling websites, addressing the limitations of HTML's formatting tags. The CSS syntax consists of properties, values, selectors, declaration blocks, rulesets, and comments, allowing for precise control over web page presentation. The cascading order determines how conflicting styles are resolved, prioritizing inline styles over internal and external styles, with '!important' declarations taking the highest precedence.

Uploaded by

sammythompson202
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

1. Explain why CSS was introduced to web development (10 marks).

The era of css starts in 1994, css was introduced to provide a more efficient
method for styling the display and layout of a website in conjunction with html.
HTML3.2 version had tags like <font> added to the specifications, this was a major
setback and delay for web developers due to the fact that web pages have different
fonts, colored backgrounds and multiple styles, it was a long, painful and
expensive process to rewrite the code.
CSS was first proposed by Hakon wium Lie on 10 Octorber 1994. Consortium resulted
in the first W3C CSS Recommendatuion (CSS1) being released in 1996. In particular,
a proposal by Bert Bos was influential; he also became co-author of CSS1 and is
regarded as co-creator of CSS.

2. Explaining in detail the CSS syntax (20 Marks).

The basic goal of the cascading stylesheet (CSS) Language is to allow a browser
engine to paint elements of the page with specific features like color, positioning
or decorations. CSS uses a specific syntax to apply these styles. basic building
blocks of css syntax:

i. PROPERTY: Which is an identifier, that is a human-readable name, that defines


which feature is considered. Eg: background-color, font-size,text-align etc.

ii. VALUE: It describes how the feature must be handled by the engine. Each
property has a set of valid values, defined by a formal grammar, as well as a
semantic meaning, implemented by the browser engine. Eg: center, red, blue, big,
40px etc.

iii. Selectors: Selectors are used to target HTML elements that you want to style.
they specify which elements the styles should be applied to. Selectors can be based
on HTML tag name, class names, IDs, attributes and more.

iv. Declaration Block: The combination of properties and values is called a


declaration. Declarations are enclosed within curly braces {}.

v. Ruleset or Rule: A combination of a selector and its corresponding declaration


block is called a ruleset

vi. Comments: Comments in CSS help you add notes and explanations within your code.
they are ignored by the browser and serve as reminders for yourselff or others
reading the code. /* This is a comment */

3. Style the letter writing in Chapter 2: HTML Assignment (50 Marks).

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> MENTORSHIP LETTER</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<p style="text-align: right;">
<strong><i>From</i></strong><br>SANNI OLAYINKA <BR>15, Bankolemoh street,
off Akerele. <br> Surulere,<br> Lagos.</p>
<strong> <i>To</i></strong>
<p>148/150 Bode Thomas street <br> Surulere 100269, <br> Lagos</p>
<br>
<p><i>Dear Mr. Raymond,</i> </p>
<BR>

<h1 style="text-align: center;">


<b> REQUEST FOR MENTORSHIP</b><hr></h1>
<p>Good day Mr. Raymond howre you coping and i hope this mail meets you and the
family well. Over the years ive followed your works duly and i must say i envy
every bit and im really honored to have cross paths with you sir,
as youre a very great role model in the lives of a lot of individuals both
on platforms and physically, your works have inspired and touched a lot of souls to
chase the same goal and objective that you have layed out. </p>

<p>Sir, im here to ask for an opportunity in chasing my goals as i walk in


your footsteps and achieve my dreams while giving glory to Almighty GOD and
appreciation to you for being a great part of the journey for me
. Please i ask of you to sharpen and brighten me up in every aspect as
you mentor me into being the best version of myself with programming skills that
cant be compared, a skill thatd always shine wherever it is found. </p>

<p>Thank you for this opportunity as itd be a great thing for me if you
could consider taking me as a student to inculcate your teachings,values
morals, charisma and integrity. I look forward to hearing from you.
</p>

<p style="text-align: right;"><i>Yours Sincerely</i><br> Olayinka</p>

</body>
</html>

4. Explain in detail the cascading order and how it can disrupt (20 Marks).

In CSS the term cascading refers to the way styles are applied and arranged when
multiple conflicting styles are targeting the same element. The cascading order
follows a specific set of rules to determine which style should be applied when
there are conflicting situations. This rules help to maintain a consistent way to
resolve conflicting styles. Here is the cascading order as number one has the
highest importance:
i. Inline Style
ii. Internal style
iii. External style
iv. Browser default

Here the illustration above shows that inline style has the highest priority, which
means that it will override a style defined inside the <style> tag or in an
external style sheet or a browser default. Also when a style declaration is marked
as '!important', it takes the highest priorit. This should be used carefully, as it
can override other styles. Examples: p{color:green !important;}.

You might also like