0% found this document useful (0 votes)
3 views

CSSefsfSS

CSS allows for the separation of presentation from HTML markup, simplifying the structure of HTML documents by moving styling information to external stylesheets. A CSS ruleset includes a selector, declaration, property, and property value, and is defined within curly braces. The document also explains the box model, which includes properties such as padding, border, and margin, and highlights the use of comments in CSS for documentation purposes.

Uploaded by

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

CSSefsfSS

CSS allows for the separation of presentation from HTML markup, simplifying the structure of HTML documents by moving styling information to external stylesheets. A CSS ruleset includes a selector, declaration, property, and property value, and is defined within curly braces. The document also explains the box model, which includes properties such as padding, border, and margin, and highlights the use of comments in CSS for documentation purposes.

Uploaded by

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

Before CSS, nearly all presentational attributes of HTML documents were contained

within the HTML markup. All font colors, background styles, element alignments,
borders, and sizes had to be explicitly described, often repeatedly, within the
HTML. CSS lets authors move much of that information to another file; the style
sheet, resulting in considerably simpler HTML.

Anatomy of CSS Ruleset


All CSS rulesets are wrapped in curly braces { }. They can be specified inside a
style element or inside an external CSS file. CSS layout is based on the "box"
model, with each box taking up space on the webpage having various properties like
padding (which is the space around the content e.g., the space around your
paragraph), border (this is the solid line that encircles the padding), and margin
(which is the around the outside of the border). Here's what the syntax of a
typical CSS code looks like:

body {
font-style: italic
color: blue;
}

A CSS ruleset consists of the selector, declaration, property, and the property
value. When the above CSS code is applied to an HTML document, the content of the
body element will be italic in style and blue in color. In CSS, anything specified
within the /* and */ tags is a comment. Comments are a helpful way to write notes
about your code and browsers do ignore them as they render the CSS code. Below are
the detailed analysis of a CSS ruleset 👇

You might also like