Chapter3 CSS assignment
Chapter3 CSS assignment
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.
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:
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.
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 */
<!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>
<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>
</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;}.