Cascading Style Sheet (Css)
CSS Notes
1. Introduction to CSS
1.1 What is CSS?
- CSS (Cascading Style Sheets) is a stylesheet language used to describe the presentation of a document written in HTML or XML.
- It controls the layout, colors, fonts, and spacing of web pages.
1.2 How to Use CSS
CSS can be applied in three different ways:
- Inline CSS: Defined within the HTML elements using the
styleattribute. - Internal CSS: Defined in the
<style>tag within the<head>section of an HTML document. - External CSS: Defined in an external
.cssfile, linked to the HTML document using the<link>tag.
2. CSS Syntax
2.1 CSS Rule Structure
A CSS rule consists of two parts:
- Selector: The HTML element you want to style.
- Declaration Block: The property-value pairs that define how the element will be styled.
Example:
3. Selectors
3.1 Element Selector
Applies styles to all elements of a specific type.
3.2 ID Selector
Applies styles to an element with a specific id. The id selector is prefixed with #.
3.3 Class Selector
Applies styles to all elements with a specific class. The class selector is prefixed with ..
3.4 Universal Selector
Applies styles to all elements on the page.
3.5 Descendant Selector
Targets elements that are inside another element.
4. CSS Properties
4.1 Text Properties
- font-family: Specifies the font of text.
- font-size: Specifies the size of the text.
- font-weight: Specifies the thickness of the text.
- color: Specifies the color of the text.
4.2 Box Model Properties
The CSS box model describes the rectangular boxes generated for elements. It consists of the following:
- content: The actual content of the element.
- padding: The space between the content and the border.
- border: The border around the padding (optional).
- margin: The space outside the border.
4.3 Background Properties
- background-color: Sets the background color of an element.
- background-image: Sets a background image for an element.
- background-size: Specifies the size of the background image.
4.4 Display and Positioning
- display: Defines how an element is displayed. Common values:
block,inline,inline-block,none. - position: Specifies the position of an element. Common values:
static,relative,absolute,fixed,sticky.
4.5 Borders and Shadows
- border: Defines the border around an element.
- border-radius: Rounds the corners of the element's border.
- box-shadow: Adds shadow to an element.
5. CSS Layout Techniques
5.1 Flexbox
The Flexbox layout allows you to distribute space dynamically between elements inside a container.
5.2 Grid
The CSS Grid layout allows you to create complex grid layouts with rows and columns.
5.3 Float
The float property is used to place elements next to each other.
6. CSS Pseudo-Classes and Pseudo-Elements
6.1 Pseudo-Classes
Pseudo-classes are used to define the special state of an element.
6.2 Pseudo-Elements
Pseudo-elements are used to style specific parts of an element.
7. CSS Transitions and Animations
7.1 CSS Transitions
CSS transitions allow you to change property values smoothly over a specified duration.
7.2 CSS Animations
CSS animations allow you to create more complex and continuous animations.
8. Media Queries
Media queries are used to apply different styles to different screen sizes or devices.
Assessment: Regular Tests, Assignments, and Final Project Evaluation
Certification: Certificate of Completion from Disha Institute
Number of Days Depends on your practice and feedback. The more you practice and review your work, the faster you will complete the course.
For Batch time and Fess contact to Below Address and Number.
(MCA / Bsc. I.T / ‘A’ / ‘O’ / CCC / Govt. Certified Domain Skill Trainer )
Disha Institute 153 Vijay Nagar Opp. Rg Pg College W.K Road Meerut
(9411617329 , 9458516690)
Comments
Post a Comment