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

DOC
Art of css
PPTX
Formatting Text and Links
PDF
Css from scratch
PPT
Basic css
PDF
Introduction 2 css
PPTX
Cascading style sheet
PPTX
session2 cascading style sheet course.pptx
Art of css
Formatting Text and Links
Css from scratch
Basic css
Introduction 2 css
Cascading style sheet
session2 cascading style sheet course.pptx

Similar to CSS Selectors and Fonts (20)

PPTX
session2 css cascade style sheet course.pptx
PPTX
session2_cascading_style_sheet_cssc.pptx
PPT
07. session 07 adv css properties
PPT
CSS - Basics
PPTX
Css1
PPTX
CSS_Day_ONE (W3schools)
PPT
cascading style sheet in web design .ppt
PPT
CSS for basic learner
PPT
How Cascading Style Sheets (CSS) Works
PPT
Cascading style sheets
PPT
Cascading style sheets
PPT
Cascading Style Sheets
PPTX
Cascading style sheets, Introduction to web programming
PPT
CSS Introduction
DOCX
Css Introduction
PPT
Css class-02
PPTX
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
PDF
CascadingStyleSheets in ONESHOT By DeathCodeYT .pdf
session2 css cascade style sheet course.pptx
session2_cascading_style_sheet_cssc.pptx
07. session 07 adv css properties
CSS - Basics
Css1
CSS_Day_ONE (W3schools)
cascading style sheet in web design .ppt
CSS for basic learner
How Cascading Style Sheets (CSS) Works
Cascading style sheets
Cascading style sheets
Cascading Style Sheets
Cascading style sheets, Introduction to web programming
CSS Introduction
Css Introduction
Css class-02
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
CascadingStyleSheets in ONESHOT By DeathCodeYT .pdf
Ad

More from kjkleindorfer (10)

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

Recently uploaded (20)

PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
master seminar digital applications in india
PDF
Complications of Minimal Access Surgery at WLH
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Classroom Observation Tools for Teachers
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Lesson notes of climatology university.
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Final Presentation General Medicine 03-08-2024.pptx
VCE English Exam - Section C Student Revision Booklet
2.FourierTransform-ShortQuestionswithAnswers.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
O7-L3 Supply Chain Operations - ICLT Program
master seminar digital applications in india
Complications of Minimal Access Surgery at WLH
Supply Chain Operations Speaking Notes -ICLT Program
O5-L3 Freight Transport Ops (International) V1.pdf
GDM (1) (1).pptx small presentation for students
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Classroom Observation Tools for Teachers
PPH.pptx obstetrics and gynecology in nursing
Lesson notes of climatology university.
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES

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!