SlideShare una empresa de Scribd logo
1 de 35
CSS for Bloggers
How to Make Your Blog Look and Convert Better
(Without a Designer)
David Weliver, MoneyUnder30.com
What is CSS?
CSS – or cascading style sheets – is a coding
language used to format HTML. It gives most of
today’s Websites their unique look, feel and
functionality.
What You
Can Do With
CSS
With basic CSS you can
change link colors, fonts
and sizes, background
colors and more.
As you learn more you can
style tables and menus or
style useful widgets that can
increase conversion and
make your blog look more
professional.
Another use for CSS is to
make your blog display
better on mobile devices.
Why CSS Exists
Without CSS

With CSS

You can use HTML tags
like <strong> to make
font bold or <bgcolor> to
set a background color.

CSS enables you to
separate code from
content.

But you must insert this
code on every page and
every time you want to
change the format.

CSS saves work: You
define a style once, then
apply it anywhere its
needed.

This extends the amount
of HTML necessary and
adds a lot of code to your
content.
How CSS Works
In a style sheet (.css file), you define the
following:
h1 {font-size: 12px; color: blue;}

Wordpress makes your blog and the HTML looks like
this:
<h1>I Like Money, Don’t You?</h1>

Your reader sees this:
CSS Syntax
For each selector (i.e., h1 for headers), you define the value for
each property of the selector. Here, the h1 color is blue and the fontsize is 12 pixels.

Now, any text on your blog between the <h1> and </h1> tags will be
blue and 12 pixels in size.

Image source:
http://www.w3schools.com/css/css_syntax.asp
Where to Edit CSS Code
CSS lives in your theme’s style sheet (.css file). Edit this by
going to Appearance  Editor in Wordpress. Make a
backup first!!
Where to Edit CSS Code
Some Wordpress themes provide a custom.css
file where you can put CSS that will override the
default styles. This is easier for small changes.
Where to Edit CSS Code
Although not ideal, you can also define CSS
inline.
<p style=“font-size: 12px; color: blue;”>Debt is bad,
mmmkay?</p>

Or, in the <head> section of an HTML page.
<html>
<head>
<style type="text/css">
h1 {font-size: 12px; color: blue;}
</style>
</head>
</html>
CSS Selectors
Common global CSS selectors include body; p
(paragraphs); h1, h2, h3, etc. (headers); and a
(links).
To further customize your site, you define IDs or
classes for the elements on your website.
Elements are defined in HTML by the <div> tag.
<div class=“red”>Debt is bad, mmmkay?</div>
<div id=“blue”>Debt is bad, mmmkay?</div>
CSS ID and Class
ID

Class

Used to define single,
unique elements

Used to define groups
of elements

Defined with a “#”

Defined with a “.”

#red {font-size: 12px; color:
red;}

.blue {font-size: 12px; color:
red;}

<div id=“red”>Roth
IRA!</div>

<div class=“blue”>Roth
IRA!</div>
CSS ID and Class
IDs are more specific than classes
If an element has both a class and an ID, the ID
takes precedence
.post {font-size: 12px; color: blue;}
#red-post {font-size: 12px; color: red;}
<div class=“post”>Roth IRAs are awesome!
<div id=“red-post”>You should open one.
</div>
</div>
CSS Properties
Learning a few common CSS properties
will give you lots of control over your site’s
appearance.
The CSS Font Property
Font style and size may be defined in a few
ways.
The font property
p {font: arial,sans-serif;}

can define just the font:

Or additional elements like size:
p {font: 12px arial,sans-serif;}

Or even more elements like style and line height:

p {font: bold 12px/30px arial,sans-serif;}
Colors in CSS
The color property defines text color using color
names or hex codes.
p {color: #d10000;}

The background-color property defines the
background color of an element:
p {background-color: #efefef;}
Links
Applying CSS to links can be useful to create
compelling calls to action. An example of a global link
format:
a {color: red; text-decoration: none; border-bottom: 1px dotted
#000;}

To give a particular link special formatting, we create
an ID:
a#action {color: #fff; background-color: red; padding: 5px;
border-radius: 5px;}
Margins, Borders &
Padding
Margins

Padding

Control the outside
spacing of an element

Control the inside
spacing of an element

Margins are transparent

Padding shows an
element’s background
color
Margins, Borders &
Padding
The following adds a 10 pixel margin on all four
sides:
.box {margin: 10px;}

This adds 10 pixel padding on the top and left
only:
.box {padding-top: 10px; padding-left: 10px;}

This adds 10 pixel padding on the top, 5 pixel
padding on the left and right, and 20 pixel padding on
the bottom:
.box {padding: 10px 5px 20px 5px;}
Margins, Borders &
Padding
When adding a border, you must define the border
size, color, and width. For example:
.box {border: 5px solid #000;}

Looks like this:

.box {border: 1px dashed blue;}

Looks like this:
Margins, Borders &
Padding
When defining different margin/padding values for
different sides of an element, list the values
clockwise:
.box {margin: TOP RIGHT BOTTOM LEFT;}

The following element has a margin of 10px on top,
20px left and right, and 5px on bottom:
.box {margin: 10px 20px 5px 20px;}

The following element has a margin of 10px on top
and 20px left and right:
.box {margin: 10px 20px;}
Floats
•
•
•

CSS enables elements to “float” to one side or the other.
With floats, you can create columns without being confined to an
HTML table or you can wrap text around an element such as an
AdSense block.
Floats are tricky!

Image source: http://css-tricks.com/all-about-floats/
Responsive
Design
With CSS, you can improve how your blog
appears on mobile devices
Responsive
Design
•

•

Certain elements (like
floats) don’t display well on
small screens.
You can use CSS to change
how certain elements
display on mobile (or hide
them altogether using
display: none;).
CSS Tools
Programs and features that make working
with CSS easier
Inspect Element
With Inspect Element you can
click on an element to see its
CSS. You can edit the CSS and
immediately see how the
browser will display the altered
code.
Inspect Element
Chrome & Firefox: Right-click on target and click Inspect
Element
Internet Explorer: Access the Developer Toolbar (F12) then
CTRL+B
Advanced
Text Editors
For Mac: BBEdit (Free trial;
$50)
www.barebones.com/product
s/bbedit
For PC: Notepad ++ (Free)
http://notepad-plus-plus.org
More:
http://sixrevisions.com/webdevelopment/the-15-mostpopular-text-editors-for-
Experimentin
g with CSS
1.

2.
3.

Create an HTML file with
CSS defined in the
<head> section.
Code your CSS.
View the file in a browser
and use Inspect Element
to play around.
Cool CSS Tricks
A few examples of what CSS can do
Rounded Corners
Use border-radius: PIXELS;
Element does not require a border; will also work with
background color.
Gradients
Assigning the linergradient() value to the
background-image
property will display a
gradient in newer
browsers.
Here’s a generator:
www.colorzilla.com/gra
dient-editor
Inline Lists
Styling unordered and ordered
lists is tricky, but the effects can
be powerful.
A beginning trick is to learn to
use display: inline to transform
vertical lists into horizontal
ones.
Conditional Table Rows
Like any programming
language, you can create
rules with CSS that apply
styles conditionally.
Where to learn
more
Resources for learning CSS
CSS Resources
Learning CSS
W3 Schools
www.w3schools.com/c
ss

Code Academy
www.codecademy.com/
courses/css-codingwith-style
HTML Dog
www.htmldog.com/guid
es/css/beginner

Writing CSS
CSS Validation
Service
http://jigsaw.w3.org/css
-validator
Clean CSS (Code
Compression Tool)
www.cleancss.com
CSS Generator
http://css3generator.co
m

Más contenido relacionado

La actualidad más candente

La actualidad más candente (16)

Html css
Html cssHtml css
Html css
 
Div Tag Tutorial
Div Tag TutorialDiv Tag Tutorial
Div Tag Tutorial
 
CSS
CSSCSS
CSS
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Web development using HTML and CSS
Web development using HTML and CSSWeb development using HTML and CSS
Web development using HTML and CSS
 
Css introduction
Css   introductionCss   introduction
Css introduction
 
Html Expression Web
Html Expression WebHtml Expression Web
Html Expression Web
 
Cascading style sheet (css)]
Cascading style sheet (css)]Cascading style sheet (css)]
Cascading style sheet (css)]
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS)Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS)
 
CSS
CSSCSS
CSS
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
CSS
CSSCSS
CSS
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 

Destacado

Get Your Name in Magazines: How to Get Media Attention for Your Blog - Linsey...
Get Your Name in Magazines: How to Get Media Attention for Your Blog - Linsey...Get Your Name in Magazines: How to Get Media Attention for Your Blog - Linsey...
Get Your Name in Magazines: How to Get Media Attention for Your Blog - Linsey...Philip Taylor
 
Brandon Turner panel
Brandon Turner panelBrandon Turner panel
Brandon Turner panelPhilip Taylor
 
Unefa iniciativa empresarial
Unefa iniciativa empresarialUnefa iniciativa empresarial
Unefa iniciativa empresarialKARLACORDOVA0610
 

Destacado (7)

Jean Chatzky
Jean ChatzkyJean Chatzky
Jean Chatzky
 
Dustin Hartzler
Dustin Hartzler Dustin Hartzler
Dustin Hartzler
 
Get Your Name in Magazines: How to Get Media Attention for Your Blog - Linsey...
Get Your Name in Magazines: How to Get Media Attention for Your Blog - Linsey...Get Your Name in Magazines: How to Get Media Attention for Your Blog - Linsey...
Get Your Name in Magazines: How to Get Media Attention for Your Blog - Linsey...
 
Brandon Turner panel
Brandon Turner panelBrandon Turner panel
Brandon Turner panel
 
Phillips
PhillipsPhillips
Phillips
 
Hank Coleman
Hank ColemanHank Coleman
Hank Coleman
 
Unefa iniciativa empresarial
Unefa iniciativa empresarialUnefa iniciativa empresarial
Unefa iniciativa empresarial
 

Similar a David Weliver

Chapter 3 - CSS.pdf
Chapter 3 - CSS.pdfChapter 3 - CSS.pdf
Chapter 3 - CSS.pdfwubiederebe1
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Erin M. Kidwell
 
Vskills certified css designer Notes
Vskills certified css designer NotesVskills certified css designer Notes
Vskills certified css designer NotesVskills
 
Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.netProgrammer Blog
 
HTML to CSS Basics Exer 2.pptx
HTML to CSS Basics Exer 2.pptxHTML to CSS Basics Exer 2.pptx
HTML to CSS Basics Exer 2.pptxJJFajardo1
 
Introduction to css for product managers
Introduction to css for product managersIntroduction to css for product managers
Introduction to css for product managersRodhmir Labadie
 
Css Founder.com | Cssfounder Company
Css Founder.com | Cssfounder CompanyCss Founder.com | Cssfounder Company
Css Founder.com | Cssfounder CompanyCss Founder
 
Advanced Web Programming Chapter 8
Advanced Web Programming Chapter 8Advanced Web Programming Chapter 8
Advanced Web Programming Chapter 8RohanMistry15
 
Make Css easy(part:2) : easy tips for css(part:2)
Make Css easy(part:2) : easy tips for css(part:2)Make Css easy(part:2) : easy tips for css(part:2)
Make Css easy(part:2) : easy tips for css(part:2)shabab shihan
 
Css training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentialsCss training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentialsQA TrainingHub
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 
Basics about front-end
Basics about front-endBasics about front-end
Basics about front-endCETPA Infotech
 

Similar a David Weliver (20)

Chapter 3 - CSS.pdf
Chapter 3 - CSS.pdfChapter 3 - CSS.pdf
Chapter 3 - CSS.pdf
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
Vskills certified css designer Notes
Vskills certified css designer NotesVskills certified css designer Notes
Vskills certified css designer Notes
 
Css
CssCss
Css
 
INTRODUCTIONS OF CSS
INTRODUCTIONS OF CSSINTRODUCTIONS OF CSS
INTRODUCTIONS OF CSS
 
Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.net
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
HTML to CSS Basics Exer 2.pptx
HTML to CSS Basics Exer 2.pptxHTML to CSS Basics Exer 2.pptx
HTML to CSS Basics Exer 2.pptx
 
Introduction to css for product managers
Introduction to css for product managersIntroduction to css for product managers
Introduction to css for product managers
 
html-css
html-csshtml-css
html-css
 
Css
CssCss
Css
 
WT CSS
WT  CSSWT  CSS
WT CSS
 
Lecture-6.pptx
Lecture-6.pptxLecture-6.pptx
Lecture-6.pptx
 
Css Founder.com | Cssfounder Company
Css Founder.com | Cssfounder CompanyCss Founder.com | Cssfounder Company
Css Founder.com | Cssfounder Company
 
Advanced Web Programming Chapter 8
Advanced Web Programming Chapter 8Advanced Web Programming Chapter 8
Advanced Web Programming Chapter 8
 
Make Css easy(part:2) : easy tips for css(part:2)
Make Css easy(part:2) : easy tips for css(part:2)Make Css easy(part:2) : easy tips for css(part:2)
Make Css easy(part:2) : easy tips for css(part:2)
 
Css training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentialsCss training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentials
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
Basics about front-end
Basics about front-endBasics about front-end
Basics about front-end
 

Más de Philip Taylor (20)

Caleb Wojcik
Caleb WojcikCaleb Wojcik
Caleb Wojcik
 
Stacy johnson
Stacy johnsonStacy johnson
Stacy johnson
 
Panel panda penguin
Panel panda penguin Panel panda penguin
Panel panda penguin
 
David sitemangarland
David sitemangarlandDavid sitemangarland
David sitemangarland
 
Todd Tressider
Todd TressiderTodd Tressider
Todd Tressider
 
Thursday Bram
Thursday BramThursday Bram
Thursday Bram
 
Shannyn Allan
Shannyn AllanShannyn Allan
Shannyn Allan
 
Ted Jenkin
Ted JenkinTed Jenkin
Ted Jenkin
 
Paula Pant
Paula PantPaula Pant
Paula Pant
 
Sammons
SammonsSammons
Sammons
 
Steve Chou
Steve ChouSteve Chou
Steve Chou
 
Lisa Miller
Lisa MillerLisa Miller
Lisa Miller
 
Miss Thrifty
Miss ThriftyMiss Thrifty
Miss Thrifty
 
Jeff Rose
Jeff RoseJeff Rose
Jeff Rose
 
Laura Adams
Laura AdamsLaura Adams
Laura Adams
 
Emily Chase Smith
Emily Chase SmithEmily Chase Smith
Emily Chase Smith
 
Freedman
FreedmanFreedman
Freedman
 
Jason Hull
Jason HullJason Hull
Jason Hull
 
Casey Bond Beta_karimzadeh
Casey Bond Beta_karimzadehCasey Bond Beta_karimzadeh
Casey Bond Beta_karimzadeh
 
Geoff Whitmore
Geoff WhitmoreGeoff Whitmore
Geoff Whitmore
 

Último

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Último (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

David Weliver

  • 1. CSS for Bloggers How to Make Your Blog Look and Convert Better (Without a Designer) David Weliver, MoneyUnder30.com
  • 2. What is CSS? CSS – or cascading style sheets – is a coding language used to format HTML. It gives most of today’s Websites their unique look, feel and functionality.
  • 3. What You Can Do With CSS With basic CSS you can change link colors, fonts and sizes, background colors and more. As you learn more you can style tables and menus or style useful widgets that can increase conversion and make your blog look more professional. Another use for CSS is to make your blog display better on mobile devices.
  • 4. Why CSS Exists Without CSS With CSS You can use HTML tags like <strong> to make font bold or <bgcolor> to set a background color. CSS enables you to separate code from content. But you must insert this code on every page and every time you want to change the format. CSS saves work: You define a style once, then apply it anywhere its needed. This extends the amount of HTML necessary and adds a lot of code to your content.
  • 5. How CSS Works In a style sheet (.css file), you define the following: h1 {font-size: 12px; color: blue;} Wordpress makes your blog and the HTML looks like this: <h1>I Like Money, Don’t You?</h1> Your reader sees this:
  • 6. CSS Syntax For each selector (i.e., h1 for headers), you define the value for each property of the selector. Here, the h1 color is blue and the fontsize is 12 pixels. Now, any text on your blog between the <h1> and </h1> tags will be blue and 12 pixels in size. Image source: http://www.w3schools.com/css/css_syntax.asp
  • 7. Where to Edit CSS Code CSS lives in your theme’s style sheet (.css file). Edit this by going to Appearance  Editor in Wordpress. Make a backup first!!
  • 8. Where to Edit CSS Code Some Wordpress themes provide a custom.css file where you can put CSS that will override the default styles. This is easier for small changes.
  • 9. Where to Edit CSS Code Although not ideal, you can also define CSS inline. <p style=“font-size: 12px; color: blue;”>Debt is bad, mmmkay?</p> Or, in the <head> section of an HTML page. <html> <head> <style type="text/css"> h1 {font-size: 12px; color: blue;} </style> </head> </html>
  • 10. CSS Selectors Common global CSS selectors include body; p (paragraphs); h1, h2, h3, etc. (headers); and a (links). To further customize your site, you define IDs or classes for the elements on your website. Elements are defined in HTML by the <div> tag. <div class=“red”>Debt is bad, mmmkay?</div> <div id=“blue”>Debt is bad, mmmkay?</div>
  • 11. CSS ID and Class ID Class Used to define single, unique elements Used to define groups of elements Defined with a “#” Defined with a “.” #red {font-size: 12px; color: red;} .blue {font-size: 12px; color: red;} <div id=“red”>Roth IRA!</div> <div class=“blue”>Roth IRA!</div>
  • 12. CSS ID and Class IDs are more specific than classes If an element has both a class and an ID, the ID takes precedence .post {font-size: 12px; color: blue;} #red-post {font-size: 12px; color: red;} <div class=“post”>Roth IRAs are awesome! <div id=“red-post”>You should open one. </div> </div>
  • 13. CSS Properties Learning a few common CSS properties will give you lots of control over your site’s appearance.
  • 14. The CSS Font Property Font style and size may be defined in a few ways. The font property p {font: arial,sans-serif;} can define just the font: Or additional elements like size: p {font: 12px arial,sans-serif;} Or even more elements like style and line height: p {font: bold 12px/30px arial,sans-serif;}
  • 15. Colors in CSS The color property defines text color using color names or hex codes. p {color: #d10000;} The background-color property defines the background color of an element: p {background-color: #efefef;}
  • 16. Links Applying CSS to links can be useful to create compelling calls to action. An example of a global link format: a {color: red; text-decoration: none; border-bottom: 1px dotted #000;} To give a particular link special formatting, we create an ID: a#action {color: #fff; background-color: red; padding: 5px; border-radius: 5px;}
  • 17. Margins, Borders & Padding Margins Padding Control the outside spacing of an element Control the inside spacing of an element Margins are transparent Padding shows an element’s background color
  • 18. Margins, Borders & Padding The following adds a 10 pixel margin on all four sides: .box {margin: 10px;} This adds 10 pixel padding on the top and left only: .box {padding-top: 10px; padding-left: 10px;} This adds 10 pixel padding on the top, 5 pixel padding on the left and right, and 20 pixel padding on the bottom: .box {padding: 10px 5px 20px 5px;}
  • 19. Margins, Borders & Padding When adding a border, you must define the border size, color, and width. For example: .box {border: 5px solid #000;} Looks like this: .box {border: 1px dashed blue;} Looks like this:
  • 20. Margins, Borders & Padding When defining different margin/padding values for different sides of an element, list the values clockwise: .box {margin: TOP RIGHT BOTTOM LEFT;} The following element has a margin of 10px on top, 20px left and right, and 5px on bottom: .box {margin: 10px 20px 5px 20px;} The following element has a margin of 10px on top and 20px left and right: .box {margin: 10px 20px;}
  • 21. Floats • • • CSS enables elements to “float” to one side or the other. With floats, you can create columns without being confined to an HTML table or you can wrap text around an element such as an AdSense block. Floats are tricky! Image source: http://css-tricks.com/all-about-floats/
  • 22. Responsive Design With CSS, you can improve how your blog appears on mobile devices
  • 23. Responsive Design • • Certain elements (like floats) don’t display well on small screens. You can use CSS to change how certain elements display on mobile (or hide them altogether using display: none;).
  • 24. CSS Tools Programs and features that make working with CSS easier
  • 25. Inspect Element With Inspect Element you can click on an element to see its CSS. You can edit the CSS and immediately see how the browser will display the altered code.
  • 26. Inspect Element Chrome & Firefox: Right-click on target and click Inspect Element Internet Explorer: Access the Developer Toolbar (F12) then CTRL+B
  • 27. Advanced Text Editors For Mac: BBEdit (Free trial; $50) www.barebones.com/product s/bbedit For PC: Notepad ++ (Free) http://notepad-plus-plus.org More: http://sixrevisions.com/webdevelopment/the-15-mostpopular-text-editors-for-
  • 28. Experimentin g with CSS 1. 2. 3. Create an HTML file with CSS defined in the <head> section. Code your CSS. View the file in a browser and use Inspect Element to play around.
  • 29. Cool CSS Tricks A few examples of what CSS can do
  • 30. Rounded Corners Use border-radius: PIXELS; Element does not require a border; will also work with background color.
  • 31. Gradients Assigning the linergradient() value to the background-image property will display a gradient in newer browsers. Here’s a generator: www.colorzilla.com/gra dient-editor
  • 32. Inline Lists Styling unordered and ordered lists is tricky, but the effects can be powerful. A beginning trick is to learn to use display: inline to transform vertical lists into horizontal ones.
  • 33. Conditional Table Rows Like any programming language, you can create rules with CSS that apply styles conditionally.
  • 34. Where to learn more Resources for learning CSS
  • 35. CSS Resources Learning CSS W3 Schools www.w3schools.com/c ss Code Academy www.codecademy.com/ courses/css-codingwith-style HTML Dog www.htmldog.com/guid es/css/beginner Writing CSS CSS Validation Service http://jigsaw.w3.org/css -validator Clean CSS (Code Compression Tool) www.cleancss.com CSS Generator http://css3generator.co m