CSS Syntax and Structure
CSS Syntax and Structure
The style specification is specified differently for each different level. for example
for inline cascading style sheets the style
attribute is used to define css
<p style="font-color:#313131; font-size:30px;">This is text</p>
For the internal and external CSS, style specification,
The selector points to the HTML element you want to style.
The declaration block contains one or more declarations separated by semicolons. for ex., color:orange;
Each declaration includes a CSS property name and a value, separated by a colon.
Multiple CSS declarations are separated with semicolons, and declaration blocks are surrounded by curly braces.
Following most commonly used CSS properties
Property Type | Property |
Fonts | font font-family font-size font-style font-weight |
Text | text-align text-decoration text-indent line-height line-spacing |
Color and Background | background background-color background-image background-position backgrond-repeat color |
Borders | border border-color border-width border-style border-top border-top-color border-top-width (last three for top, bottom, left, right) |
Spacing | padding padding-bottom padding-left padding-right padding-top margin margin-bottom margin-left margin-right margin-top |
Sizing | height max-height min-height width max-width min-width |
Layout | bottom left right top clear display float overflow position visibility z-index flex |
Lists | list-style list-style-image list-style-type |
Previous: Introduction to CSS
Next: Location of CSS