SlideShare a Scribd company logo
Introducing Cascading Style Sheets
http://www.slideshare.net/chadmairn
@cmairn
Virtual Petting Zoo/Discussion
Want to
hangout?
gplus.to/chadmairn
anymeeting.com/chadmairn
How would you describe this?
Agenda
• Learn what CSS does and appreciate its
importance in Web design.
• Recognize and use general CSS grammar
(e.g., syntax, semantics, vocabulary)
• Understand how to link a CSS file to an HTML
document.
• Create a Web designers toolbox.
• Design a basic webpage using CSS.
Draw four lines the same length that
touch, two horizontal and two vertical.
We need to tell computers exactly what we mean!
Source: http://goo.gl/N0gvb
Text inside …
Border: 5px solid red;
Background-color: pink;
Padding: 25px;
Font: 8px/2 arial;
HTML = Content; defines tags etc.
CSS = Presentation; tells browser
how tags should appear.
CSS defines how to display HTML tags.
Styles are normally saved in external .css files. External style sheets
enable you to change the appearance and layout of all the pages in a
Web site, just by editing one single file!
Source: http://www.w3schools.com
Define
widths, heights, colors, marg
ins, padding, borders, backgr
ounds, and type styles with
CSS
Source: http://www.w3schools.com
/*This is a comment*/
p
{
text-align:center;
/*This is another comment*/
color:black;
font-family:arial;
}
CSS Comments
id selector
#para1
{
text-align:center;
color:red;
}
ResultCode
class selector
Result
Code
ColorZilla and other tools …
Adding CSS code to HTML pages
1. External Style Sheet
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
2. Internal Style Sheet
<head>
<style>
hr {color:sienna;}
p {margin-left:20px;}
body {background-image:url("images/back40.gif");}
</style>
</head>
3. Inline Styles
<p style="color:sienna;margin-left:20px">This is a paragraph.</p>
Note: an inline style will override a style defined inside the <head> tag or in an external style
sheet. If the link to the external style sheet is placed after the internal style sheet in HTML
<head>, then the external style sheet will override the internal style sheet!
Source: http://goo.gl/RgDFa
http://www.w3schools.com/cssref/
live demonstration
~ Firebug
~ CSS Generating tools
~ CSS Examples
1. If you don't have an FTP application, then I recommend that you download
and install the following: http://filezilla-project.org/download.php
2. Upload files to your directory (e.g., email address username).
3. When you begin to work with the FTP client, you will need to enter the
following credentials:
•Host: via email
•Username: via email
•Password: via email
A quick screencast video demonstrating how to login using the FileZilla FTP
Client can be found at http://www.youtube.com/watch?v=9VaM_wv0aQ4.
4. You will need either a text editor (TextEdit on mac or Notepad on PC) or a
tool like Dreamweaver.
If you have problems, please contact Chad Mairn at (727) 537-6405 or
at chadmairn@gmail.com.
Uploading Files
Uploading Files via FTP
To test you work visit …
http://marcomponline.com/chadtest/Class/
email username
Homework …
• Create a basic HTML index page (index.html) and include an external style
sheet as well as some inline styles. Experiment with various properties and
values.
• Find an interesting site that uses CSS and modify it for your needs. {Note: try a
search for “CSS exercises” and use whatever interests you.
http://www.w3schools.com/css/css_examples.asp and
http://www.codecademy.com/tracks/htmlcss are great resources! Don’t forget
Firebug!}
• Test and validate your HTML file at http://validator.w3.org/
• Test and validate your CSS file at http://jigsaw.w3.org/css-validator/
• Please take good notes because I’d like to spend some time next week
discussing any issues you may have had using CSS.
Next Week …
• Share with the group good/bad experiences
(e.g., what worked, what didn’t etc.)
• Other coding examples
• Discuss the future of CSS3/Responsive Web Design
• Questions and answers …
How did it go?
Other examples
Styling an e-book with Calibre
RGB and Hex color values: http://cloford.com/resources/colours/500col.htm
CSS pseudo-classes
• used to add special effects to some selectors. Some
examples:
:link - add special style to an unvisited link.
:visited - add special style to a visited link.
:hover - add special style to an element when you mouse over it.
CSS3
• CSS3 is the latest standard for CSS.
• CSS3 is backwards compatible; browsers will support CSS2.
• Some of the most important CSS3 modules are:
– Selectors [HTML (e.g., h2); Class (e.g., .hilight);
– Box Model
– Backgrounds and Borders
– Text Effects
– 2D/3D Transformations
– Animations
– Multiple Column Layout
– User Interface
Source: http://goo.gl/eMQEC
• Try http://css3generator.com/ and http://css3please.com/
Code Result
Adding a box-shadow to a div element
Responsive Web Design
• adapts to the webpage’s layout by using
fluid, proportion-based grids, flexible images, and
CSS3 media queries.
• Three concepts:
• Media queries and media query listeners
• A flexible grid-based layout that uses relative sizing
• Flexible images and media, through dynamic resizing or CSS
Source: http://goo.gl/UQ94d
Caveat: I am just learning RWD!
Media queries and media query listeners
• CSS3 Media queries enable you to style a page based on properties
of the media where the page is being displayed. For example:
@media screen and (max-width:400px)
{ div {border:none;}
}
• The above code limits the scope to viewports (i.e., virtual window;
screen display) which are 400px or less in width.
• Media Query Listeners enable you to execute a script in response to
a change in a media query.
• An example: http://goo.gl/G4fGb
Source: http://goo.gl/G4fGb
A flexible grid-based layout using relative sizing
• ‘non-responsive’ websites have a set width/ fixed
value (e.g., 900px)
• set a relative value as the width then the screen
size is mostly irrelevant. For example:
#content{width: 90%;}
This content area would respond to the screen
size.
Source: http://goo.gl/Sa5nG
Flexible images and media, through dynamic resizing or CSS
• Images are usually set a width and height using
absolute measurements like ‘px’. This is not
flexible.
• Modern browsers are good at maintaining
proportions so the image will resize well as the
layout resizes. For example:
img, embed, object, video
{ max-width: 100%
}
Source: http://goo.gl/VN77O
http://marcomponline.com/chadtest/Class/jjack/
Desktop view
Mobile view – Galaxy S3 (Android)
http://jquerymobile.com/themeroller/
http://www.slideshare.net/chadmairn
@cmairn
Let’s
Hangout!
gplus.to/chadmairn

More Related Content

PPTX
HTML (Web) basics for a beginner
PPTX
Css ppt
PDF
Intro to HTML & CSS
PPTX
PDF
Introduction to html
PPTX
Basic HTML
PPT
Introduction to Cascading Style Sheets (CSS)
PPT
Html presentation
HTML (Web) basics for a beginner
Css ppt
Intro to HTML & CSS
Introduction to html
Basic HTML
Introduction to Cascading Style Sheets (CSS)
Html presentation

What's hot (20)

PPTX
Lecture 2 introduction to html
PPTX
The Complete HTML
PPT
How Cascading Style Sheets (CSS) Works
PDF
HTML & CSS Masterclass
PPT
Css Ppt
PDF
Introduction to Javascript
PPT
CSS Basics
PPT
Html Slide Part-1
PPT
HTML Introduction
PPT
Html Intro2
PPT
Span and Div tags in HTML
PPT
1. introduction to html5
PDF
Html,javascript & css
PPSX
Introduction to Html5
PPTX
Front-end development introduction (HTML, CSS). Part 1
PDF
Lesson 1: Introduction to HTML
PPT
CSS for Beginners
PPTX
Beginners css tutorial for web designers
PPT
Introduction to html
Lecture 2 introduction to html
The Complete HTML
How Cascading Style Sheets (CSS) Works
HTML & CSS Masterclass
Css Ppt
Introduction to Javascript
CSS Basics
Html Slide Part-1
HTML Introduction
Html Intro2
Span and Div tags in HTML
1. introduction to html5
Html,javascript & css
Introduction to Html5
Front-end development introduction (HTML, CSS). Part 1
Lesson 1: Introduction to HTML
CSS for Beginners
Beginners css tutorial for web designers
Introduction to html
Ad

Viewers also liked (10)

PPTX
EIA2016Nice - David Lamas. Paper prototyping: Why, when & how?
PDF
Rapid prototyping and sketching
PPTX
CSS introduction
PDF
Sketching, Wireframing, Prototyping - How to Be Agile and Avoid Half-Baked Us...
PDF
MHIT 603: Introduction to Prototyping
PDF
Sketching & Prototyping UX (starting with stories)
PPT
Introduction to CSS
PDF
Sketching & Prototyping
PPT
PDF
Html / CSS Presentation
EIA2016Nice - David Lamas. Paper prototyping: Why, when & how?
Rapid prototyping and sketching
CSS introduction
Sketching, Wireframing, Prototyping - How to Be Agile and Avoid Half-Baked Us...
MHIT 603: Introduction to Prototyping
Sketching & Prototyping UX (starting with stories)
Introduction to CSS
Sketching & Prototyping
Html / CSS Presentation
Ad

Similar to Introducing Cascading Style Sheets (20)

PPT
Web design-workflow
PPTX
How to dominate a free theme WCTO 2014
PPTX
Intro To Twitter Bootstrap
PPTX
DOC
Intermediate Web Design.doc
DOC
Intermediate Web Design.doc
PPTX
025444215.pptx
PDF
Responsive Web Design (April 18th, Los Angeles)
PPTX
Web Publishing terminology 1
PDF
web development
PPTX
25444215.pptx
PPTX
DYNAMIC HYPERTEXT MARKUP LANGUAGE (DHTML) & CSS WITH Application of JavaScript
PPTX
basic programming language AND HTML CSS JAVApdf
PPTX
WEB DEVELOPMENT.pptx
PDF
GDG-USAR Tech winter break 2024 USAR.pdf
PPTX
Cascading Style Sheets - CSS
PPTX
Introduction to PrintCSS.live
PPT
Css week10 2019 2020 for g10 by eng.osama ghandour
PDF
Thinkful - Frontend Crash Course - Intro to HTML/CSS
PPTX
Tech Winter Break - GDG on Campus - PIET
Web design-workflow
How to dominate a free theme WCTO 2014
Intro To Twitter Bootstrap
Intermediate Web Design.doc
Intermediate Web Design.doc
025444215.pptx
Responsive Web Design (April 18th, Los Angeles)
Web Publishing terminology 1
web development
25444215.pptx
DYNAMIC HYPERTEXT MARKUP LANGUAGE (DHTML) & CSS WITH Application of JavaScript
basic programming language AND HTML CSS JAVApdf
WEB DEVELOPMENT.pptx
GDG-USAR Tech winter break 2024 USAR.pdf
Cascading Style Sheets - CSS
Introduction to PrintCSS.live
Css week10 2019 2020 for g10 by eng.osama ghandour
Thinkful - Frontend Crash Course - Intro to HTML/CSS
Tech Winter Break - GDG on Campus - PIET

More from St. Petersburg College (20)

PPTX
Introducing Immersive Technologies for Libraries
PPTX
Introducing How to Build a Personal Voice Assistant (AIY Edition)
PPTX
360° Tours and More
PPTX
Taking the Magical Leap with Immersive Technologies in Libraries
PPTX
Open Education Resources in Libraries
PPTX
How to Repurpose Library Space: Listening Lab Edition
PPTX
Using CoSpaces Edu to Create Virtual and Augmented Reality Experiences
PPTX
Understanding Artificial Intelligence
PPTX
Web Design Trends: 2018 Edition
PPTX
What’s New With 3D Design and Printing?
PPTX
Creating a Program to Assist Users Cutting Cable
PPTX
Understanding Artificial Intelligence
PPTX
Beginning Python Programming
PPTX
3D Design Fundamentals
PPTX
STEM Demystified
PPTX
Learn to Compose, Record, and Produce Songs and Podcasts Using GarageBand
PPTX
Open Education Resources in Libraries
PPTX
Learning Kodu: Basic Video Game Design for Kids
PPTX
Learn to Code and Have Fun Doing It!
PPTX
How to Think in the Information Age: Finding Facts in a Post-Truth World
Introducing Immersive Technologies for Libraries
Introducing How to Build a Personal Voice Assistant (AIY Edition)
360° Tours and More
Taking the Magical Leap with Immersive Technologies in Libraries
Open Education Resources in Libraries
How to Repurpose Library Space: Listening Lab Edition
Using CoSpaces Edu to Create Virtual and Augmented Reality Experiences
Understanding Artificial Intelligence
Web Design Trends: 2018 Edition
What’s New With 3D Design and Printing?
Creating a Program to Assist Users Cutting Cable
Understanding Artificial Intelligence
Beginning Python Programming
3D Design Fundamentals
STEM Demystified
Learn to Compose, Record, and Produce Songs and Podcasts Using GarageBand
Open Education Resources in Libraries
Learning Kodu: Basic Video Game Design for Kids
Learn to Code and Have Fun Doing It!
How to Think in the Information Age: Finding Facts in a Post-Truth World

Recently uploaded (20)

PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
OMC Textile Division Presentation 2021.pptx
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Tartificialntelligence_presentation.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
1. Introduction to Computer Programming.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Empathic Computing: Creating Shared Understanding
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
A comparative analysis of optical character recognition models for extracting...
Encapsulation_ Review paper, used for researhc scholars
Mobile App Security Testing_ A Comprehensive Guide.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
SOPHOS-XG Firewall Administrator PPT.pptx
OMC Textile Division Presentation 2021.pptx
Spectroscopy.pptx food analysis technology
Tartificialntelligence_presentation.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
NewMind AI Weekly Chronicles - August'25-Week II
1. Introduction to Computer Programming.pptx
Encapsulation theory and applications.pdf
Unlocking AI with Model Context Protocol (MCP)
Empathic Computing: Creating Shared Understanding
A comparative study of natural language inference in Swahili using monolingua...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

Introducing Cascading Style Sheets

  • 3. Virtual Petting Zoo/Discussion Want to hangout? gplus.to/chadmairn anymeeting.com/chadmairn
  • 4. How would you describe this?
  • 5. Agenda • Learn what CSS does and appreciate its importance in Web design. • Recognize and use general CSS grammar (e.g., syntax, semantics, vocabulary) • Understand how to link a CSS file to an HTML document. • Create a Web designers toolbox. • Design a basic webpage using CSS.
  • 6. Draw four lines the same length that touch, two horizontal and two vertical. We need to tell computers exactly what we mean! Source: http://goo.gl/N0gvb
  • 7. Text inside … Border: 5px solid red; Background-color: pink; Padding: 25px; Font: 8px/2 arial;
  • 8. HTML = Content; defines tags etc. CSS = Presentation; tells browser how tags should appear. CSS defines how to display HTML tags. Styles are normally saved in external .css files. External style sheets enable you to change the appearance and layout of all the pages in a Web site, just by editing one single file! Source: http://www.w3schools.com
  • 9. Define widths, heights, colors, marg ins, padding, borders, backgr ounds, and type styles with CSS
  • 11. /*This is a comment*/ p { text-align:center; /*This is another comment*/ color:black; font-family:arial; } CSS Comments
  • 14. ColorZilla and other tools …
  • 15. Adding CSS code to HTML pages 1. External Style Sheet <head> <link rel="stylesheet" type="text/css" href="mystyle.css"> </head> 2. Internal Style Sheet <head> <style> hr {color:sienna;} p {margin-left:20px;} body {background-image:url("images/back40.gif");} </style> </head> 3. Inline Styles <p style="color:sienna;margin-left:20px">This is a paragraph.</p> Note: an inline style will override a style defined inside the <head> tag or in an external style sheet. If the link to the external style sheet is placed after the internal style sheet in HTML <head>, then the external style sheet will override the internal style sheet! Source: http://goo.gl/RgDFa
  • 17. live demonstration ~ Firebug ~ CSS Generating tools ~ CSS Examples
  • 18. 1. If you don't have an FTP application, then I recommend that you download and install the following: http://filezilla-project.org/download.php 2. Upload files to your directory (e.g., email address username). 3. When you begin to work with the FTP client, you will need to enter the following credentials: •Host: via email •Username: via email •Password: via email A quick screencast video demonstrating how to login using the FileZilla FTP Client can be found at http://www.youtube.com/watch?v=9VaM_wv0aQ4. 4. You will need either a text editor (TextEdit on mac or Notepad on PC) or a tool like Dreamweaver. If you have problems, please contact Chad Mairn at (727) 537-6405 or at [email protected]. Uploading Files
  • 20. To test you work visit … http://marcomponline.com/chadtest/Class/ email username
  • 21. Homework … • Create a basic HTML index page (index.html) and include an external style sheet as well as some inline styles. Experiment with various properties and values. • Find an interesting site that uses CSS and modify it for your needs. {Note: try a search for “CSS exercises” and use whatever interests you. http://www.w3schools.com/css/css_examples.asp and http://www.codecademy.com/tracks/htmlcss are great resources! Don’t forget Firebug!} • Test and validate your HTML file at http://validator.w3.org/ • Test and validate your CSS file at http://jigsaw.w3.org/css-validator/ • Please take good notes because I’d like to spend some time next week discussing any issues you may have had using CSS.
  • 22. Next Week … • Share with the group good/bad experiences (e.g., what worked, what didn’t etc.) • Other coding examples • Discuss the future of CSS3/Responsive Web Design • Questions and answers …
  • 23. How did it go?
  • 25. Styling an e-book with Calibre RGB and Hex color values: http://cloford.com/resources/colours/500col.htm
  • 26. CSS pseudo-classes • used to add special effects to some selectors. Some examples: :link - add special style to an unvisited link. :visited - add special style to a visited link. :hover - add special style to an element when you mouse over it.
  • 27. CSS3 • CSS3 is the latest standard for CSS. • CSS3 is backwards compatible; browsers will support CSS2. • Some of the most important CSS3 modules are: – Selectors [HTML (e.g., h2); Class (e.g., .hilight); – Box Model – Backgrounds and Borders – Text Effects – 2D/3D Transformations – Animations – Multiple Column Layout – User Interface Source: http://goo.gl/eMQEC • Try http://css3generator.com/ and http://css3please.com/
  • 28. Code Result Adding a box-shadow to a div element
  • 29. Responsive Web Design • adapts to the webpage’s layout by using fluid, proportion-based grids, flexible images, and CSS3 media queries. • Three concepts: • Media queries and media query listeners • A flexible grid-based layout that uses relative sizing • Flexible images and media, through dynamic resizing or CSS Source: http://goo.gl/UQ94d Caveat: I am just learning RWD!
  • 30. Media queries and media query listeners • CSS3 Media queries enable you to style a page based on properties of the media where the page is being displayed. For example: @media screen and (max-width:400px) { div {border:none;} } • The above code limits the scope to viewports (i.e., virtual window; screen display) which are 400px or less in width. • Media Query Listeners enable you to execute a script in response to a change in a media query. • An example: http://goo.gl/G4fGb Source: http://goo.gl/G4fGb
  • 31. A flexible grid-based layout using relative sizing • ‘non-responsive’ websites have a set width/ fixed value (e.g., 900px) • set a relative value as the width then the screen size is mostly irrelevant. For example: #content{width: 90%;} This content area would respond to the screen size. Source: http://goo.gl/Sa5nG
  • 32. Flexible images and media, through dynamic resizing or CSS • Images are usually set a width and height using absolute measurements like ‘px’. This is not flexible. • Modern browsers are good at maintaining proportions so the image will resize well as the layout resizes. For example: img, embed, object, video { max-width: 100% } Source: http://goo.gl/VN77O
  • 34. Mobile view – Galaxy S3 (Android)