SlideShare a Scribd company logo
+
CSS Continued
Formatting Text and Links
+ Using the vertical-align Property
 Use the vertical-align property to position images and
other elements vertically with text.
 The property has several possible values:
 top – The top of the image is aligned with the text.
 middle – The image is aligned vertically centered with the text.
 bottom – The bottom of the image is aligned with the text.
+ Using the vertical-align Property
+ Using the vertical-align Property
+ The vertical-align Property Values
+
Changing the Appearance of Lists
 Lists can be enhanced by graphics and images.
 The following properties can be used:
 list-style-type: stylevalue;
 list-style-position: positionvalue;
 list-style-image: url(imagename);
 Shorthand property:
list-style: stylevalue url(imagename)
positionvalue;
+ Using the list-style-type Property
 Use the list-style-type property to change the
appearance of the default solid bullet for unordered
lists.
 There are four list-style-type values for
unordered lists:
 disc – a filled circle (the default)
 circle – a hollow circle
 square – a filled square
 none – no bullet is shown
ul {
list-style-type: value;
}
+ Using the list-style-type Property
 There are the following list-style-type values
for ordered lists:
 decimal
 decimal-leading-zero
 lower-roman
 upper-roman
 lower-alpha
 upper-alpha
 none
ol {
list-style-type: value;
}
+ Using the list-style-type Property
+Using the list-style-position Property
Use the list-style-position property
to change the position of the marker or bullet
included with a list.
There are two list-style-position
values:
 inside
 outside
+
Using Groups of Selectors
 Grouped selectors are selectors that share a common set of
declarations and that are grouped into a comma-separated list.
+
Using Descendant Selectors
 A descendant selector is a selector nested within another
selector.
 A space is used, without a comma, to indicate descendant
selectors.
 A comma is used between selectors when the style applies to
all selectors in the group.
strong em {
color: maroon;
}
+
Using Descendant Selectors
+
Styling a List of Hyperlinks
 The nav element identifies a block of navigation links.
+
Styling a List of Hyperlinks
+
CSS Inheritance
 CSS inheritance is a method whereby a child element inherits
characteristics from its parent element.
 The nav element is a parent of the ul element, and the ul element is
a parent of the li element.
+
CSS Class Selector
 A class selector is a name preceded by a period.
 This name can then be applied to any HTML element.
 Class selectors can format one or more instances of an
element.
 A class must be applied to the start tag of one or more
elements on a Web page.
 Classes can be dependent or independent.
+
Dependent Class
 A dependent class styles a particular element.
 Code syntax:
selector.dependentclass {
property1: value;
property2: value;
}
selector – the name of the element
dependentclass – the name of the dependent
class
 To apply the dependent class to an element:
<element class = "dependentclass">
+
Rules for Class Names
 A class name can contain only alphabetic or
numeric characters.
 A class name must be one word (no spaces).
 A class name should describe the purpose of the
class.
 A class name should not begin with a number
because not all browsers will recognize it.
+
Dependent Selector Code
Code to apply the attention class:
<li class = "attention">Your name and
contact information</li>
+
Independent Class
 An independent class styles any element.
 Code syntax:
selector.independentclass {
property1: value;
property2: value;
}
selector – the name of the element
independentclass – the name of the
dependent class
 To apply an independent class to any element:
<element class = "independentclass">
+
Independent Selector Code
Code to apply the center class:
+ Using the list-style-image
Property
 Use the list-style-image property to specify a graphic image
instead of a bullet marker for a list.
 Use a very small image for a bullet marker.
 Code example:
ul {
list-style-image: url(star.gif);
}
 url points to the image used as a bullet marker.
+
Using the span Element
 The span element is a generic element that does not have any
specific meaning, but it allows you to mark inline content.
 span element syntax: <span>content</span>
+
Pseudo-Class Selectors
 A pseudo-class is a class that exists in CSS but is not directly
defined in HTML.
 Pseudo-classes associated with the anchor element are used
to achieve the mouse-over effect.
 Link color defines the link state, which is whether a hyperlink
has been clicked or not.
+
The Anchor Pseudo-Class Selectors
 Using the anchor pseudo-class selectors, hyperlinks can be
styled, based on the following four states:
 a:link is the selector for normal links.
 a:visited is the selector for visited links.
 a:hover is the selector for the hover state (when
the mouse pointer passes over the link).
 a:active is the selector for active links (when a
user holds down the mouse button to click a link).
 Note that the colon does not have spaces before and after it.
+
The Anchor Pseudo-Class Selectors
+
+
Setting Margins
 The following properties are used to set margins:
 margin-top
 margin-right
 margin-bottom
 margin-left
 Order is irrelevant.
+
Setting Margins
+
Fonts
 Web Fonts
 Download
 Link/Embed
See Handout!

More Related Content

Similar to CSS Selectors and Fonts (20)

PDF
Tfbyoweb.4.9.17
Jordan Zurowski
 
PDF
Tfbyoweb.4.9.17
Jordan Zurowski
 
PPTX
Cascading style sheet
Michael Jhon
 
PPTX
Learn html and css from scratch
Mohd Manzoor Ahmed
 
PDF
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Erin M. Kidwell
 
PPT
Cascading Style Sheets
Marc Steel
 
PPT
Make Css easy(part:2) : easy tips for css(part:2)
shabab shihan
 
PPTX
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
usmanahmadawan
 
PPTX
Ppt of web designing
prab5
 
PPT
Css Founder.com | Cssfounder Company
Css Founder
 
PPT
Css Founder.com | Cssfounder Company
Css Founder
 
PPTX
chapter-gesgsdkfhhgagfhagsdhfgdhfdhda3-css .pptx
berihun18
 
PPT
IP - Lecture 6, 7 Chapter-3 (3).ppt
kassahungebrie
 
PPTX
Web 102 INtro to CSS
Hawkman Academy
 
PPTX
Css 101
Rhyan Mahazudin
 
PPT
Basic css
Gopinath Ambothi
 
PPTX
UVA MDST 3073 CSS 2012-09-20
Rafael Alvarado
 
PPTX
Module 2 CSS . cascading style sheet and its uses
BKReddy3
 
Tfbyoweb.4.9.17
Jordan Zurowski
 
Tfbyoweb.4.9.17
Jordan Zurowski
 
Cascading style sheet
Michael Jhon
 
Learn html and css from scratch
Mohd Manzoor Ahmed
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Erin M. Kidwell
 
Cascading Style Sheets
Marc Steel
 
Make Css easy(part:2) : easy tips for css(part:2)
shabab shihan
 
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
usmanahmadawan
 
Ppt of web designing
prab5
 
Css Founder.com | Cssfounder Company
Css Founder
 
Css Founder.com | Cssfounder Company
Css Founder
 
chapter-gesgsdkfhhgagfhagsdhfgdhfdhda3-css .pptx
berihun18
 
IP - Lecture 6, 7 Chapter-3 (3).ppt
kassahungebrie
 
Web 102 INtro to CSS
Hawkman Academy
 
Basic css
Gopinath Ambothi
 
UVA MDST 3073 CSS 2012-09-20
Rafael Alvarado
 
Module 2 CSS . cascading style sheet and its uses
BKReddy3
 

More from kjkleindorfer (10)

PPTX
Logic and Coding of Java Interfaces & Swing Applications
kjkleindorfer
 
PPTX
Week11 Inheritance class relationships in Java
kjkleindorfer
 
PPTX
Week10 packages using objects in objects
kjkleindorfer
 
PPTX
Week9 Intro to classes and objects in Java
kjkleindorfer
 
PPTX
Intro to Bootstrap
kjkleindorfer
 
PPTX
Layouts Part 2
kjkleindorfer
 
PPTX
Layouts
kjkleindorfer
 
PPTX
Using PHP to submit forms
kjkleindorfer
 
PPTX
Forms Part 1
kjkleindorfer
 
PPTX
CSS Box Model
kjkleindorfer
 
Logic and Coding of Java Interfaces & Swing Applications
kjkleindorfer
 
Week11 Inheritance class relationships in Java
kjkleindorfer
 
Week10 packages using objects in objects
kjkleindorfer
 
Week9 Intro to classes and objects in Java
kjkleindorfer
 
Intro to Bootstrap
kjkleindorfer
 
Layouts Part 2
kjkleindorfer
 
Layouts
kjkleindorfer
 
Using PHP to submit forms
kjkleindorfer
 
Forms Part 1
kjkleindorfer
 
CSS Box Model
kjkleindorfer
 
Ad

Recently uploaded (20)

PPTX
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
How to Manage Promotions in Odoo 18 Sales
Celine George
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PDF
1, 2, 3… E MAIS UM CICLO CHEGA AO FIM!.pdf
Colégio Santa Teresinha
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PPTX
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
PDF
'' IMPORTANCE OF EXCLUSIVE BREAST FEEDING ''
SHAHEEN SHAIKH
 
PDF
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
PPTX
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PPTX
How to Manage Access Rights & User Types in Odoo 18
Celine George
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
How to Manage Promotions in Odoo 18 Sales
Celine George
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
1, 2, 3… E MAIS UM CICLO CHEGA AO FIM!.pdf
Colégio Santa Teresinha
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
'' IMPORTANCE OF EXCLUSIVE BREAST FEEDING ''
SHAHEEN SHAIKH
 
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
Dimensions of Societal Planning in Commonism
StefanMz
 
How to Manage Access Rights & User Types in Odoo 18
Celine George
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
Ad

CSS Selectors and Fonts

  • 2. + Using the vertical-align Property  Use the vertical-align property to position images and other elements vertically with text.  The property has several possible values:  top – The top of the image is aligned with the text.  middle – The image is aligned vertically centered with the text.  bottom – The bottom of the image is aligned with the text.
  • 3. + Using the vertical-align Property
  • 4. + Using the vertical-align Property
  • 5. + The vertical-align Property Values
  • 6. + Changing the Appearance of Lists  Lists can be enhanced by graphics and images.  The following properties can be used:  list-style-type: stylevalue;  list-style-position: positionvalue;  list-style-image: url(imagename);  Shorthand property: list-style: stylevalue url(imagename) positionvalue;
  • 7. + Using the list-style-type Property  Use the list-style-type property to change the appearance of the default solid bullet for unordered lists.  There are four list-style-type values for unordered lists:  disc – a filled circle (the default)  circle – a hollow circle  square – a filled square  none – no bullet is shown ul { list-style-type: value; }
  • 8. + Using the list-style-type Property  There are the following list-style-type values for ordered lists:  decimal  decimal-leading-zero  lower-roman  upper-roman  lower-alpha  upper-alpha  none ol { list-style-type: value; }
  • 9. + Using the list-style-type Property
  • 10. +Using the list-style-position Property Use the list-style-position property to change the position of the marker or bullet included with a list. There are two list-style-position values:  inside  outside
  • 11. + Using Groups of Selectors  Grouped selectors are selectors that share a common set of declarations and that are grouped into a comma-separated list.
  • 12. + Using Descendant Selectors  A descendant selector is a selector nested within another selector.  A space is used, without a comma, to indicate descendant selectors.  A comma is used between selectors when the style applies to all selectors in the group. strong em { color: maroon; }
  • 14. + Styling a List of Hyperlinks  The nav element identifies a block of navigation links.
  • 15. + Styling a List of Hyperlinks
  • 16. + CSS Inheritance  CSS inheritance is a method whereby a child element inherits characteristics from its parent element.  The nav element is a parent of the ul element, and the ul element is a parent of the li element.
  • 17. + CSS Class Selector  A class selector is a name preceded by a period.  This name can then be applied to any HTML element.  Class selectors can format one or more instances of an element.  A class must be applied to the start tag of one or more elements on a Web page.  Classes can be dependent or independent.
  • 18. + Dependent Class  A dependent class styles a particular element.  Code syntax: selector.dependentclass { property1: value; property2: value; } selector – the name of the element dependentclass – the name of the dependent class  To apply the dependent class to an element: <element class = "dependentclass">
  • 19. + Rules for Class Names  A class name can contain only alphabetic or numeric characters.  A class name must be one word (no spaces).  A class name should describe the purpose of the class.  A class name should not begin with a number because not all browsers will recognize it.
  • 20. + Dependent Selector Code Code to apply the attention class: <li class = "attention">Your name and contact information</li>
  • 21. + Independent Class  An independent class styles any element.  Code syntax: selector.independentclass { property1: value; property2: value; } selector – the name of the element independentclass – the name of the dependent class  To apply an independent class to any element: <element class = "independentclass">
  • 22. + Independent Selector Code Code to apply the center class:
  • 23. + Using the list-style-image Property  Use the list-style-image property to specify a graphic image instead of a bullet marker for a list.  Use a very small image for a bullet marker.  Code example: ul { list-style-image: url(star.gif); }  url points to the image used as a bullet marker.
  • 24. + Using the span Element  The span element is a generic element that does not have any specific meaning, but it allows you to mark inline content.  span element syntax: <span>content</span>
  • 25. + Pseudo-Class Selectors  A pseudo-class is a class that exists in CSS but is not directly defined in HTML.  Pseudo-classes associated with the anchor element are used to achieve the mouse-over effect.  Link color defines the link state, which is whether a hyperlink has been clicked or not.
  • 26. + The Anchor Pseudo-Class Selectors  Using the anchor pseudo-class selectors, hyperlinks can be styled, based on the following four states:  a:link is the selector for normal links.  a:visited is the selector for visited links.  a:hover is the selector for the hover state (when the mouse pointer passes over the link).  a:active is the selector for active links (when a user holds down the mouse button to click a link).  Note that the colon does not have spaces before and after it.
  • 28. + Setting Margins  The following properties are used to set margins:  margin-top  margin-right  margin-bottom  margin-left  Order is irrelevant.
  • 30. + Fonts  Web Fonts  Download  Link/Embed See Handout!