Cascading Style Sheets (CSS)
CSS
• CSS is the language we use to style a Web
page.
• CSS stands for Cascading Style Sheets
• CSS describes how HTML elements are to be
displayed on screen, paper, or in other media
• CSS saves a lot of work. It can control the
layout of multiple web pages all at once
• External stylesheets are stored in CSS files
CSS Syntax
CSS Types, Syntax & Basic Selectors
TYPES OF CSS
1. Inline CSS
- style attribute inside HTML tag
Example: <h1 style='color:red;'>Hello</h1>
2. Internal CSS
- Written inside <style> tag in <head>
Example:
<style>
h1 { color: blue; }
</style>
3. External CSS
- Separate .css file linked to HTML
Example:
<link rel='stylesheet' href='[Link]'>
Text (Font Family)
CSS Colours
Box Model
CSS Background Properties
• background-color
• background-image
• background-repeat
• background-attachment
• background-position
• body {
background-color: lightblue;
}
CSS Borders
• The border-style property specifies what kind of border to display.
• The following values are allowed:
• dotted - Defines a dotted border
• dashed - Defines a dashed border
• solid - Defines a solid border
• double - Defines a double border
• groove - Defines a 3D grooved border. The effect depends on the border-color
value
• ridge - Defines a 3D ridged border. The effect depends on the border-color value
• inset - Defines a 3D inset border. The effect depends on the border-color value
• outset - Defines a 3D outset border. The effect depends on the border-color value
• none - Defines no border
• hidden - Defines a hidden border