Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 10

Introduction to

CSS
Cascading Style Sheets (CSS) is a style sheet language used to
describe the presentation of a document written in a markup
language like HTML. C S S provides a way to control the visual
appearance of web pages, from layout and typography to color
and animations.

by Sebar rex
CSS Syntax: Selectors, Properties, and
Values
Selectors
1
Identify the H T M L elements to apply styles
to

Properties
2
Define the visual attributes to change

Values
3
Specify the settings for each
property

The core syntax of C S S consists of three key components: selectors, properties, and values. Selectors target the
H T M L elements that will receive the styles, properties define the visual attributes to be modified, and values
determine the specific settings for each property. This structured approach allows for precise control over the
appearance and behavior of web content.
CSS Selectors: Type, Class, ID, and
Attribute
Type
1 Selector
Targets elements by their H T M L tag name

Class Selector
2
Targets elements with a specific class attribute

ID Selector
3
Targets a unique element with a specific ID attribute

Attribute Selector
4
Targets elements based on their attribute values

C S S selectors are the fundamental building blocks that allow you to target and style specific H T M L elements on a web
page. The four main types of selectors - type, class, ID, and attribute - provide increasing levels of specificity and
control over which elements are affected by your C S S rules.
CSS Properties:
Typography
Font Family Font Weight
Choose a font family that matches the tone and Adjust font weight to emphasize important text
style of your design. Common options include serif, and create visual contrast. Thin, regular, bold, and
sans- serif, and monospace. black are common weight options.

1 2 3

Font Size
Set font sizes to create a consistent hierarchy and
improve readability. Use a combination of headings,
body text, and other sizes.
CSS Properties: Color and
Background
1 3
2
Color Background Color Background Image
C S S provides extensive color The background-color property sets The background-image property
options, from basic named the background color of an allows you to set an image as
colors to advanced hex, RGB, element. This can be used to the background of an element.
and H SL values. Colors can be create solid color backgrounds or These images can be
applied to text, backgrounds, even linear and radial gradients. positioned, sized, and repeated
borders, and more. to create visually appealing
designs.
CSS Properties: Box
Model
Content
1
The innermost layer of the box model, containing the actual
content.

Padding
2
The space between the content and the border.

Border
3
The line surrounding the padding and
content.

Margin
4 The space outside the border, separating the box from
other elements.

The C S S box model defines how elements are sized and positioned on the page. It consists of four key properties -
content, padding, border, and margin. Understanding how to control these elements is essential for creating
visually appealing and well-structured web layouts.
CSS Properties: Layout and
Positioning
Static Positioning
1 The default positioning method

Relative Positioning
2
Moves elements relative to their normal position

Absolute Positioning
3
Positions elements relative to their nearest positioned ancestor

Fixed Positioning
4
Positions elements relative to the viewport

Sticky Positioning
5
Combines relative and fixed positioning

C S S provides powerful layout and positioning tools to control the placement and behavior of elements on a web
page. Static, relative, absolute, fixed, and sticky positioning give you granular control over how your content is
displayed.
Mastering these techniques is essential for creating complex, responsive web designs.
CSS Properties: Responsive
Design
Flexible Layout
1
Use C S S grid and flexbox to create a layout that adapts to
different screen sizes, ensuring your content looks great on any
device.

Fluid Typography
2
Adjust font sizes with viewport-relative units like 'vw' and 'vh' to
scale text dynamically as the screen size changes.

Responsive Images
3
Implement responsive image techniques like 'srcset' and 'sizes' to
serve the optimum image file for each device, improving load
times and visual quality.
CSS Inheritance and
Cascading
Inheritance

1 C S S properties can be inherited by child elements from their parent elements, allowing for efficient
and consistent styling across a web page.

Cascading

2 When multiple C S S rules apply to the same element, the cascade order determines which styles
take precedence, based on factors like specificity and order of appearance.

Specificity

3 The specificity of a C S S selector determines its priority - the more specific the selector, the higher
its precedence in the cascade.
Conclusion
and
Resources
In this presentation, we' ve covered the core concepts of C S S - its
syntax, selectors, properties, and how to use them effectively. As
you continue your web design journey, remember to explore
online tutorials, documentation, and communities to further
expand your C S S knowledge and skills.

You might also like