SlideShare a Scribd company logo
Md. Ali Hosssain
Email:Students.gai@gmail.com
Phone:01731402303
1.

Types of selectors (1)
universal selector (CSS2)




1.

element type selector



1.

applies to: all elements in a page
e.g.:
* { color: red }

applies to: all elements of that type from a page (standard tags)
e.g.:
h2 { color: red }

class selector



applies to: elements defined with that class
e.g.:
.sitetitle { color: red }
HTML:
<div class=“sitetitle”>…
Types of selectors (2)
4.

ID selector




applies to: the single element with that id from the page
e.g.:
#content { color: red }
HTML:
<div id=“content”>…
4.

pseudo-element selector (CSS2)



4.

applies to: the first letter, line or child of the nominated element
e.g.:
p:first-letter { color: red }

pseudo-class selector (CSS2)





applies to: the nominated element in certain conditions
e.g.:
a:hover { color: red }
applies to: all element in a certain language
e.g.:
:lang(ro) { text-decoration: underline }
HTML:
<p xmlns="http://www.w3.org/1999/xhtml" xml:lang="ro">…
Types of selectors (3)
7.

descendant selector


applies to: an element that is a child of another element
 e.g.: p strong { color: red }
HTML: <p>This <strong>paragraph</strong> is long…
7.

parent-child selector (CSS2)


applies to: an element that is a strict child of another
element
 e.g.: body > p { color: red }
9.

Types of selectors (4)
adjacent selector (CSS2)


applies to: an element that appears in the code right after
another
 e.g.: p + span { color: red }
HTML:
<p>This is a paragraph.</p>
<span>this one will be red</span>
<span>this one not</span>
9.

attribute selector (CSS2)



applies to: elements that have a property specified or specified
with a certain value
 e.g.: input[type=“text”] { color: red }
CSS Id and Class
The id and class Selectors
In addition to setting a style for a HTML element, CSS allows you to specify
your own selectors called "id" and "class".
Example

#para1
{
text-align:center;
color:red;
}

The class Selector
The class selector is used to specify a style for a group of elements. Unlike
the id selector, the class selector is most often used on several elements.
Example

.center {text-align:center;}
The <span> and <div> Tags
 These tags are provided to allow arbitrary chunks of

HTML to be treated as elements. This is usually done in
order to apply style attributes to them, as in the preceding
example.

 A <span> ... </span> element defines an “inline”

structure, i.e. it simply defines a stretch of text. Thus it
can be used within a paragraph or table element without
affecting the flow of the text.

 A <div> ... </div> element defines a “block” structure.

Usually the browser will place line breaks before and
after this element, but otherwise it has no effect itself.
Pseudo-classes
These are like style classes, but an element

acquires a pseudo-class by user action or by a
relationship other than decadency.
In the style sheet, a pseudo-class name is

preceded by a colon.
In the HTML, the pseudo-class name is NOT

used with the affected tag, because it is implied.
Pseudo-classes
Link-related pseudo-classes

a:link
{ color : red }
Applies when the link has not yet been visited.

a:visited { color : green }
Applies when the link has been visited.

a:hover
{ color: yellow }
Applies when the mouse is over the link.
Cascading Rule

If two equally specific rules can apply to the

same element, the one that comes last in the
style sheet is used. Thus, in the example below,
a:hover must follow a:link and a:visited in order
to have effect, since a link can be both visited (or
not) and hovering. The order of the first two
doesn’t matter since they are mutually exclusive.
a:link
{ color : red }
a:visited { color : green }
a:hover
{ color : yellow }
Pseudo-elements
Closely related to pseudo-classes, in that they are
defined by relationships, not by explicit declarations. A
pseudo-element refers to a virtual element that is part
of an actual element, rather than a special case of a
whole element.
 :first-line is a pseudo-element that consists of the first

line of text in a block-level element.
 :first-letter is a pseudo-element that consists of the first

letter of the text in an element.
Pseudo-elements
p
p.initial
p.initial:first-line
uppercase }
p.initial:first-letter

{ text-indent: 1em }
{ text-indent: 0 }
{ text-transform:
{ font-size: 24pt }

This indents all normal paragraphs. A paragraph that is
declared with class="initial" is not indented, and its first
line appears in all capital letters, with an extra-large first letter.
The box model
top
margin (transparent)
border
padding

left

Content

bottom

right
Where does it apply
 Margin - Clears an area around the border. The margin does not have a

background color, it is completely transparent
 Border - A border that goes around the padding and content. The border is
affected by the background color of the box
 Padding - Clears an area around the content. The padding is affected by the
background color of the box
 Content - The content of the box, where text and images appear

width:250px;
padding:10px;
border:5px solid gray;
margin:10px;

Let's do the math:
250px (width)
+ 20px (left + right padding)
+ 10px (left + right border)
+ 20px (left + right margin)
= 300px
The margin property can have from one to four
values.
margin:25px 50px 75px 100px;
top margin is 25px
margin:25px 50px;
right margin is 50px
top and bottom margins are 25px
bottom margin is 75px
right and left margins are 50px
left margin is 100px
margin:25px 50px 75px;
top margin is 25px
right and left margins are 50px
bottom margin is 75px

margin:25px;
all four margins are 25px
Example:
Defining an unordered list style:

And writing the HTML code:
Results in:
The display property
Most used values for specifying the display type of an

element:
block – shows a separate block
 e.g. default style for h1, p, form, div

inline – displays inside a text fragment
 e.g. default style for span, em, code

list-item – used for lists
 e.g. default style for li

none
 can be applied to any element
 doesn’t show the element or the space it would take if shown
Positioning (1)
CSS2 provides four types of positioning schemes:
normal
default positioning:
 block boxes flow vertically
 inline boxes flow horizontally
Positioning (2)
relative
done by browsers in two steps:

 first, the normal flow is followed
 the box is moved according to its offset properties (top, right, left,

bottom)

Text text text text text text
text text text text text text…
Text text text text text text
text text text text text text…

paragraph with
relative
positioning,
with positive
top and left
values

Notes:
 use z-index style property to specify their order
 a specific width property might cause an offset to be ignored
Positioning (3)
absolute
the normal flow does not apply and the element is positioned

according to its offset values (top, right, bottom, left)
special case: fixed positioning – the containing block is the viewport
of the browser window
browser window
fixed position
for this
element

the rest of the
content in the
page that must
be scrolled
Scaling
There are two types of lengths units for fonts:
relative
 em: computed value of the ‘font-size’
 ex: ‘x-height’
 px: pixels, relative to the viewing device
absolute
 in: inches
 cm: centimeters
 pt: points
 pc: picas
Positioning

float

specify elements to shift either to the left or right
surrounding content flows around the opposite side
a width should be specified for a floating box

Text text text text
Text
text text text text
text
text text text text
text
text text text text
text text text text text text text
text text text text text text text

Box floating
to the right
Positioning

Note: floating boxes take no space on the vertical side
if a floating box is taller than the first surrounding block, it will float

around the next block, too
solution: clear the floating

Text text text
text text text

text
text
text
text

Text text text
text text text
text text text text text

Text text text
text text text

text
text
text
text

Text text text text text
text text text text text

clear: right
style for this
element
Css class-02
Ad

More Related Content

What's hot (20)

HTML Semantic Elements
HTML Semantic ElementsHTML Semantic Elements
HTML Semantic Elements
Reema
 
Introducing CSS Grid
Introducing CSS GridIntroducing CSS Grid
Introducing CSS Grid
Jason Yingling
 
HTML and CSS crash course!
HTML and CSS crash course!HTML and CSS crash course!
HTML and CSS crash course!
Ana Cidre
 
Introduction to CSS Grid Layout
Introduction to CSS Grid LayoutIntroduction to CSS Grid Layout
Introduction to CSS Grid Layout
Rachel Andrew
 
Flex box
Flex boxFlex box
Flex box
Harish Karthick
 
CSS Lists and Tables
CSS Lists and TablesCSS Lists and Tables
CSS Lists and Tables
Gerson Abesamis
 
Css
CssCss
Css
shanmuga rajan
 
CSS
CSSCSS
CSS
Raja Kumar Ranjan
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
eShikshak
 
Jquery
JqueryJquery
Jquery
Girish Srivastava
 
CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout
Rachel Andrew
 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
Amit Kumar Singh
 
CSS
CSSCSS
CSS
Vladimir Zhidal
 
Introduction to flexbox
Introduction  to  flexboxIntroduction  to  flexbox
Introduction to flexbox
Jyoti Gautam
 
Html ppt
Html pptHtml ppt
Html ppt
Ruchi Kumari
 
Css selectors
Css selectorsCss selectors
Css selectors
Parth Trivedi
 
Css3
Css3Css3
Css3
Deepak Mangal
 
Css Display Property
Css Display PropertyCss Display Property
Css Display Property
Webtech Learning
 
CSS Positioning and Features of CSS3
CSS Positioning and Features of CSS3CSS Positioning and Features of CSS3
CSS Positioning and Features of CSS3
Jaimin Brahmbhatt
 
Css floats
Css floatsCss floats
Css floats
Webtech Learning
 

Viewers also liked (20)

Css2
Css2Css2
Css2
Abhishek Kesharwani
 
CSS 3 Overview
CSS 3 OverviewCSS 3 Overview
CSS 3 Overview
Owen Williams
 
CSS3 : Animation ,Transitions, Gradients
CSS3 : Animation ,Transitions, GradientsCSS3 : Animation ,Transitions, Gradients
CSS3 : Animation ,Transitions, Gradients
Jatin_23
 
New Elements & Features in CSS3
New Elements & Features in CSS3New Elements & Features in CSS3
New Elements & Features in CSS3
Jamshid Hashimi
 
Css2
Css2Css2
Css2
Ynon Perek
 
Css3 animation
Css3 animationCss3 animation
Css3 animation
Ted Hsu
 
Intro to CSS3
Intro to CSS3Intro to CSS3
Intro to CSS3
Denise Jacobs
 
Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3
Pradeep Varadaraja Banavara
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
Chris Poteet
 
CSS ppt
CSS pptCSS ppt
CSS ppt
Sanmuga Nathan
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
abhilashagupta
 
Biodiesel Use, Handling, and Fuel Quality
Biodiesel Use, Handling, and Fuel QualityBiodiesel Use, Handling, and Fuel Quality
Biodiesel Use, Handling, and Fuel Quality
Gardening
 
Sorghum Syrup
Sorghum SyrupSorghum Syrup
Sorghum Syrup
Gardening
 
Squash Bug and Squash Vine Borer: Organic Controls
Squash Bug and Squash Vine Borer: Organic ControlsSquash Bug and Squash Vine Borer: Organic Controls
Squash Bug and Squash Vine Borer: Organic Controls
Gardening
 
Bug Vacuums for Organic Crop Protection
Bug Vacuums for Organic Crop ProtectionBug Vacuums for Organic Crop Protection
Bug Vacuums for Organic Crop Protection
Gardening
 
Fiji luncheon presentation
Fiji luncheon presentationFiji luncheon presentation
Fiji luncheon presentation
Martin Chvoj
 
Konsultupphandling enligt abk09
Konsultupphandling enligt abk09Konsultupphandling enligt abk09
Konsultupphandling enligt abk09
Interaktiva Möten
 
5th sunday in ordinary time feb9, 2014
5th sunday in ordinary time feb9, 20145th sunday in ordinary time feb9, 2014
5th sunday in ordinary time feb9, 2014
Parish of Mary the Immaculate Conception
 
6th sunday in ordinary time feb16, 2014
6th sunday in ordinary time feb16, 20146th sunday in ordinary time feb16, 2014
6th sunday in ordinary time feb16, 2014
Parish of Mary the Immaculate Conception
 
Plain text
Plain textPlain text
Plain text
Profess Moravec
 
Ad

Similar to Css class-02 (20)

5. Web Technology CSS Advanced
5. Web Technology CSS Advanced 5. Web Technology CSS Advanced
5. Web Technology CSS Advanced
Jyoti Yadav
 
Fundamental of Web Development Tutorials-CSS by PINFO Technologies.pptx
Fundamental of Web Development Tutorials-CSS by PINFO Technologies.pptxFundamental of Web Development Tutorials-CSS by PINFO Technologies.pptx
Fundamental of Web Development Tutorials-CSS by PINFO Technologies.pptx
umoren
 
Lecture2 CSS 2
Lecture2  CSS 2Lecture2  CSS 2
Lecture2 CSS 2
Sur College of Applied Sciences
 
Basic css
Basic cssBasic css
Basic css
Gopinath Ambothi
 
Css Introduction
Css IntroductionCss Introduction
Css Introduction
SathyaseelanK1
 
Css from scratch
Css from scratchCss from scratch
Css from scratch
Ahmad Al-ammar
 
Web engineering
Web engineeringWeb engineering
Web engineering
Syed Nouman Ali Shah
 
Web 2 | CSS - Cascading Style Sheets
Web 2 | CSS - Cascading Style SheetsWeb 2 | CSS - Cascading Style Sheets
Web 2 | CSS - Cascading Style Sheets
Mohammad Imam Hossain
 
Css
CssCss
Css
Rathan Raj
 
Css basics
Css basicsCss basics
Css basics
mirza asif haider
 
Web Programming-css.pptx
Web Programming-css.pptxWeb Programming-css.pptx
Web Programming-css.pptx
MarwaAnany1
 
Css selectors
Css selectorsCss selectors
Css selectors
Dinesh Kumar
 
Lec 1
Lec 1Lec 1
Lec 1
maamir farooq
 
Css advanced – session 4
Css advanced – session 4Css advanced – session 4
Css advanced – session 4
Dr. Ramkumar Lakshminarayanan
 
Css
CssCss
Css
Er. Nawaraj Bhandari
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
Amit Tyagi
 
Art of css
Art of cssArt of css
Art of css
Raphael Wanjiku
 
Css advanced – session 5
Css advanced – session 5Css advanced – session 5
Css advanced – session 5
Dr. Ramkumar Lakshminarayanan
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
M Vishnuvardhan Reddy
 
CSS
CSSCSS
CSS
ARJUN
 
Ad

More from Md Ali Hossain (20)

Job environment (for new employee)
Job  environment (for new employee) Job  environment (for new employee)
Job environment (for new employee)
Md Ali Hossain
 
Web offset presses
Web offset pressesWeb offset presses
Web offset presses
Md Ali Hossain
 
Modern printing technologies
Modern printing technologiesModern printing technologies
Modern printing technologies
Md Ali Hossain
 
Screen printing
Screen printingScreen printing
Screen printing
Md Ali Hossain
 
Color
ColorColor
Color
Md Ali Hossain
 
Flexography
FlexographyFlexography
Flexography
Md Ali Hossain
 
Offset printing platon press
Offset printing platon pressOffset printing platon press
Offset printing platon press
Md Ali Hossain
 
Flexographic printing 1(9551)
Flexographic printing 1(9551)Flexographic printing 1(9551)
Flexographic printing 1(9551)
Md Ali Hossain
 
Press mentainense(9553)
Press mentainense(9553)Press mentainense(9553)
Press mentainense(9553)
Md Ali Hossain
 
Flexographic printing 1(9551)
Flexographic printing 1(9551)Flexographic printing 1(9551)
Flexographic printing 1(9551)
Md Ali Hossain
 
Special printing
Special printingSpecial printing
Special printing
Md Ali Hossain
 
Web authoring design-basics
Web authoring design-basicsWeb authoring design-basics
Web authoring design-basics
Md Ali Hossain
 
Site designer
Site designerSite designer
Site designer
Md Ali Hossain
 
Webdesign
WebdesignWebdesign
Webdesign
Md Ali Hossain
 
Httml flash
Httml flashHttml flash
Httml flash
Md Ali Hossain
 
Html class-07
Html class-07Html class-07
Html class-07
Md Ali Hossain
 
Html class-04
Html class-04Html class-04
Html class-04
Md Ali Hossain
 
Html class-02
Html class-02Html class-02
Html class-02
Md Ali Hossain
 
Css class-01
Css class-01Css class-01
Css class-01
Md Ali Hossain
 

Recently uploaded (20)

RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
James Anderson
 
How to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabberHow to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabber
eGrabber
 
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Mike Mingos
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
An Overview of Salesforce Health Cloud & How is it Transforming Patient Care
An Overview of Salesforce Health Cloud & How is it Transforming Patient CareAn Overview of Salesforce Health Cloud & How is it Transforming Patient Care
An Overview of Salesforce Health Cloud & How is it Transforming Patient Care
Cyntexa
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
IT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information TechnologyIT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information Technology
SHEHABALYAMANI
 
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
João Esperancinha
 
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdfKit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Wonjun Hwang
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
IT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information TechnologyIT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information Technology
SHEHABALYAMANI
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
Cybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and MitigationCybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and Mitigation
VICTOR MAESTRE RAMIREZ
 
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz
 
Artificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptxArtificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptx
03ANMOLCHAURASIYA
 
Bepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firmBepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firm
Benard76
 
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à GenèveUiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPathCommunity
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
James Anderson
 
How to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabberHow to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabber
eGrabber
 
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Mike Mingos
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
An Overview of Salesforce Health Cloud & How is it Transforming Patient Care
An Overview of Salesforce Health Cloud & How is it Transforming Patient CareAn Overview of Salesforce Health Cloud & How is it Transforming Patient Care
An Overview of Salesforce Health Cloud & How is it Transforming Patient Care
Cyntexa
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
IT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information TechnologyIT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information Technology
SHEHABALYAMANI
 
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
João Esperancinha
 
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdfKit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Wonjun Hwang
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
IT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information TechnologyIT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information Technology
SHEHABALYAMANI
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
Cybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and MitigationCybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and Mitigation
VICTOR MAESTRE RAMIREZ
 
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz
 
Artificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptxArtificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptx
03ANMOLCHAURASIYA
 
Bepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firmBepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firm
Benard76
 
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à GenèveUiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPathCommunity
 

Css class-02

  • 2. 1. Types of selectors (1) universal selector (CSS2)   1. element type selector   1. applies to: all elements in a page e.g.: * { color: red } applies to: all elements of that type from a page (standard tags) e.g.: h2 { color: red } class selector   applies to: elements defined with that class e.g.: .sitetitle { color: red } HTML: <div class=“sitetitle”>…
  • 3. Types of selectors (2) 4. ID selector   applies to: the single element with that id from the page e.g.: #content { color: red } HTML: <div id=“content”>… 4. pseudo-element selector (CSS2)   4. applies to: the first letter, line or child of the nominated element e.g.: p:first-letter { color: red } pseudo-class selector (CSS2)     applies to: the nominated element in certain conditions e.g.: a:hover { color: red } applies to: all element in a certain language e.g.: :lang(ro) { text-decoration: underline } HTML: <p xmlns="http://www.w3.org/1999/xhtml" xml:lang="ro">…
  • 4. Types of selectors (3) 7. descendant selector  applies to: an element that is a child of another element  e.g.: p strong { color: red } HTML: <p>This <strong>paragraph</strong> is long… 7. parent-child selector (CSS2)  applies to: an element that is a strict child of another element  e.g.: body > p { color: red }
  • 5. 9. Types of selectors (4) adjacent selector (CSS2)  applies to: an element that appears in the code right after another  e.g.: p + span { color: red } HTML: <p>This is a paragraph.</p> <span>this one will be red</span> <span>this one not</span> 9. attribute selector (CSS2)  applies to: elements that have a property specified or specified with a certain value  e.g.: input[type=“text”] { color: red }
  • 6. CSS Id and Class The id and class Selectors In addition to setting a style for a HTML element, CSS allows you to specify your own selectors called "id" and "class". Example #para1 { text-align:center; color:red; } The class Selector The class selector is used to specify a style for a group of elements. Unlike the id selector, the class selector is most often used on several elements. Example .center {text-align:center;}
  • 7. The <span> and <div> Tags  These tags are provided to allow arbitrary chunks of HTML to be treated as elements. This is usually done in order to apply style attributes to them, as in the preceding example.  A <span> ... </span> element defines an “inline” structure, i.e. it simply defines a stretch of text. Thus it can be used within a paragraph or table element without affecting the flow of the text.  A <div> ... </div> element defines a “block” structure. Usually the browser will place line breaks before and after this element, but otherwise it has no effect itself.
  • 8. Pseudo-classes These are like style classes, but an element acquires a pseudo-class by user action or by a relationship other than decadency. In the style sheet, a pseudo-class name is preceded by a colon. In the HTML, the pseudo-class name is NOT used with the affected tag, because it is implied.
  • 9. Pseudo-classes Link-related pseudo-classes a:link { color : red } Applies when the link has not yet been visited. a:visited { color : green } Applies when the link has been visited. a:hover { color: yellow } Applies when the mouse is over the link.
  • 10. Cascading Rule If two equally specific rules can apply to the same element, the one that comes last in the style sheet is used. Thus, in the example below, a:hover must follow a:link and a:visited in order to have effect, since a link can be both visited (or not) and hovering. The order of the first two doesn’t matter since they are mutually exclusive. a:link { color : red } a:visited { color : green } a:hover { color : yellow }
  • 11. Pseudo-elements Closely related to pseudo-classes, in that they are defined by relationships, not by explicit declarations. A pseudo-element refers to a virtual element that is part of an actual element, rather than a special case of a whole element.  :first-line is a pseudo-element that consists of the first line of text in a block-level element.  :first-letter is a pseudo-element that consists of the first letter of the text in an element.
  • 12. Pseudo-elements p p.initial p.initial:first-line uppercase } p.initial:first-letter { text-indent: 1em } { text-indent: 0 } { text-transform: { font-size: 24pt } This indents all normal paragraphs. A paragraph that is declared with class="initial" is not indented, and its first line appears in all capital letters, with an extra-large first letter.
  • 13. The box model top margin (transparent) border padding left Content bottom right
  • 14. Where does it apply  Margin - Clears an area around the border. The margin does not have a background color, it is completely transparent  Border - A border that goes around the padding and content. The border is affected by the background color of the box  Padding - Clears an area around the content. The padding is affected by the background color of the box  Content - The content of the box, where text and images appear width:250px; padding:10px; border:5px solid gray; margin:10px; Let's do the math: 250px (width) + 20px (left + right padding) + 10px (left + right border) + 20px (left + right margin) = 300px
  • 15. The margin property can have from one to four values. margin:25px 50px 75px 100px; top margin is 25px margin:25px 50px; right margin is 50px top and bottom margins are 25px bottom margin is 75px right and left margins are 50px left margin is 100px margin:25px 50px 75px; top margin is 25px right and left margins are 50px bottom margin is 75px margin:25px; all four margins are 25px
  • 16. Example: Defining an unordered list style: And writing the HTML code:
  • 18. The display property Most used values for specifying the display type of an element: block – shows a separate block  e.g. default style for h1, p, form, div inline – displays inside a text fragment  e.g. default style for span, em, code list-item – used for lists  e.g. default style for li none  can be applied to any element  doesn’t show the element or the space it would take if shown
  • 19. Positioning (1) CSS2 provides four types of positioning schemes: normal default positioning:  block boxes flow vertically  inline boxes flow horizontally
  • 20. Positioning (2) relative done by browsers in two steps:  first, the normal flow is followed  the box is moved according to its offset properties (top, right, left, bottom) Text text text text text text text text text text text text… Text text text text text text text text text text text text… paragraph with relative positioning, with positive top and left values Notes:  use z-index style property to specify their order  a specific width property might cause an offset to be ignored
  • 21. Positioning (3) absolute the normal flow does not apply and the element is positioned according to its offset values (top, right, bottom, left) special case: fixed positioning – the containing block is the viewport of the browser window browser window fixed position for this element the rest of the content in the page that must be scrolled
  • 22. Scaling There are two types of lengths units for fonts: relative  em: computed value of the ‘font-size’  ex: ‘x-height’  px: pixels, relative to the viewing device absolute  in: inches  cm: centimeters  pt: points  pc: picas
  • 23. Positioning float specify elements to shift either to the left or right surrounding content flows around the opposite side a width should be specified for a floating box Text text text text Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text Box floating to the right
  • 24. Positioning Note: floating boxes take no space on the vertical side if a floating box is taller than the first surrounding block, it will float around the next block, too solution: clear the floating Text text text text text text text text text text Text text text text text text text text text text text Text text text text text text text text text text Text text text text text text text text text text clear: right style for this element
  翻译: