SlideShare a Scribd company logo
KNS TECHNOLOGIES
CSS Tools and Tips
CSS
Cascading Style Sheets
Charles Severance
www.dr-chuck.com
http://en.wikipedia.org/wiki/Cascading_Style_Sheets
1995
2007
HTML has evolved a *lot* over the
years - as computers and networks
have gotten faster.
Source: www.yahoo.com
Tranforming the look and feel of a page using a CSS style sheet.
body {
font-family: arial, san-serif;
}
a, a:link
{
color: #0000cc;
}
...
+
Applying Basic Styles
The Browser has “default styling” for all tags.
<h1><a href="index.htm">
AppEngineLearn</a></h1>
<ul>
<li><a href="sites.htm">Sites</a></li>
<li><a href="topics.htm" >Topics</a></li>
</ul>
<h2>Google App Engine: About</h2>
<p>
Welcome to the site dedicated to
learning the Google Application Engine.
We hope you find
www.appenginelearn.com useful.
</p>
We will apply CSS to the tags in the document.
With no changes to the HTML.
Lots of CSS properties to play with
We can set these properties on any HTML tag in a document.
background-color, border-width, border-color, margin-top,
padding, font-family, top, left, right, float, font-size,
background-image, text-align, text-decoration, font-style, font-
weight, vertical-align, visibility, overflow, ....
Source: http://www.lesliefranke.com/files/reference/csscheatsheet.html
Anatomy of a CSS Rule
body
font-family: arial, sans-serif;
font-size: 100%; }
property - which
aspect of CSS are
we changing
selector - which part of the
document does this rule apply
to
value - What are we
setting the property to.
Multiple tags with same styling
h1, h2, h3 {
color: yellow;
background-color: black;
}
Making a noticeable background color is a fun way to debug / identify blocks.
Three ways to add style rules
• Inline Style - Add style information to a tag
• Embedded Style - Add style information to the document at the
beginning
• External Style Sheet - Put all of your style in an external file
• Preferred - because two people can work independently
csev$ ls –l
total 32
-rw-r--r-- 1 csev staff 44 Jan 28 13:14 glike.css-
rw-r--r-- 1 csev staff 680 Feb 17 08:25 index.htm-rw-
r--r-- 1 csev staff 886 Feb 17 08:00 sites.htm-rw-r--
r-- 1 csev staff 681 Feb 17 08:01 topics.htm
csev$
We put the CSS file in the same directory so the link works.
<head>
<title>Learning the Google App Engine</title>
<link type="text/css" rel="stylesheet" href="glike.css">
</head>
Fonts
• Default fonts are ugly and they have
Serifs - which make them harder to
read on a screen
• So the first thing I usually want to do
is override the font in my document
• And I want to do this everywhere.
Fonts
body {
font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
font-size: x-large;
}
Most Favourite Least Favourite
Fallback fonts: serif, sans-serif, monospace, cursive and fantasy.
Font Factors
font-size:
xx-small
x-small
small
medium
large
x-large
xx-large
font-weight: bold or normal
font-style: normal or italic
text-decoration: none, underline, overline, or
line-through
Color Names
• W3C has listed 16 color names
that will validate with an HTML
validator.
• The color names are: aqua, black,
blue, fuchsia, gray, green, lime,
maroon, navy, olive, purple, red,
silver, teal, white, and yellow.
Source: http://www.w3schools.com/html/html_colors.asp
Colors by the number...
#e2edffThree Numbers,
Red, Green , and
Blue - each from 00 -
FF (Hexidecimal)
#ffffff = white
#000000 = black
#ff0000 = red
#00ff00 = green
#0000ff = blue
Source: http://www.w3schools.com/css/css_colornames.asp
Web-safe
colors
#edf = #eeddff
Default Styling for Links
Downright Ugly!
Post-Click:
Source: www.yahoo.com
Styling Links
a {
font-weight: bold;
}
a:link {
color: black;
}
a:visited {
color: gray;
}
a:hover {
text-decoration: none;
color: white;
background-color: navy;
}
a:active {
color: aqua;
background-color: navy;
}
link - before a visit
visited - after it has been visited
hover - when your mouse is over it
but you have not clicked
active - you have clicked it and you
have not yet seen the new page
Browser default styling for links is
downright ugly!
CSS Tags and Attributes
• As CSS was introduced they introduced two new tags that are pretty
much there to serve as handles for styling
• <div> - A block tag (breaks justification)
• <span> - An inline tag that does not break justification
• There are two attributes with special meaning to CSS
• id= - Marks a unique block within the document for styling (use only
once)
• class= - Marks a non-unique tag within the document for styling
(multi-use)
div as Container
<div>
<p>This is a paragraph inside a div.</p>
<p>So is this.</p>
</div>
<div id="header">
<ul>
<li><a href="sites.htm">Sites</a></li> <li><a
href="topics.htm" >Topics</a></li>
</ul>
</div>
“div” stands for “division” as it allows us to divide our page into parts or sections
and then do something different with each “section”.
The id attribute on the tag allows us to
uniquely mark a div in a document. The
id tag is also useful for screen readers.
Nested divs
<div id="outer">
<div id="nested1">
<p>A paragraph inside the first nested div.</p>
</div>
<div id="nested2">
<p>A paragraph inside the second nested div.</p>
</div>
</div> <!-- End of the outer div -->
Adding divs give us a “handle” to apply styling (CSS) to a block of text.
Styling with class=
.fun {
color: #339999;
font-family: Georgia, Times, serif;
letter-spacing: 0.05em;
}
<p class="fun">A man walks into a bar; you
would've thought he'd see it coming!</p>
<p>Have a nice day.<p>
<p class=”fun”>More fun stuff</p>
class can be used many
times in a document.
Span (Invisible tag)
<p><span class="fun">Bubble Under</span> is a group of diving
enthusiasts based in the south-west UK who meet up for diving
trips in the summer months when the weather is good and the
bacon rolls are flowing. We arrange weekends away as small
groups to cut the costs of accommodation and travel and to
ensure that everyone gets a trustworthy dive buddy.</p>
Sometimes you want to style something smaller than a whole block - then use span. Do not use span if you are
applying something to a whole block - just put your styling on the enclosing block tag.
Source: http://www.lesliefranke.com/files/reference/csscheatsheet.html
A Running Example...
Transform from ugly to fancy with CSS
body {
font-family: arial, sans-serif;
}
a {
color: blue;
}
h1 a {
text-decoration: none;
color: black;
}
<head>
<title>Learning the Google App Engine</title>
<link type="text/css" rel="stylesheet" href="glike.css">
</head>
Block Layout
Quick Advertisement - Firefox
• You pretty much need to use Firefox for serious website development
• Important plugins:
• Web Developer - Chris Pedrick
• FireBug - Joe Hewitt
http://addons.mozilla.org/
Source: www.dr-chuck.com
CSS Box Model
• height and width properties size the block element
• margin properties define the space around the block element
• border properties define the borders around a a block element
• padding properties define the space between the element border and the
element content
• background properties allow you to control the background color of an
element, set an image as the background, repeat a background image
vertically or horizontally, and position an image on a page
http://reference.sitepoint.com/css/boxmodel
The Box Model
.trapped {
height: 100px;
width: 200px;
margin: 20px;
border: 5px solid yellow;
background:red;
padding: 20px;
font-family:Arial;
color:orange;
font-size:20px;
}
<p class=”trapped”>
I am trapped in a glass case of emotion
which is 100px high and 200px wide.
</p>
11
55
00
11
99
00
11
44
00
11
00
00
5
20
20
Border, padding, and margin are additive.
.trapped {
height: 50px;
width: 50px;
}
.trapped2 {
height: 50px;
width: 50px;
border: 5px solid yellow;
padding: 10px;
}
<p class="trapped">
One</p>
<p class="trapped2">
Two</p>
#header {
background-color: #dde;
border-top: 3px solid #36c;
height: 100%;
overflow:hidden;
padding: 7px;
margin-top: 5px;
}
#header h1 {
font-size: 20px;
float: left;
vertical-align: middle;
margin: 0;
padding: 0 0 0 .3em;
}
#header li {
font-size: 14px;
display: inline;
padding: .5em;
}
#header ul {
list-style: none;
text-align: right;
float:right;
vertical-align: middle;
margin: 0;
padding: 0;
}
top, right, bottom, left
#header li a.selected {
color: black;
text-decoration: none;
}
<div id="header">
<h1><a href="index.htm">AppEngineLearn</a></h1>
<ul>
<li><a href="sites.htm" class="selected">Sites</a></li>
<li><a href="topics.htm" >Topics</a></li>
</ul>
</div>
<div id="header">
<h1><a href="index.htm">AppEngineLearn</a></h1>
<ul>
<li><a href="sites.htm">Sites</a></li>
<li><a href="topics.htm" class="selected">Topics</a></li>
</ul>
</div>
CSSValidation
• You can validate your CSS to make sure it has no syntax errors
• Browsers will generally quietly ignore bad CSS syntax
• http://jigsaw.w3.org/css-validator
• The validator can save you time
and sanity
Source: W3C http://validator.w3.org/check

More Related Content

What's hot

Jquery News Packages
Jquery News PackagesJquery News Packages
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tips
Chris Love
 
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Deepak Sharma
 
Basics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPointBasics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPointSahil Gandhi
 
Intro to jQuery for Drupal
Intro to jQuery for DrupalIntro to jQuery for Drupal
Intro to jQuery for Drupaljhamiltoorion
 
BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12
ucbdrupal
 
Thinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSSThinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSS
TJ Stalcup
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme development
Tammy Hart
 
Grok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateGrok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb update
Laura Scott
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
Russ Weakley
 
Introduction to Custom WordPress Themeing
Introduction to Custom WordPress ThemeingIntroduction to Custom WordPress Themeing
Introduction to Custom WordPress Themeing
Jamie Schmid
 
The web context
The web contextThe web context
The web context
Dan Phiffer
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2
Josh Lee
 
Web 101 intro to html
Web 101  intro to htmlWeb 101  intro to html
Web 101 intro to html
Hawkman Academy
 
HTML/CSS Workshop @ Searchcamp
HTML/CSS Workshop @ SearchcampHTML/CSS Workshop @ Searchcamp
HTML/CSS Workshop @ Searchcamp
James Mills
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
Chandra Prakash Thapa
 
Take Your Markup to 11
Take Your Markup to 11Take Your Markup to 11
Take Your Markup to 11
Emily Lewis
 
Intro to HTML
Intro to HTMLIntro to HTML
Html:css crash course (4:5)
Html:css crash course (4:5)Html:css crash course (4:5)
Html:css crash course (4:5)
Thinkful
 

What's hot (20)

Jquery News Packages
Jquery News PackagesJquery News Packages
Jquery News Packages
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tips
 
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
 
Basics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPointBasics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPoint
 
Intro to jQuery for Drupal
Intro to jQuery for DrupalIntro to jQuery for Drupal
Intro to jQuery for Drupal
 
BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12
 
Thinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSSThinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSS
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme development
 
HTML News Packages Lesson
HTML News Packages LessonHTML News Packages Lesson
HTML News Packages Lesson
 
Grok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateGrok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb update
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
 
Introduction to Custom WordPress Themeing
Introduction to Custom WordPress ThemeingIntroduction to Custom WordPress Themeing
Introduction to Custom WordPress Themeing
 
The web context
The web contextThe web context
The web context
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2
 
Web 101 intro to html
Web 101  intro to htmlWeb 101  intro to html
Web 101 intro to html
 
HTML/CSS Workshop @ Searchcamp
HTML/CSS Workshop @ SearchcampHTML/CSS Workshop @ Searchcamp
HTML/CSS Workshop @ Searchcamp
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
 
Take Your Markup to 11
Take Your Markup to 11Take Your Markup to 11
Take Your Markup to 11
 
Intro to HTML
Intro to HTMLIntro to HTML
Intro to HTML
 
Html:css crash course (4:5)
Html:css crash course (4:5)Html:css crash course (4:5)
Html:css crash course (4:5)
 

Viewers also liked

Life1234
Life1234Life1234
Life1234mcm226
 
Preliminary task evaluation
Preliminary task evaluationPreliminary task evaluation
Preliminary task evaluationjoshthorleykba
 
Syllabus designing-1225482229015374-8
Syllabus designing-1225482229015374-8Syllabus designing-1225482229015374-8
Syllabus designing-1225482229015374-8Karen Hope
 
Construir el circuito solo con las compuertas nand y nor
Construir el circuito solo con las compuertas nand y norConstruir el circuito solo con las compuertas nand y nor
Construir el circuito solo con las compuertas nand y nor
Jose Luis Dorao
 
Мастер Травел ХХК
Мастер Травел ХХКМастер Травел ХХК
Мастер Травел ХХК
Gana Lkh
 
PlutoVPN slides
PlutoVPN slidesPlutoVPN slides
PlutoVPN slides
plutovpn
 
Five Free Ways to Make Your Business Work Better in Mobile
Five Free Ways to Make Your Business Work Better in MobileFive Free Ways to Make Your Business Work Better in Mobile
Five Free Ways to Make Your Business Work Better in Mobile
BrandEmotivity
 
SAMU French Network Danese presentation REG200NORDPR SAMU
SAMU French Network Danese presentation REG200NORDPR SAMUSAMU French Network Danese presentation REG200NORDPR SAMU
SAMU French Network Danese presentation REG200NORDPR SAMU
Miguel Martinez Almoyna
 
Mobile Connects the Future
Mobile Connects the FutureMobile Connects the Future
Mobile Connects the Future
BrandEmotivity
 
Compuertas Lógicas y Diseño
Compuertas Lógicas y DiseñoCompuertas Lógicas y Diseño
Compuertas Lógicas y Diseño
Jose Luis Dorao
 
Wstęp do ... Paweł Kuś
Wstęp do ... Paweł KuśWstęp do ... Paweł Kuś
Wstęp do ... Paweł Kuś
bratka.s
 
Mobile and Luxury Retail Brands
Mobile and Luxury Retail BrandsMobile and Luxury Retail Brands
Mobile and Luxury Retail Brands
BrandEmotivity
 
Reg510 jap samu logistics in japanese bertrand molimula
Reg510 jap samu logistics in japanese bertrand molimulaReg510 jap samu logistics in japanese bertrand molimula
Reg510 jap samu logistics in japanese bertrand molimula
Miguel Martinez Almoyna
 
Consuntivo 2015 Guardia di Finanza di Reggio Calabria
Consuntivo 2015 Guardia di Finanza di Reggio CalabriaConsuntivo 2015 Guardia di Finanza di Reggio Calabria
Consuntivo 2015 Guardia di Finanza di Reggio Calabria
Newz.it
 
Reg700 por a neonata proteçao civil sanitaria em brasil
Reg700 por a neonata proteçao civil sanitaria em brasilReg700 por a neonata proteçao civil sanitaria em brasil
Reg700 por a neonata proteçao civil sanitaria em brasil
Miguel Martinez Almoyna
 
Reg8cPOR a classificaçao das urgencias individuais em caso de emergencia glo...
Reg8cPOR a classificaçao das urgencias individuais  em caso de emergencia glo...Reg8cPOR a classificaçao das urgencias individuais  em caso de emergencia glo...
Reg8cPOR a classificaçao das urgencias individuais em caso de emergencia glo...
Miguel Martinez Almoyna
 
Reg1000 eng franco japanese and chilian maritime samu project
Reg1000 eng franco japanese and chilian maritime samu projectReg1000 eng franco japanese and chilian maritime samu project
Reg1000 eng franco japanese and chilian maritime samu project
Miguel Martinez Almoyna
 
Exposicion GWT
Exposicion GWTExposicion GWT
Exposicion GWT
Jose Luis Dorao
 

Viewers also liked (20)

Life1234
Life1234Life1234
Life1234
 
Preliminary task evaluation
Preliminary task evaluationPreliminary task evaluation
Preliminary task evaluation
 
Syllabus designing-1225482229015374-8
Syllabus designing-1225482229015374-8Syllabus designing-1225482229015374-8
Syllabus designing-1225482229015374-8
 
Music magazine
Music magazineMusic magazine
Music magazine
 
Construir el circuito solo con las compuertas nand y nor
Construir el circuito solo con las compuertas nand y norConstruir el circuito solo con las compuertas nand y nor
Construir el circuito solo con las compuertas nand y nor
 
Мастер Травел ХХК
Мастер Травел ХХКМастер Травел ХХК
Мастер Травел ХХК
 
PlutoVPN slides
PlutoVPN slidesPlutoVPN slides
PlutoVPN slides
 
Reg2 eng nosology nigeria
Reg2 eng nosology nigeriaReg2 eng nosology nigeria
Reg2 eng nosology nigeria
 
Five Free Ways to Make Your Business Work Better in Mobile
Five Free Ways to Make Your Business Work Better in MobileFive Free Ways to Make Your Business Work Better in Mobile
Five Free Ways to Make Your Business Work Better in Mobile
 
SAMU French Network Danese presentation REG200NORDPR SAMU
SAMU French Network Danese presentation REG200NORDPR SAMUSAMU French Network Danese presentation REG200NORDPR SAMU
SAMU French Network Danese presentation REG200NORDPR SAMU
 
Mobile Connects the Future
Mobile Connects the FutureMobile Connects the Future
Mobile Connects the Future
 
Compuertas Lógicas y Diseño
Compuertas Lógicas y DiseñoCompuertas Lógicas y Diseño
Compuertas Lógicas y Diseño
 
Wstęp do ... Paweł Kuś
Wstęp do ... Paweł KuśWstęp do ... Paweł Kuś
Wstęp do ... Paweł Kuś
 
Mobile and Luxury Retail Brands
Mobile and Luxury Retail BrandsMobile and Luxury Retail Brands
Mobile and Luxury Retail Brands
 
Reg510 jap samu logistics in japanese bertrand molimula
Reg510 jap samu logistics in japanese bertrand molimulaReg510 jap samu logistics in japanese bertrand molimula
Reg510 jap samu logistics in japanese bertrand molimula
 
Consuntivo 2015 Guardia di Finanza di Reggio Calabria
Consuntivo 2015 Guardia di Finanza di Reggio CalabriaConsuntivo 2015 Guardia di Finanza di Reggio Calabria
Consuntivo 2015 Guardia di Finanza di Reggio Calabria
 
Reg700 por a neonata proteçao civil sanitaria em brasil
Reg700 por a neonata proteçao civil sanitaria em brasilReg700 por a neonata proteçao civil sanitaria em brasil
Reg700 por a neonata proteçao civil sanitaria em brasil
 
Reg8cPOR a classificaçao das urgencias individuais em caso de emergencia glo...
Reg8cPOR a classificaçao das urgencias individuais  em caso de emergencia glo...Reg8cPOR a classificaçao das urgencias individuais  em caso de emergencia glo...
Reg8cPOR a classificaçao das urgencias individuais em caso de emergencia glo...
 
Reg1000 eng franco japanese and chilian maritime samu project
Reg1000 eng franco japanese and chilian maritime samu projectReg1000 eng franco japanese and chilian maritime samu project
Reg1000 eng franco japanese and chilian maritime samu project
 
Exposicion GWT
Exposicion GWTExposicion GWT
Exposicion GWT
 

Similar to Css

GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1Heather Rock
 
Intermediate Web Design
Intermediate Web DesignIntermediate Web Design
Intermediate Web Design
mlincol2
 
Internet tech &amp; web prog. p4,5
Internet tech &amp; web prog.  p4,5Internet tech &amp; web prog.  p4,5
Internet tech &amp; web prog. p4,5
Taymoor Nazmy
 
Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3
Tadpole Collective
 
Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Aslam Najeebdeen
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflowPeter Kaizer
 
Intro To Twitter Bootstrap
Intro To Twitter BootstrapIntro To Twitter Bootstrap
Intro To Twitter Bootstrap
Ahmed Haque
 
Design Systems, Pattern Libraries & WordPress
Design Systems, Pattern Libraries & WordPressDesign Systems, Pattern Libraries & WordPress
Design Systems, Pattern Libraries & WordPress
Jesse James Arnold
 
uptu web technology unit 2 Css
uptu web technology unit 2 Cssuptu web technology unit 2 Css
uptu web technology unit 2 Css
Abhishek Kesharwani
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.docbutest
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.docbutest
 
Vskills certified css designer Notes
Vskills certified css designer NotesVskills certified css designer Notes
Vskills certified css designer Notes
Vskills
 
Web-03-CSS.ppt
Web-03-CSS.pptWeb-03-CSS.ppt
Web-03-CSS.ppt
joeveller
 
Pfnp slides
Pfnp slidesPfnp slides
Pfnp slides
William Myers
 
Html css crash course may 11th, atlanta
Html css crash course may 11th, atlantaHtml css crash course may 11th, atlanta
Html css crash course may 11th, atlanta
Thinkful
 

Similar to Css (20)

Artdm171 Week4 Tags
Artdm171 Week4 TagsArtdm171 Week4 Tags
Artdm171 Week4 Tags
 
Web
WebWeb
Web
 
Artdm171 Week5 Css
Artdm171 Week5 CssArtdm171 Week5 Css
Artdm171 Week5 Css
 
CSS
CSSCSS
CSS
 
GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1
 
Intermediate Web Design
Intermediate Web DesignIntermediate Web Design
Intermediate Web Design
 
Internet tech &amp; web prog. p4,5
Internet tech &amp; web prog.  p4,5Internet tech &amp; web prog.  p4,5
Internet tech &amp; web prog. p4,5
 
Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3
 
Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Web Design Bootcamp - Day1
Web Design Bootcamp - Day1
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflow
 
Intro To Twitter Bootstrap
Intro To Twitter BootstrapIntro To Twitter Bootstrap
Intro To Twitter Bootstrap
 
css v1 guru
css v1 gurucss v1 guru
css v1 guru
 
Design Systems, Pattern Libraries & WordPress
Design Systems, Pattern Libraries & WordPressDesign Systems, Pattern Libraries & WordPress
Design Systems, Pattern Libraries & WordPress
 
uptu web technology unit 2 Css
uptu web technology unit 2 Cssuptu web technology unit 2 Css
uptu web technology unit 2 Css
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
 
Vskills certified css designer Notes
Vskills certified css designer NotesVskills certified css designer Notes
Vskills certified css designer Notes
 
Web-03-CSS.ppt
Web-03-CSS.pptWeb-03-CSS.ppt
Web-03-CSS.ppt
 
Pfnp slides
Pfnp slidesPfnp slides
Pfnp slides
 
Html css crash course may 11th, atlanta
Html css crash course may 11th, atlantaHtml css crash course may 11th, atlanta
Html css crash course may 11th, atlanta
 

Recently uploaded

Tata Group Dials Taiwan for Its Chipmaking Ambition in Gujarat’s Dholera
Tata Group Dials Taiwan for Its Chipmaking Ambition in Gujarat’s DholeraTata Group Dials Taiwan for Its Chipmaking Ambition in Gujarat’s Dholera
Tata Group Dials Taiwan for Its Chipmaking Ambition in Gujarat’s Dholera
Avirahi City Dholera
 
ikea_woodgreen_petscharity_dog-alogue_digital.pdf
ikea_woodgreen_petscharity_dog-alogue_digital.pdfikea_woodgreen_petscharity_dog-alogue_digital.pdf
ikea_woodgreen_petscharity_dog-alogue_digital.pdf
agatadrynko
 
Project File Report BBA 6th semester.pdf
Project File Report BBA 6th semester.pdfProject File Report BBA 6th semester.pdf
Project File Report BBA 6th semester.pdf
RajPriye
 
BeMetals Presentation_May_22_2024 .pdf
BeMetals Presentation_May_22_2024   .pdfBeMetals Presentation_May_22_2024   .pdf
BeMetals Presentation_May_22_2024 .pdf
DerekIwanaka1
 
Enterprise Excellence is Inclusive Excellence.pdf
Enterprise Excellence is Inclusive Excellence.pdfEnterprise Excellence is Inclusive Excellence.pdf
Enterprise Excellence is Inclusive Excellence.pdf
KaiNexus
 
Introduction to Amazon company 111111111111
Introduction to Amazon company 111111111111Introduction to Amazon company 111111111111
Introduction to Amazon company 111111111111
zoyaansari11365
 
VAT Registration Outlined In UAE: Benefits and Requirements
VAT Registration Outlined In UAE: Benefits and RequirementsVAT Registration Outlined In UAE: Benefits and Requirements
VAT Registration Outlined In UAE: Benefits and Requirements
uae taxgpt
 
Premium MEAN Stack Development Solutions for Modern Businesses
Premium MEAN Stack Development Solutions for Modern BusinessesPremium MEAN Stack Development Solutions for Modern Businesses
Premium MEAN Stack Development Solutions for Modern Businesses
SynapseIndia
 
ENTREPRENEURSHIP TRAINING.ppt for graduating class (1).ppt
ENTREPRENEURSHIP TRAINING.ppt for graduating class (1).pptENTREPRENEURSHIP TRAINING.ppt for graduating class (1).ppt
ENTREPRENEURSHIP TRAINING.ppt for graduating class (1).ppt
zechu97
 
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
taqyed
 
What are the main advantages of using HR recruiter services.pdf
What are the main advantages of using HR recruiter services.pdfWhat are the main advantages of using HR recruiter services.pdf
What are the main advantages of using HR recruiter services.pdf
HumanResourceDimensi1
 
Digital Transformation and IT Strategy Toolkit and Templates
Digital Transformation and IT Strategy Toolkit and TemplatesDigital Transformation and IT Strategy Toolkit and Templates
Digital Transformation and IT Strategy Toolkit and Templates
Aurelien Domont, MBA
 
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdfModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
fisherameliaisabella
 
Cree_Rey_BrandIdentityKit.PDF_PersonalBd
Cree_Rey_BrandIdentityKit.PDF_PersonalBdCree_Rey_BrandIdentityKit.PDF_PersonalBd
Cree_Rey_BrandIdentityKit.PDF_PersonalBd
creerey
 
Affordable Stationery Printing Services in Jaipur | Navpack n Print
Affordable Stationery Printing Services in Jaipur | Navpack n PrintAffordable Stationery Printing Services in Jaipur | Navpack n Print
Affordable Stationery Printing Services in Jaipur | Navpack n Print
Navpack & Print
 
amptalk_RecruitingDeck_english_2024.06.05
amptalk_RecruitingDeck_english_2024.06.05amptalk_RecruitingDeck_english_2024.06.05
amptalk_RecruitingDeck_english_2024.06.05
marketing317746
 
Unveiling the Secrets How Does Generative AI Work.pdf
Unveiling the Secrets How Does Generative AI Work.pdfUnveiling the Secrets How Does Generative AI Work.pdf
Unveiling the Secrets How Does Generative AI Work.pdf
Sam H
 
Kseniya Leshchenko: Shared development support service model as the way to ma...
Kseniya Leshchenko: Shared development support service model as the way to ma...Kseniya Leshchenko: Shared development support service model as the way to ma...
Kseniya Leshchenko: Shared development support service model as the way to ma...
Lviv Startup Club
 
LA HUG - Video Testimonials with Chynna Morgan - June 2024
LA HUG - Video Testimonials with Chynna Morgan - June 2024LA HUG - Video Testimonials with Chynna Morgan - June 2024
LA HUG - Video Testimonials with Chynna Morgan - June 2024
Lital Barkan
 
Maksym Vyshnivetskyi: PMO Quality Management (UA)
Maksym Vyshnivetskyi: PMO Quality Management (UA)Maksym Vyshnivetskyi: PMO Quality Management (UA)
Maksym Vyshnivetskyi: PMO Quality Management (UA)
Lviv Startup Club
 

Recently uploaded (20)

Tata Group Dials Taiwan for Its Chipmaking Ambition in Gujarat’s Dholera
Tata Group Dials Taiwan for Its Chipmaking Ambition in Gujarat’s DholeraTata Group Dials Taiwan for Its Chipmaking Ambition in Gujarat’s Dholera
Tata Group Dials Taiwan for Its Chipmaking Ambition in Gujarat’s Dholera
 
ikea_woodgreen_petscharity_dog-alogue_digital.pdf
ikea_woodgreen_petscharity_dog-alogue_digital.pdfikea_woodgreen_petscharity_dog-alogue_digital.pdf
ikea_woodgreen_petscharity_dog-alogue_digital.pdf
 
Project File Report BBA 6th semester.pdf
Project File Report BBA 6th semester.pdfProject File Report BBA 6th semester.pdf
Project File Report BBA 6th semester.pdf
 
BeMetals Presentation_May_22_2024 .pdf
BeMetals Presentation_May_22_2024   .pdfBeMetals Presentation_May_22_2024   .pdf
BeMetals Presentation_May_22_2024 .pdf
 
Enterprise Excellence is Inclusive Excellence.pdf
Enterprise Excellence is Inclusive Excellence.pdfEnterprise Excellence is Inclusive Excellence.pdf
Enterprise Excellence is Inclusive Excellence.pdf
 
Introduction to Amazon company 111111111111
Introduction to Amazon company 111111111111Introduction to Amazon company 111111111111
Introduction to Amazon company 111111111111
 
VAT Registration Outlined In UAE: Benefits and Requirements
VAT Registration Outlined In UAE: Benefits and RequirementsVAT Registration Outlined In UAE: Benefits and Requirements
VAT Registration Outlined In UAE: Benefits and Requirements
 
Premium MEAN Stack Development Solutions for Modern Businesses
Premium MEAN Stack Development Solutions for Modern BusinessesPremium MEAN Stack Development Solutions for Modern Businesses
Premium MEAN Stack Development Solutions for Modern Businesses
 
ENTREPRENEURSHIP TRAINING.ppt for graduating class (1).ppt
ENTREPRENEURSHIP TRAINING.ppt for graduating class (1).pptENTREPRENEURSHIP TRAINING.ppt for graduating class (1).ppt
ENTREPRENEURSHIP TRAINING.ppt for graduating class (1).ppt
 
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
 
What are the main advantages of using HR recruiter services.pdf
What are the main advantages of using HR recruiter services.pdfWhat are the main advantages of using HR recruiter services.pdf
What are the main advantages of using HR recruiter services.pdf
 
Digital Transformation and IT Strategy Toolkit and Templates
Digital Transformation and IT Strategy Toolkit and TemplatesDigital Transformation and IT Strategy Toolkit and Templates
Digital Transformation and IT Strategy Toolkit and Templates
 
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdfModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
 
Cree_Rey_BrandIdentityKit.PDF_PersonalBd
Cree_Rey_BrandIdentityKit.PDF_PersonalBdCree_Rey_BrandIdentityKit.PDF_PersonalBd
Cree_Rey_BrandIdentityKit.PDF_PersonalBd
 
Affordable Stationery Printing Services in Jaipur | Navpack n Print
Affordable Stationery Printing Services in Jaipur | Navpack n PrintAffordable Stationery Printing Services in Jaipur | Navpack n Print
Affordable Stationery Printing Services in Jaipur | Navpack n Print
 
amptalk_RecruitingDeck_english_2024.06.05
amptalk_RecruitingDeck_english_2024.06.05amptalk_RecruitingDeck_english_2024.06.05
amptalk_RecruitingDeck_english_2024.06.05
 
Unveiling the Secrets How Does Generative AI Work.pdf
Unveiling the Secrets How Does Generative AI Work.pdfUnveiling the Secrets How Does Generative AI Work.pdf
Unveiling the Secrets How Does Generative AI Work.pdf
 
Kseniya Leshchenko: Shared development support service model as the way to ma...
Kseniya Leshchenko: Shared development support service model as the way to ma...Kseniya Leshchenko: Shared development support service model as the way to ma...
Kseniya Leshchenko: Shared development support service model as the way to ma...
 
LA HUG - Video Testimonials with Chynna Morgan - June 2024
LA HUG - Video Testimonials with Chynna Morgan - June 2024LA HUG - Video Testimonials with Chynna Morgan - June 2024
LA HUG - Video Testimonials with Chynna Morgan - June 2024
 
Maksym Vyshnivetskyi: PMO Quality Management (UA)
Maksym Vyshnivetskyi: PMO Quality Management (UA)Maksym Vyshnivetskyi: PMO Quality Management (UA)
Maksym Vyshnivetskyi: PMO Quality Management (UA)
 

Css

  • 2. CSS Cascading Style Sheets Charles Severance www.dr-chuck.com http://en.wikipedia.org/wiki/Cascading_Style_Sheets
  • 3. 1995 2007 HTML has evolved a *lot* over the years - as computers and networks have gotten faster. Source: www.yahoo.com
  • 4. Tranforming the look and feel of a page using a CSS style sheet. body { font-family: arial, san-serif; } a, a:link { color: #0000cc; } ... +
  • 6. The Browser has “default styling” for all tags. <h1><a href="index.htm"> AppEngineLearn</a></h1> <ul> <li><a href="sites.htm">Sites</a></li> <li><a href="topics.htm" >Topics</a></li> </ul> <h2>Google App Engine: About</h2> <p> Welcome to the site dedicated to learning the Google Application Engine. We hope you find www.appenginelearn.com useful. </p>
  • 7. We will apply CSS to the tags in the document. With no changes to the HTML.
  • 8. Lots of CSS properties to play with We can set these properties on any HTML tag in a document. background-color, border-width, border-color, margin-top, padding, font-family, top, left, right, float, font-size, background-image, text-align, text-decoration, font-style, font- weight, vertical-align, visibility, overflow, ....
  • 10. Anatomy of a CSS Rule body font-family: arial, sans-serif; font-size: 100%; } property - which aspect of CSS are we changing selector - which part of the document does this rule apply to value - What are we setting the property to.
  • 11. Multiple tags with same styling h1, h2, h3 { color: yellow; background-color: black; } Making a noticeable background color is a fun way to debug / identify blocks.
  • 12. Three ways to add style rules • Inline Style - Add style information to a tag • Embedded Style - Add style information to the document at the beginning • External Style Sheet - Put all of your style in an external file • Preferred - because two people can work independently
  • 13. csev$ ls –l total 32 -rw-r--r-- 1 csev staff 44 Jan 28 13:14 glike.css- rw-r--r-- 1 csev staff 680 Feb 17 08:25 index.htm-rw- r--r-- 1 csev staff 886 Feb 17 08:00 sites.htm-rw-r-- r-- 1 csev staff 681 Feb 17 08:01 topics.htm csev$ We put the CSS file in the same directory so the link works. <head> <title>Learning the Google App Engine</title> <link type="text/css" rel="stylesheet" href="glike.css"> </head>
  • 14. Fonts • Default fonts are ugly and they have Serifs - which make them harder to read on a screen • So the first thing I usually want to do is override the font in my document • And I want to do this everywhere.
  • 15. Fonts body { font-family: "Trebuchet MS", Helvetica, Arial, sans-serif; font-size: x-large; } Most Favourite Least Favourite Fallback fonts: serif, sans-serif, monospace, cursive and fantasy.
  • 16. Font Factors font-size: xx-small x-small small medium large x-large xx-large font-weight: bold or normal font-style: normal or italic text-decoration: none, underline, overline, or line-through
  • 17. Color Names • W3C has listed 16 color names that will validate with an HTML validator. • The color names are: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow. Source: http://www.w3schools.com/html/html_colors.asp
  • 18. Colors by the number... #e2edffThree Numbers, Red, Green , and Blue - each from 00 - FF (Hexidecimal) #ffffff = white #000000 = black #ff0000 = red #00ff00 = green #0000ff = blue Source: http://www.w3schools.com/css/css_colornames.asp Web-safe colors #edf = #eeddff
  • 19. Default Styling for Links Downright Ugly! Post-Click: Source: www.yahoo.com
  • 20. Styling Links a { font-weight: bold; } a:link { color: black; } a:visited { color: gray; } a:hover { text-decoration: none; color: white; background-color: navy; } a:active { color: aqua; background-color: navy; } link - before a visit visited - after it has been visited hover - when your mouse is over it but you have not clicked active - you have clicked it and you have not yet seen the new page Browser default styling for links is downright ugly!
  • 21. CSS Tags and Attributes • As CSS was introduced they introduced two new tags that are pretty much there to serve as handles for styling • <div> - A block tag (breaks justification) • <span> - An inline tag that does not break justification • There are two attributes with special meaning to CSS • id= - Marks a unique block within the document for styling (use only once) • class= - Marks a non-unique tag within the document for styling (multi-use)
  • 22. div as Container <div> <p>This is a paragraph inside a div.</p> <p>So is this.</p> </div> <div id="header"> <ul> <li><a href="sites.htm">Sites</a></li> <li><a href="topics.htm" >Topics</a></li> </ul> </div> “div” stands for “division” as it allows us to divide our page into parts or sections and then do something different with each “section”. The id attribute on the tag allows us to uniquely mark a div in a document. The id tag is also useful for screen readers.
  • 23. Nested divs <div id="outer"> <div id="nested1"> <p>A paragraph inside the first nested div.</p> </div> <div id="nested2"> <p>A paragraph inside the second nested div.</p> </div> </div> <!-- End of the outer div --> Adding divs give us a “handle” to apply styling (CSS) to a block of text.
  • 24. Styling with class= .fun { color: #339999; font-family: Georgia, Times, serif; letter-spacing: 0.05em; } <p class="fun">A man walks into a bar; you would've thought he'd see it coming!</p> <p>Have a nice day.<p> <p class=”fun”>More fun stuff</p> class can be used many times in a document.
  • 25. Span (Invisible tag) <p><span class="fun">Bubble Under</span> is a group of diving enthusiasts based in the south-west UK who meet up for diving trips in the summer months when the weather is good and the bacon rolls are flowing. We arrange weekends away as small groups to cut the costs of accommodation and travel and to ensure that everyone gets a trustworthy dive buddy.</p> Sometimes you want to style something smaller than a whole block - then use span. Do not use span if you are applying something to a whole block - just put your styling on the enclosing block tag.
  • 28. Transform from ugly to fancy with CSS
  • 29. body { font-family: arial, sans-serif; } a { color: blue; } h1 a { text-decoration: none; color: black; } <head> <title>Learning the Google App Engine</title> <link type="text/css" rel="stylesheet" href="glike.css"> </head>
  • 31. Quick Advertisement - Firefox • You pretty much need to use Firefox for serious website development • Important plugins: • Web Developer - Chris Pedrick • FireBug - Joe Hewitt http://addons.mozilla.org/
  • 33. CSS Box Model • height and width properties size the block element • margin properties define the space around the block element • border properties define the borders around a a block element • padding properties define the space between the element border and the element content • background properties allow you to control the background color of an element, set an image as the background, repeat a background image vertically or horizontally, and position an image on a page http://reference.sitepoint.com/css/boxmodel
  • 34. The Box Model .trapped { height: 100px; width: 200px; margin: 20px; border: 5px solid yellow; background:red; padding: 20px; font-family:Arial; color:orange; font-size:20px; } <p class=”trapped”> I am trapped in a glass case of emotion which is 100px high and 200px wide. </p> 11 55 00 11 99 00 11 44 00 11 00 00 5 20 20
  • 35. Border, padding, and margin are additive. .trapped { height: 50px; width: 50px; } .trapped2 { height: 50px; width: 50px; border: 5px solid yellow; padding: 10px; } <p class="trapped"> One</p> <p class="trapped2"> Two</p>
  • 36. #header { background-color: #dde; border-top: 3px solid #36c; height: 100%; overflow:hidden; padding: 7px; margin-top: 5px; } #header h1 { font-size: 20px; float: left; vertical-align: middle; margin: 0; padding: 0 0 0 .3em; } #header li { font-size: 14px; display: inline; padding: .5em; } #header ul { list-style: none; text-align: right; float:right; vertical-align: middle; margin: 0; padding: 0; } top, right, bottom, left
  • 37. #header li a.selected { color: black; text-decoration: none; } <div id="header"> <h1><a href="index.htm">AppEngineLearn</a></h1> <ul> <li><a href="sites.htm" class="selected">Sites</a></li> <li><a href="topics.htm" >Topics</a></li> </ul> </div> <div id="header"> <h1><a href="index.htm">AppEngineLearn</a></h1> <ul> <li><a href="sites.htm">Sites</a></li> <li><a href="topics.htm" class="selected">Topics</a></li> </ul> </div>
  • 38. CSSValidation • You can validate your CSS to make sure it has no syntax errors • Browsers will generally quietly ignore bad CSS syntax • http://jigsaw.w3.org/css-validator • The validator can save you time and sanity Source: W3C http://validator.w3.org/check