SlideShare a Scribd company logo
CSS: Styling The Website
Learn the foundation of web development
Organised by: GDG-SRGI & Coding Club
Harsh Agarwal
Speaker
(Web Dev Lead)
Er. Aman Saluja
Faculty Advisor
Session 2
• Introduction to CSS
• Basics of CSS
What We’ll Cover Today:
• Doubts
• Basic to CSS
What is CSS?
• Definition: CSS (Cascading Style Sheets) is a stylesheet language that describes the
presentation of HTML documents, enabling separation of content and design.
• Purpose: It enhances the visual appeal of web pages by styling elements like fonts,
colors, margins, and layouts.
• Types: CSS can be applied as Inline, Internal, or External stylesheets for flexibility
and reusability.
• Advantages: Ensures consistency, supports responsive design, and simplifies
web development.
Introduction to CSS
Types of CSS
Inline CSS
•Applied directly within an HTML element using the style attribute.
Internal CSS
•Written inside a <style> tag within the <head> section of an HTML document.
.
External CSS
•Stored in a separate .css file and linked using the <link> tag.
• The <link> tag is used to connect external files like stylesheets (CSS) to
your HTML document.
Attributes
• rel: Specifies the relationship between the current document and
the linked file. For CSS, use stylesheet.
• href: Specifies the URL or path to the file.
• type (optional): Defines the MIME type, usually text/css.
Adding a Link to a CSS File
gdg_workshop 4 on web development HTML & CSS
Adding a Hyperlink to Another Page
• The <a> tag creates clickable links to navigate to other pages or resources.
Adding a Favicon (Browser Tab Icon)
•Use <link> to add a small icon displayed on the browser tab.
Linking Other Resources (e.g., Fonts)
• You can use <link> to add external resources like fonts.
COMMENTS
• Comments in CSS are used to explain code, make notes, or disable lines
during debugging. They are ignored by browsers and improve code
readability.
CSS Colors:
Implementation
1. Named Colors: Use predefined color names.
2. Hexadecimal: Use hex codes for precision
3. RGB/RGBA: Specify colors using red, green, blue, and alpha
for transparency.
Gradient: Smooth color transitions.
Shadow: Adds depth to elements.
1.Text Shadow:
2.Box Shadow:
BACKGROUND AND
BACKGROUND IMAGE
CSS background allows styling of elements' backgrounds with color, images,
gradients, or patterns.
• Background Color:
• Background Image
Box Model
The CSS box model consists of:
•Content: The actual element content.
•Padding: Space between content and border.
•Border: Edge around the padding.
•Margin: Space outside the border
Diagram:
This defines spacing and layout control for elements
BORDER AND ITS SHORTCUT
CSS Border:
The border property defines the edge around an element,
controlling its style, width, and color.
Individual Properties:
•border-width: Thickness of the border.
•border-style: Type of border (solid, dotted, dashed, etc.).
•border-color: Color of the border.
•Shortcut Syntax:
•Combine all properties in one line.
This creates a black, solid border with a width of 2 pixels. Simplifies code for clean layouts.
MARGINS ALL 4 AND THEIR
SHORCUT
CSS Margins:
The margin property defines the space outside an element's border, creating
separation between elements. Margins can be set for each side individually or
using a shorthand.
Individual Margin Properties
1. margin-top: Sets the top margin.
2.margin-right: Sets the right margin.
3.margin-bottom: Sets the bottom margin
4.margin-left: Sets the left margin.
Shorthand Syntax
Combine all margins into one property. The values are applied
in clockwise order: top, right, bottom, left.Syntax:
gdg_workshop 4 on web development HTML & CSS
Auto Margin
Set margin: auto for automatic horizontal centering, commonly used with block
elements. Margins are essential for creating balanced layouts and controlling
spacing between elements effectively.
PADDING ALL 4 AND THEIR
SHORCUT
CSS Padding:
Padding refers to the space between an element's content and its border, ensuring proper
spacing inside the element. You can set padding for each side individually or use a
shorthand for convenience.
Individual Padding Properties:
1. padding-top: Sets the space above the content.
2.padding-right: Sets the space to the right of the content.
3.padding-bottom: Sets the space below the content.
4.padding-left: Sets the space to the left of the content.
Shorthand Syntax:
Combine all padding values into a single property. The values
are applied in clockwise order: top, right, bottom, left.Syntax:
Examples
HEIGHT AND WIDTH
CSS Height and Width:
The height and width properties are used to define the size of an element. These
properties determine how much space an element occupies in a web layout,
either fixed, flexible, or relative to its container.
Types of Values
1. Fixed Values: Use specific units like px, em, rem, or cm to
set a precise size.
2.Percentage (%):The size is relative to the parent element's dimensions.
3.Auto:Automatically adjusts size based on content.
4.Max/Min Properties:
Control the maximum and minimum dimensions of an element.
Importance
•Helps create responsive layouts.
•Defines proportions for elements.
•Ensures proper alignment and spacing.
•Height and width are crucial for controlling design structure
and maintaining a user-friendly layout.
TEXT
CSS Text Properties:
CSS provides various text properties to style and control text appearance,
enhancing readability and aesthetics.
Common Text Properties
1.color: Sets the text color.
2. font-size: Specifies text size in units like px, em, %, etc.
3.font-family: Defines the font style
4.text-align: Aligns text (left, right, center, or justify).
5.line-height: Adjusts the space between lines.
6.text-decoration: Adds or removes effects like underline, overline, or
strike-through.
7.text-transform: Changes text case (uppercase, lowercase,
capitalize).
Text properties help create visually appealing and readable
content, aligning with design goals.
FONT
CSS Font Properties:
CSS font properties control the appearance and style of text, allowing designers to
create visually appealing typography.
Common Font Properties
1. font-family: Specifies the font type, using a primary font and
fallback options.
2. font-size: Sets the size of the font, using units like px, em, %,
or rem.
3.font-weight: Defines the thickness of text (e.g., normal, bold,
lighter, or numeric values like 400, 700).
4.font-style: Sets the font to normal, italic, or oblique.
5.font-variant: Controls small-caps text.
6.Shorthand Property: Combines multiple font properties.
Font properties enhance text appearance, improving readability and aligning with
the design's tone and style.
LINKS
Common Link Properties
1. color: Sets the color of the link text.
CSS Links Properties:
CSS offers several ways to style and control the appearance of links (<a> elements),
improving the user experience and design.
2. text-decoration: Controls text effects like underline, overline, or none.
3.hover: Changes link appearance when hovered.
4. active: Styles the link when clicked.
5. visited: Alters the color of a link once it has been visited.
By applying these properties, you can create visually appealing and interactive
links that provide better navigation and design.
DISPLAY:RELATIVE AND ITS ALL TYPES
AND DETAILS WITH EXAMPLE
CSS Display Property: Relative and Its Types
The display property in CSS controls the layout behavior of an element. It
determines how the element behaves in the document flow, either as a block,
inline, or other layout types
position: relative
Definition: The relative position property allows an element to be positioned
relative to its normal position in the document flow. It does not remove the
element from the flow, so other elements are positioned around it as though it
hasn't been moved.
Usage:
In this example, the element will be shifted 20px down and 30px to the right from
where it would normally be placed. The space originally allocated for it
remains unchanged.
Types of display Property:
1.block:
Makes an element a block-level element, occupying the full width and starting on a
new line.
Example:
2. inline:
Makes an element inline, so it only takes up as much width as necessary and does not
start on a new line.
Example:
3. inline-block:
Combines properties of both block and inline. Elements behave like inline elements
but can have width and height values.
Example:
4. none:
Hides the element completely, removing it from the document flow.
Example:
5. flex:
Defines a flex container, making its children flexible and aligned
according to the flex model.
Example:
6.grid:
Defines a grid container, enabling a grid-based layout for its children.
Example:
By using these display types, you can control how elements are displayed, allowing
for responsive and dynamic layouts.
POSITION
The position property determines how an element is positioned within the document.
Types:
static (default):
Elements are positioned in the normal document flow.relative:
Positioned relative to its normal position
absolute: Positioned relative to the nearest positioned ancestor.fixed: Positioned
relative to the viewport, not scrolling with the page.sticky: Toggles between
relative and fixed based on scroll position
CSS Z-Index
The z-index property controls the stack order of elements on the web page, determining
which element appears in front or behind others.Higher Values: Elements with higher z-
index appear on top.Default: The default value is auto.Usage:
It works only on positioned elements (relative, absolute, fixed). Useful for overlapping
content like modals, tooltips, or banners.
Overflow
CSS Overflow
The overflow property manages how content exceeding an element's
dimensions is displayed.
Values:
•visible (default): Content spills outside the element.
•hidden: Hides overflowing content.
•scroll: Adds scrollbars for overflowing content.
•auto: Adds scrollbars only if content overflows
FLOAT
CSS Float
The float property is used to position elements to the left or right of their container,
allowing other elements to flow around them.
Values:
left: Floats the element to the left.
right: Floats the element to the right.
none: Default; no floating.
INLINE,BLOCK
CSS Inline and Block Elements
HTML elements are categorized as inline or block based on their display behavior.
Inline Elements
Do not start on a new line.
Take up only as much width as necessary.
Cannot have width or height applied directly.
Examples: <span>, <a>, <strong>
gdg_workshop 4 on web development HTML & CSS
THANK YOU!!
gdg_workshop 4 on web development HTML & CSS
Ad

More Related Content

Similar to gdg_workshop 4 on web development HTML & CSS (20)

Css
CssCss
Css
Er. Nawaraj Bhandari
 
css3.pptx
css3.pptxcss3.pptx
css3.pptx
ThiyaguPappu
 
Css from scratch
Css from scratchCss from scratch
Css from scratch
Ahmad Al-ammar
 
Css
CssCss
Css
Balakumaran Arunachalam
 
Unit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptxUnit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptx
Tanu524249
 
CSS Introduction
CSS Introduction CSS Introduction
CSS Introduction
Thapar Institute
 
Working-With-The-Box-Model-Lesson-5.pptx
Working-With-The-Box-Model-Lesson-5.pptxWorking-With-The-Box-Model-Lesson-5.pptx
Working-With-The-Box-Model-Lesson-5.pptx
AxestetikrieyHales
 
CASCADING STYLE SHEETS (CSS).pptx
CASCADING STYLE SHEETS (CSS).pptxCASCADING STYLE SHEETS (CSS).pptx
CASCADING STYLE SHEETS (CSS).pptx
Asmr17
 
Cascading style sheet
Cascading style sheetCascading style sheet
Cascading style sheet
Michael Jhon
 
Css jon duckett - flashcards
Css   jon duckett - flashcardsCss   jon duckett - flashcards
Css jon duckett - flashcards
Chirag Aggarwal
 
CSS.pptx
CSS.pptxCSS.pptx
CSS.pptx
RasheedMohammad6
 
CSS
CSSCSS
CSS
People Strategists
 
Unit 2 WT-CSS.pptx web technology project
Unit 2 WT-CSS.pptx web technology projectUnit 2 WT-CSS.pptx web technology project
Unit 2 WT-CSS.pptx web technology project
abhiramhatwar
 
CSS3 basics for beginners - Imrokraft
CSS3 basics for beginners - ImrokraftCSS3 basics for beginners - Imrokraft
CSS3 basics for beginners - Imrokraft
imrokraft
 
CSS document। .pptx
CSS document।                       .pptxCSS document।                       .pptx
CSS document। .pptx
ayanshaikh0054
 
Introduction of css
Introduction of cssIntroduction of css
Introduction of css
Dinesh Kumar
 
Journey To The Front End World - Part2 - The Cosmetic
Journey To The Front End World - Part2 - The  CosmeticJourney To The Front End World - Part2 - The  Cosmetic
Journey To The Front End World - Part2 - The Cosmetic
Irfan Maulana
 
Introduction 2 css
Introduction 2 cssIntroduction 2 css
Introduction 2 css
Md Tarik Mahmud
 
Chapter 11: Intro to CSS
Chapter 11: Intro to CSSChapter 11: Intro to CSS
Chapter 11: Intro to CSS
Steve Guinan
 
lecture CSS 1-2_2022_2023.pptx
lecture CSS 1-2_2022_2023.pptxlecture CSS 1-2_2022_2023.pptx
lecture CSS 1-2_2022_2023.pptx
zheerhimdad
 
Unit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptxUnit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptx
Tanu524249
 
Working-With-The-Box-Model-Lesson-5.pptx
Working-With-The-Box-Model-Lesson-5.pptxWorking-With-The-Box-Model-Lesson-5.pptx
Working-With-The-Box-Model-Lesson-5.pptx
AxestetikrieyHales
 
CASCADING STYLE SHEETS (CSS).pptx
CASCADING STYLE SHEETS (CSS).pptxCASCADING STYLE SHEETS (CSS).pptx
CASCADING STYLE SHEETS (CSS).pptx
Asmr17
 
Cascading style sheet
Cascading style sheetCascading style sheet
Cascading style sheet
Michael Jhon
 
Css jon duckett - flashcards
Css   jon duckett - flashcardsCss   jon duckett - flashcards
Css jon duckett - flashcards
Chirag Aggarwal
 
Unit 2 WT-CSS.pptx web technology project
Unit 2 WT-CSS.pptx web technology projectUnit 2 WT-CSS.pptx web technology project
Unit 2 WT-CSS.pptx web technology project
abhiramhatwar
 
CSS3 basics for beginners - Imrokraft
CSS3 basics for beginners - ImrokraftCSS3 basics for beginners - Imrokraft
CSS3 basics for beginners - Imrokraft
imrokraft
 
Introduction of css
Introduction of cssIntroduction of css
Introduction of css
Dinesh Kumar
 
Journey To The Front End World - Part2 - The Cosmetic
Journey To The Front End World - Part2 - The  CosmeticJourney To The Front End World - Part2 - The  Cosmetic
Journey To The Front End World - Part2 - The Cosmetic
Irfan Maulana
 
Chapter 11: Intro to CSS
Chapter 11: Intro to CSSChapter 11: Intro to CSS
Chapter 11: Intro to CSS
Steve Guinan
 
lecture CSS 1-2_2022_2023.pptx
lecture CSS 1-2_2022_2023.pptxlecture CSS 1-2_2022_2023.pptx
lecture CSS 1-2_2022_2023.pptx
zheerhimdad
 

More from SaniyaKhan484230 (7)

solution challenge tech winter break GDG Sr Group of institution
solution challenge tech winter break GDG Sr Group of institutionsolution challenge tech winter break GDG Sr Group of institution
solution challenge tech winter break GDG Sr Group of institution
SaniyaKhan484230
 
gdg_workshop 5 on web development HTML & CSS
gdg_workshop 5 on web development HTML & CSSgdg_workshop 5 on web development HTML & CSS
gdg_workshop 5 on web development HTML & CSS
SaniyaKhan484230
 
gdg_workshop 3 on web development HTML & CSS
gdg_workshop 3 on web development HTML & CSSgdg_workshop 3 on web development HTML & CSS
gdg_workshop 3 on web development HTML & CSS
SaniyaKhan484230
 
gdg_workshop 2 on web development and github
gdg_workshop 2 on web development and githubgdg_workshop 2 on web development and github
gdg_workshop 2 on web development and github
SaniyaKhan484230
 
gdg_workshop 1 on web development and github
gdg_workshop 1 on web development and githubgdg_workshop 1 on web development and github
gdg_workshop 1 on web development and github
SaniyaKhan484230
 
CN.pdf (1).pdf codingninjas freshman induction
CN.pdf (1).pdf codingninjas freshman inductionCN.pdf (1).pdf codingninjas freshman induction
CN.pdf (1).pdf codingninjas freshman induction
SaniyaKhan484230
 
Introduction (1)[1].pptx about GDG Info session 2024
Introduction (1)[1].pptx about GDG  Info session 2024Introduction (1)[1].pptx about GDG  Info session 2024
Introduction (1)[1].pptx about GDG Info session 2024
SaniyaKhan484230
 
solution challenge tech winter break GDG Sr Group of institution
solution challenge tech winter break GDG Sr Group of institutionsolution challenge tech winter break GDG Sr Group of institution
solution challenge tech winter break GDG Sr Group of institution
SaniyaKhan484230
 
gdg_workshop 5 on web development HTML & CSS
gdg_workshop 5 on web development HTML & CSSgdg_workshop 5 on web development HTML & CSS
gdg_workshop 5 on web development HTML & CSS
SaniyaKhan484230
 
gdg_workshop 3 on web development HTML & CSS
gdg_workshop 3 on web development HTML & CSSgdg_workshop 3 on web development HTML & CSS
gdg_workshop 3 on web development HTML & CSS
SaniyaKhan484230
 
gdg_workshop 2 on web development and github
gdg_workshop 2 on web development and githubgdg_workshop 2 on web development and github
gdg_workshop 2 on web development and github
SaniyaKhan484230
 
gdg_workshop 1 on web development and github
gdg_workshop 1 on web development and githubgdg_workshop 1 on web development and github
gdg_workshop 1 on web development and github
SaniyaKhan484230
 
CN.pdf (1).pdf codingninjas freshman induction
CN.pdf (1).pdf codingninjas freshman inductionCN.pdf (1).pdf codingninjas freshman induction
CN.pdf (1).pdf codingninjas freshman induction
SaniyaKhan484230
 
Introduction (1)[1].pptx about GDG Info session 2024
Introduction (1)[1].pptx about GDG  Info session 2024Introduction (1)[1].pptx about GDG  Info session 2024
Introduction (1)[1].pptx about GDG Info session 2024
SaniyaKhan484230
 
Ad

Recently uploaded (20)

International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)
samueljackson3773
 
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E..."Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
Infopitaara
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
theory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptxtheory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G..."Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
Infopitaara
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
some basics electrical and electronics knowledge
some basics electrical and electronics knowledgesome basics electrical and electronics knowledge
some basics electrical and electronics knowledge
nguyentrungdo88
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.
anuragmk56
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)
samueljackson3773
 
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E..."Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
Infopitaara
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
theory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptxtheory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G..."Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
Infopitaara
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
some basics electrical and electronics knowledge
some basics electrical and electronics knowledgesome basics electrical and electronics knowledge
some basics electrical and electronics knowledge
nguyentrungdo88
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.
anuragmk56
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
Ad

gdg_workshop 4 on web development HTML & CSS

  • 1. CSS: Styling The Website Learn the foundation of web development Organised by: GDG-SRGI & Coding Club
  • 2. Harsh Agarwal Speaker (Web Dev Lead) Er. Aman Saluja Faculty Advisor
  • 3. Session 2 • Introduction to CSS • Basics of CSS
  • 4. What We’ll Cover Today: • Doubts • Basic to CSS
  • 5. What is CSS? • Definition: CSS (Cascading Style Sheets) is a stylesheet language that describes the presentation of HTML documents, enabling separation of content and design. • Purpose: It enhances the visual appeal of web pages by styling elements like fonts, colors, margins, and layouts. • Types: CSS can be applied as Inline, Internal, or External stylesheets for flexibility and reusability. • Advantages: Ensures consistency, supports responsive design, and simplifies web development. Introduction to CSS
  • 6. Types of CSS Inline CSS •Applied directly within an HTML element using the style attribute. Internal CSS •Written inside a <style> tag within the <head> section of an HTML document. .
  • 7. External CSS •Stored in a separate .css file and linked using the <link> tag.
  • 8. • The <link> tag is used to connect external files like stylesheets (CSS) to your HTML document. Attributes • rel: Specifies the relationship between the current document and the linked file. For CSS, use stylesheet. • href: Specifies the URL or path to the file. • type (optional): Defines the MIME type, usually text/css. Adding a Link to a CSS File
  • 10. Adding a Hyperlink to Another Page • The <a> tag creates clickable links to navigate to other pages or resources. Adding a Favicon (Browser Tab Icon) •Use <link> to add a small icon displayed on the browser tab.
  • 11. Linking Other Resources (e.g., Fonts) • You can use <link> to add external resources like fonts.
  • 12. COMMENTS • Comments in CSS are used to explain code, make notes, or disable lines during debugging. They are ignored by browsers and improve code readability.
  • 13. CSS Colors: Implementation 1. Named Colors: Use predefined color names. 2. Hexadecimal: Use hex codes for precision
  • 14. 3. RGB/RGBA: Specify colors using red, green, blue, and alpha for transparency. Gradient: Smooth color transitions.
  • 15. Shadow: Adds depth to elements. 1.Text Shadow: 2.Box Shadow:
  • 16. BACKGROUND AND BACKGROUND IMAGE CSS background allows styling of elements' backgrounds with color, images, gradients, or patterns. • Background Color: • Background Image
  • 17. Box Model The CSS box model consists of: •Content: The actual element content. •Padding: Space between content and border. •Border: Edge around the padding. •Margin: Space outside the border Diagram: This defines spacing and layout control for elements
  • 18. BORDER AND ITS SHORTCUT CSS Border: The border property defines the edge around an element, controlling its style, width, and color. Individual Properties: •border-width: Thickness of the border. •border-style: Type of border (solid, dotted, dashed, etc.). •border-color: Color of the border. •Shortcut Syntax: •Combine all properties in one line. This creates a black, solid border with a width of 2 pixels. Simplifies code for clean layouts.
  • 19. MARGINS ALL 4 AND THEIR SHORCUT CSS Margins: The margin property defines the space outside an element's border, creating separation between elements. Margins can be set for each side individually or using a shorthand. Individual Margin Properties 1. margin-top: Sets the top margin.
  • 20. 2.margin-right: Sets the right margin. 3.margin-bottom: Sets the bottom margin
  • 21. 4.margin-left: Sets the left margin. Shorthand Syntax Combine all margins into one property. The values are applied in clockwise order: top, right, bottom, left.Syntax:
  • 23. Auto Margin Set margin: auto for automatic horizontal centering, commonly used with block elements. Margins are essential for creating balanced layouts and controlling spacing between elements effectively.
  • 24. PADDING ALL 4 AND THEIR SHORCUT CSS Padding: Padding refers to the space between an element's content and its border, ensuring proper spacing inside the element. You can set padding for each side individually or use a shorthand for convenience. Individual Padding Properties: 1. padding-top: Sets the space above the content.
  • 25. 2.padding-right: Sets the space to the right of the content. 3.padding-bottom: Sets the space below the content.
  • 26. 4.padding-left: Sets the space to the left of the content. Shorthand Syntax: Combine all padding values into a single property. The values are applied in clockwise order: top, right, bottom, left.Syntax:
  • 28. HEIGHT AND WIDTH CSS Height and Width: The height and width properties are used to define the size of an element. These properties determine how much space an element occupies in a web layout, either fixed, flexible, or relative to its container. Types of Values 1. Fixed Values: Use specific units like px, em, rem, or cm to set a precise size.
  • 29. 2.Percentage (%):The size is relative to the parent element's dimensions. 3.Auto:Automatically adjusts size based on content.
  • 30. 4.Max/Min Properties: Control the maximum and minimum dimensions of an element. Importance •Helps create responsive layouts. •Defines proportions for elements. •Ensures proper alignment and spacing. •Height and width are crucial for controlling design structure and maintaining a user-friendly layout.
  • 31. TEXT CSS Text Properties: CSS provides various text properties to style and control text appearance, enhancing readability and aesthetics. Common Text Properties 1.color: Sets the text color.
  • 32. 2. font-size: Specifies text size in units like px, em, %, etc. 3.font-family: Defines the font style
  • 33. 4.text-align: Aligns text (left, right, center, or justify). 5.line-height: Adjusts the space between lines.
  • 34. 6.text-decoration: Adds or removes effects like underline, overline, or strike-through. 7.text-transform: Changes text case (uppercase, lowercase, capitalize). Text properties help create visually appealing and readable content, aligning with design goals.
  • 35. FONT CSS Font Properties: CSS font properties control the appearance and style of text, allowing designers to create visually appealing typography. Common Font Properties 1. font-family: Specifies the font type, using a primary font and fallback options.
  • 36. 2. font-size: Sets the size of the font, using units like px, em, %, or rem. 3.font-weight: Defines the thickness of text (e.g., normal, bold, lighter, or numeric values like 400, 700).
  • 37. 4.font-style: Sets the font to normal, italic, or oblique. 5.font-variant: Controls small-caps text.
  • 38. 6.Shorthand Property: Combines multiple font properties. Font properties enhance text appearance, improving readability and aligning with the design's tone and style.
  • 39. LINKS Common Link Properties 1. color: Sets the color of the link text. CSS Links Properties: CSS offers several ways to style and control the appearance of links (<a> elements), improving the user experience and design.
  • 40. 2. text-decoration: Controls text effects like underline, overline, or none. 3.hover: Changes link appearance when hovered.
  • 41. 4. active: Styles the link when clicked. 5. visited: Alters the color of a link once it has been visited. By applying these properties, you can create visually appealing and interactive links that provide better navigation and design.
  • 42. DISPLAY:RELATIVE AND ITS ALL TYPES AND DETAILS WITH EXAMPLE CSS Display Property: Relative and Its Types The display property in CSS controls the layout behavior of an element. It determines how the element behaves in the document flow, either as a block, inline, or other layout types position: relative Definition: The relative position property allows an element to be positioned relative to its normal position in the document flow. It does not remove the element from the flow, so other elements are positioned around it as though it hasn't been moved.
  • 43. Usage: In this example, the element will be shifted 20px down and 30px to the right from where it would normally be placed. The space originally allocated for it remains unchanged.
  • 44. Types of display Property: 1.block: Makes an element a block-level element, occupying the full width and starting on a new line. Example: 2. inline: Makes an element inline, so it only takes up as much width as necessary and does not start on a new line. Example:
  • 45. 3. inline-block: Combines properties of both block and inline. Elements behave like inline elements but can have width and height values. Example:
  • 46. 4. none: Hides the element completely, removing it from the document flow. Example: 5. flex: Defines a flex container, making its children flexible and aligned according to the flex model. Example:
  • 47. 6.grid: Defines a grid container, enabling a grid-based layout for its children. Example: By using these display types, you can control how elements are displayed, allowing for responsive and dynamic layouts.
  • 48. POSITION The position property determines how an element is positioned within the document. Types: static (default): Elements are positioned in the normal document flow.relative: Positioned relative to its normal position absolute: Positioned relative to the nearest positioned ancestor.fixed: Positioned relative to the viewport, not scrolling with the page.sticky: Toggles between relative and fixed based on scroll position
  • 49. CSS Z-Index The z-index property controls the stack order of elements on the web page, determining which element appears in front or behind others.Higher Values: Elements with higher z- index appear on top.Default: The default value is auto.Usage: It works only on positioned elements (relative, absolute, fixed). Useful for overlapping content like modals, tooltips, or banners.
  • 50. Overflow CSS Overflow The overflow property manages how content exceeding an element's dimensions is displayed. Values: •visible (default): Content spills outside the element. •hidden: Hides overflowing content. •scroll: Adds scrollbars for overflowing content. •auto: Adds scrollbars only if content overflows
  • 51. FLOAT CSS Float The float property is used to position elements to the left or right of their container, allowing other elements to flow around them. Values: left: Floats the element to the left. right: Floats the element to the right. none: Default; no floating.
  • 52. INLINE,BLOCK CSS Inline and Block Elements HTML elements are categorized as inline or block based on their display behavior. Inline Elements Do not start on a new line. Take up only as much width as necessary. Cannot have width or height applied directly. Examples: <span>, <a>, <strong>