SlideShare a Scribd company logo
Welcome!
Learning CSS From Scratch




         @steffbold
Me = You
CSS Basics

Before CSS, if programmers wanted to change the logo or the
color of the footer for example, they had to change the code on
every single page of a website.


With CSS, you change one file, the .css file, and the changes
take place on all of the pages of your website that has the logo
or footer.
HTML

 HTML 1999
 XHTML 2002
 HTML 5
 For every new standard you get more features and you lose some



 <!DOCTYPE HTML>
 <html>
                  Indent with 2 spaces (not tab)
  <head>
   <title>Here’s a title<//title>
  </head>
 <body>
 </body>
 </html>
HTML family tree (DOM)
CSS
 body {
     background-image: url(images/background.jpg);
     background-repeat: no-repeat;
                                          watch for semi-colon
     background-position: center top;
     margin: 0 auto;
     padding: 30px;
 }

 h1 {
        color: gray;
        font-size: 25px;
        font-family: "century gothic";
        border-bottom: 2px white solid;
 }

 p { color: gray; font-size: 13px; font-family: "century gothic"; }
                           watch for uppercase
 #home #homeLink {
      color: black;
You can either drag and drop that file to your browser or
R click on it / Open With / Firefox (or fav browser) or
On Aptana, click on:
                       to view there   to view in your browser




As you change your project and want to see the changes on the
Browser, just refresh the browser (after saving it, of course) or click
Shift + Command + R

To validate that your page doesn’t have any bugs always go to:
http://validator.w3.org/ (demo)
You can validate a link, or upload a file
Create new folder
New index.html doc
New style.css doc

To point HTML to CSS:
<link href="style.css" rel="stylesheet" type="text/css" />

Add images you’ll want to use in a folder called images inside that folder
Internal vs External Style Sheet
Internal
<style type="text/css">
h1 {
    color: #FF7643;
    font-family: Arial;
}
When you insert the internal style sheet, make sure to place it in the
page’s head section, between the link tag and the closing </head> tag

External
HTML:
<link rel="stylesheet" type="text/css" href="css/global.css”>

XHTML:
<link rel="stylesheet" type="text/css" href="css/global.css" />

External helps page load faster
Order matters

 This link example must be in this order:
 a:link { color: #F60; }
 a:visited { color: #900; }
 a:hover { color: #F33; }
 a:active { color: #B2F511; }


 ps- a:active covers the brief nanosecond
 when someone’s pressing the mouse
 button, before releasing it.
Tutorial Ch 2

Page 39 (or page 11 if you downloaded the book)


Download tutorials here: www.sawmac.com/css2e/
<div> and <span>
The <div> tag and the <span> tag are like empty vessels that you fill with
content. A div is a block/box meaning it has a line break before it and after
it, while a span appears inline, as part of a paragraph

<div> = division (box where you can put stuff)
<div id=“page wrap”>
Tag with # on CSS
#page wrap {
}

<span> lets you apply a class or ID style to just part of a tag. You can place
<span> tags around individual words and phrases within paragraphs to
format them independently. Here, a class called .companyName styles the
inline elements “CosmoFarmer.com,” “Disney,” and “ESPN”:

<p>Welcome to <span class="companyName">
CosmoFarmer.com</span>, the parent
company of such well-known corporations
as <span class="companyName">Disney
</span> and <span class="companyName">
ESPN</span>...well, not really.</p>
Class and ID
for any tags you can make a class
class can be repeated
<p class=“copyright”>
the most specific rule overules
css should be
.copyright

id is for one specific element, it is unique and cannot be repeated
<div id=“banner”>
css should be
#banner
                                 what would CSS look like for this class?
<div class="photo">
<img src="holidays.jpg"
alt="Penguins getting frisky"/>
<p>Mom, dad and me on our yearly trip to Antarctica.</p>
</div>



   Demo with validator.w3.org the difference between id and class
Tutorial Ch 3

Page 70 (or page 24 if you downloaded the book)
Cool stuff

1.   Open up Chrome
2.   Go to ecobold.com
3.   Right click and select “Inspect Element”
4.   Right click “Sell” on the top of the page select “Inspect Element”
5.   On the bottom R side, double click on the color green #87B503
6.   Type “pink”


If you want to copy the site for testing: copy the HTML, CSS and Images
Cool stuff

http://csszengarden.com

Samples of only using CSS to change the look and feel of
a page

Download the sample html file and css file to try yourself!
Create a servlet
•   Go to aws.amazon.com
•   Login/Sign up
•   Insert credit card info (or insert credit under payments)
•   Click EC2 at the top of the page
•   Click Launch Instance / Continue /
•   Select Amazon Linux AMI 2012.03 it should look like this:
1. Select Availability Zone: us-east-1a (or whatever you prefer)




1. Click Continue / Continue / Continue
•   Under Create new key pair enter a name for your key pair
•   Click Create and download your key pair (remember name)
•   As it downloads go back to AWS click Choose one or more of
    your existing security group
•   Select Default
•   Click Launch / Close
•   You should be taken to the Amazon EC2 Console Dashboard
    On the R side click Running Instance
1. When it launches the State should turn green
2. Select the one that’s launched
1.   Copy the public DNS number at the bottom of the page




18. Open your terminal on your desktop, type: cd Desktop (enter)
• Type ssh –i RockNRoll.pem ec22-user@(paste) (enter)



                         RockNRoll.pem should be substituted by the
                         file name you created
Type sudo yum install tomcat7*
Type Y (enter)
Type sudo /etc/rc.d/init.d/tomcat7 start (enter)
Go back to AWS, click Security Groups under NETWORK & SECURITY on the L si
Select “default” click inbound
Under “Port Range” type 8080
Click Add Rule
Click Apply Rule Changes
Go back to AWS and copy the Public DNS Number again
Paste into a browser and add :8080 to the end of the link (enter)

Go back to your terminal type cd /var/lib/tomcat7/webapps/ROOT (enter)
Type sudo nano index.html (enter)
Create an html document
Click “control x” on your keyboard
Type Y (enter) (enter)
Go back to your browser that you typed :8080 and type /index.xtml at the
end of the link
It’s live!




Ps- it’s likely that you missed a step, now is the time to buy a friend
drinks and ask where you messed up.
What’s next?

- Finish book
- Wordpress
- http://twitter.github.com/bootstrap/examples/fluid.html
- Javascript
-?
Thank you!!!
Questions? Suggestions?




        @steffbold
Misc
<ol> ordered list
<ul> unordered list (bulleted, non-numbered)
list-style: none (removes bullets on any list)

<blockquote> for quotes
If you want to include a quotation like a snippet of text from another website, a movie review, or just some wise saying,
try:
<q> for one-liners
<cite> for referencing a book title, newspaper article, or website
<address> identify and supply contact information for the author of a page (great for a copyright notice)

for IE 8 to behave properly: <meta http-equiv="X-UA-Compatible" content="IE=edge" /> (put in ,head> below <title>
(must put on every page)

a:hover to change color when hovering over a link
a:visited
a:link

must be in this order:
a:link { color: #F60; }
a:visited { color: #900; }
a:hover { color: #F33; }
a:active {color: #B2F511; }

a:active covers the brief nanosecond when someone’s pressing the mouse button, before releasing it.
Misc
border: 1px solid
z-index: for images to overlap
padding: starts on top, then right

for email to popup (as contact form)
<a href="mailto:s@eadfilms.com" title="contact us”

text-decoration: none; for underline to disappear on a text

Including !important after a property value means that specific property always wins
.
Make sure you attach the external style sheet before the internal style sheet in the <head> section of the HTML.
This ensures that the styles from the internal style sheet win.

fonts easy on the eye (easy to read): Times, Times New Roman, Georgia
if you buy a font type, the person who opens your browser must have also installed that font, otherwise a standard
font will show

The normal line-height setting for a browser is 120 percent
The last two properties must be font-size followed by font-family
content -> padding -> border -> margin

for image to stay on the page as they scroll down (like Pinterest’s ”Request an invite” button), use this:
body {
background-image: url(images/logo.gif);
background-repeat: no-repeat;
background-attachment: fixed;
Misc
css intro: http://www.w3schools.com/css/css_intro.asp


free photos:
http://www.morguefile.com/
http://www.sxc.hu/
http://openphoto.net/gallery/browse.html
http://search.creativecommons.org/
http://www.somerandomdude.com/work/sanscons/


drop shadow:
www.alistapart.com/articles/cssdrop2
www.ploughdeep.com/onionskin

More Related Content

What's hot

Week 2 HTML lists, hyperlinks, tables, and images
Week 2 HTML lists, hyperlinks, tables, and imagesWeek 2 HTML lists, hyperlinks, tables, and images
Week 2 HTML lists, hyperlinks, tables, and imagesRowena LI
 
Chapter8
Chapter8Chapter8
Chapter8
DeAnna Gossett
 
Simple Markdown with Ecto and Protocols
Simple Markdown with Ecto and ProtocolsSimple Markdown with Ecto and Protocols
Simple Markdown with Ecto and Protocols
David Lucia
 
Css, xhtml, javascript
Css, xhtml, javascriptCss, xhtml, javascript
Css, xhtml, javascript
Trần Khải Hoàng
 
HTML 5 Step By Step - Ebook
HTML 5 Step By Step - EbookHTML 5 Step By Step - Ebook
HTML 5 Step By Step - Ebook
Scottperrone
 
Chapter9
Chapter9Chapter9
Chapter9
DeAnna Gossett
 
Chapter6
Chapter6Chapter6
Chapter6
DeAnna Gossett
 
Web I - 02 - XHTML Introduction
Web I - 02 - XHTML IntroductionWeb I - 02 - XHTML Introduction
Web I - 02 - XHTML Introduction
Randy Connolly
 
An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5
Steven Chipman
 
HTML presentation for beginners
HTML presentation for beginnersHTML presentation for beginners
HTML presentation for beginners
jeroenvdmeer
 
HTML 4.0
HTML 4.0HTML 4.0
1.1 html lec 1
1.1 html lec 11.1 html lec 1
1.1 html lec 1
IoT Code Lab
 
3. tutorial html web desain
3. tutorial html web desain3. tutorial html web desain
3. tutorial html web desainfaizibra
 
Demo lecture ppt
Demo lecture pptDemo lecture ppt
Demo lecture ppt
VidyaGholap2
 
Chapter7
Chapter7Chapter7
Chapter7
DeAnna Gossett
 

What's hot (19)

Week 2 HTML lists, hyperlinks, tables, and images
Week 2 HTML lists, hyperlinks, tables, and imagesWeek 2 HTML lists, hyperlinks, tables, and images
Week 2 HTML lists, hyperlinks, tables, and images
 
Chapter8
Chapter8Chapter8
Chapter8
 
Firefox addons
Firefox addonsFirefox addons
Firefox addons
 
Simple Markdown with Ecto and Protocols
Simple Markdown with Ecto and ProtocolsSimple Markdown with Ecto and Protocols
Simple Markdown with Ecto and Protocols
 
Css, xhtml, javascript
Css, xhtml, javascriptCss, xhtml, javascript
Css, xhtml, javascript
 
HTML 5 Step By Step - Ebook
HTML 5 Step By Step - EbookHTML 5 Step By Step - Ebook
HTML 5 Step By Step - Ebook
 
Chapter9
Chapter9Chapter9
Chapter9
 
Chapter6
Chapter6Chapter6
Chapter6
 
Html tags describe in bangla
Html tags describe in banglaHtml tags describe in bangla
Html tags describe in bangla
 
Web I - 02 - XHTML Introduction
Web I - 02 - XHTML IntroductionWeb I - 02 - XHTML Introduction
Web I - 02 - XHTML Introduction
 
An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5
 
HTML presentation for beginners
HTML presentation for beginnersHTML presentation for beginners
HTML presentation for beginners
 
HTML 4.0
HTML 4.0HTML 4.0
HTML 4.0
 
1.1 html lec 1
1.1 html lec 11.1 html lec 1
1.1 html lec 1
 
Html bangla
Html banglaHtml bangla
Html bangla
 
3. tutorial html web desain
3. tutorial html web desain3. tutorial html web desain
3. tutorial html web desain
 
Bangla html
Bangla htmlBangla html
Bangla html
 
Demo lecture ppt
Demo lecture pptDemo lecture ppt
Demo lecture ppt
 
Chapter7
Chapter7Chapter7
Chapter7
 

Similar to Learn CSS From Scratch

World wide web with multimedia
World wide web with multimediaWorld wide web with multimedia
World wide web with multimediaAfaq Siddiqui
 
Dreamweaver CS3
Dreamweaver CS3Dreamweaver CS3
Pfnp slides
Pfnp slidesPfnp slides
Pfnp slides
William Myers
 
Introduction to Dreamweaver
Introduction to DreamweaverIntroduction to Dreamweaver
Introduction to Dreamweaver
Sarah Bombich
 
HTML Lab ProjectTo create a simple web page you will need .docx
HTML Lab ProjectTo create a simple web page you will need .docxHTML Lab ProjectTo create a simple web page you will need .docx
HTML Lab ProjectTo create a simple web page you will need .docx
adampcarr67227
 
html for beginners
html for beginnershtml for beginners
html for beginners
KIIZAPHILIP
 
How to create a basic template
How to create a basic templateHow to create a basic template
How to create a basic templatevathur
 
The complete-html-cheat-sheet
The complete-html-cheat-sheetThe complete-html-cheat-sheet
The complete-html-cheat-sheet
HARUN PEHLIVAN
 
The complete-html-cheat-sheet
The complete-html-cheat-sheetThe complete-html-cheat-sheet
The complete-html-cheat-sheet
Zafer Galip Ozberk
 
Class 2 handout css exercises (2)
Class 2 handout css exercises (2)Class 2 handout css exercises (2)
Class 2 handout css exercises (2)Erin M. Kidwell
 
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
 
Macromedia Dreamweaver 8
Macromedia Dreamweaver 8Macromedia Dreamweaver 8
Macromedia Dreamweaver 8
Jeff Wood
 
Macromedia Dreamweaver 8 2
Macromedia Dreamweaver 8 2Macromedia Dreamweaver 8 2
Macromedia Dreamweaver 8 2Jeff Wood
 
Web technologies part-2
Web technologies part-2Web technologies part-2
Web technologies part-2
Michael Anthony
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
WordPress Memphis
 
Front-End Methodologies
Front-End MethodologiesFront-End Methodologies
Front-End Methodologies
Arash Manteghi
 

Similar to Learn CSS From Scratch (20)

World wide web with multimedia
World wide web with multimediaWorld wide web with multimedia
World wide web with multimedia
 
Dreamweaver CS3
Dreamweaver CS3Dreamweaver CS3
Dreamweaver CS3
 
Pfnp slides
Pfnp slidesPfnp slides
Pfnp slides
 
Introduction to Dreamweaver
Introduction to DreamweaverIntroduction to Dreamweaver
Introduction to Dreamweaver
 
HTML Lab ProjectTo create a simple web page you will need .docx
HTML Lab ProjectTo create a simple web page you will need .docxHTML Lab ProjectTo create a simple web page you will need .docx
HTML Lab ProjectTo create a simple web page you will need .docx
 
html for beginners
html for beginnershtml for beginners
html for beginners
 
How to create a basic template
How to create a basic templateHow to create a basic template
How to create a basic template
 
The complete-html-cheat-sheet
The complete-html-cheat-sheetThe complete-html-cheat-sheet
The complete-html-cheat-sheet
 
The complete-html-cheat-sheet
The complete-html-cheat-sheetThe complete-html-cheat-sheet
The complete-html-cheat-sheet
 
Class 2 handout css exercises (2)
Class 2 handout css exercises (2)Class 2 handout css exercises (2)
Class 2 handout css exercises (2)
 
CSS_tutorial_1
CSS_tutorial_1CSS_tutorial_1
CSS_tutorial_1
 
CSS_tutorial_1
CSS_tutorial_1CSS_tutorial_1
CSS_tutorial_1
 
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
 
Macromedia Dreamweaver 8
Macromedia Dreamweaver 8Macromedia Dreamweaver 8
Macromedia Dreamweaver 8
 
Macromedia Dreamweaver 8 2
Macromedia Dreamweaver 8 2Macromedia Dreamweaver 8 2
Macromedia Dreamweaver 8 2
 
David Weliver
David WeliverDavid Weliver
David Weliver
 
Web technologies part-2
Web technologies part-2Web technologies part-2
Web technologies part-2
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Front-End Methodologies
Front-End MethodologiesFront-End Methodologies
Front-End Methodologies
 

More from ecobold

Partnerships & Is Now a Great Time to Buy Real Estate?
Partnerships & Is Now a Great Time to Buy Real Estate?Partnerships & Is Now a Great Time to Buy Real Estate?
Partnerships & Is Now a Great Time to Buy Real Estate?
ecobold
 
How to Run the Perfect Demo for Founders
How to Run the Perfect Demo for FoundersHow to Run the Perfect Demo for Founders
How to Run the Perfect Demo for Founders
ecobold
 
How to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless EditionHow to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless Edition
ecobold
 
Is Open Source a Good Strategy for your Startup?
Is Open Source a Good Strategy for your Startup?Is Open Source a Good Strategy for your Startup?
Is Open Source a Good Strategy for your Startup?
ecobold
 
SaaS Metrics for Startups
SaaS Metrics for StartupsSaaS Metrics for Startups
SaaS Metrics for Startups
ecobold
 
How to Build a Real Time Analytics Enterprise with Open Source
How to Build a Real Time Analytics Enterprise with Open Source How to Build a Real Time Analytics Enterprise with Open Source
How to Build a Real Time Analytics Enterprise with Open Source
ecobold
 
Startup 102
Startup 102Startup 102
Startup 102ecobold
 
Ecobold entrepreneurs roundtable ert
Ecobold entrepreneurs roundtable ertEcobold entrepreneurs roundtable ert
Ecobold entrepreneurs roundtable ert
ecobold
 
Startup 101
Startup 101Startup 101
Startup 101
ecobold
 

More from ecobold (9)

Partnerships & Is Now a Great Time to Buy Real Estate?
Partnerships & Is Now a Great Time to Buy Real Estate?Partnerships & Is Now a Great Time to Buy Real Estate?
Partnerships & Is Now a Great Time to Buy Real Estate?
 
How to Run the Perfect Demo for Founders
How to Run the Perfect Demo for FoundersHow to Run the Perfect Demo for Founders
How to Run the Perfect Demo for Founders
 
How to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless EditionHow to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless Edition
 
Is Open Source a Good Strategy for your Startup?
Is Open Source a Good Strategy for your Startup?Is Open Source a Good Strategy for your Startup?
Is Open Source a Good Strategy for your Startup?
 
SaaS Metrics for Startups
SaaS Metrics for StartupsSaaS Metrics for Startups
SaaS Metrics for Startups
 
How to Build a Real Time Analytics Enterprise with Open Source
How to Build a Real Time Analytics Enterprise with Open Source How to Build a Real Time Analytics Enterprise with Open Source
How to Build a Real Time Analytics Enterprise with Open Source
 
Startup 102
Startup 102Startup 102
Startup 102
 
Ecobold entrepreneurs roundtable ert
Ecobold entrepreneurs roundtable ertEcobold entrepreneurs roundtable ert
Ecobold entrepreneurs roundtable ert
 
Startup 101
Startup 101Startup 101
Startup 101
 

Recently uploaded

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 

Recently uploaded (20)

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 

Learn CSS From Scratch

  • 1. Welcome! Learning CSS From Scratch @steffbold
  • 3. CSS Basics Before CSS, if programmers wanted to change the logo or the color of the footer for example, they had to change the code on every single page of a website. With CSS, you change one file, the .css file, and the changes take place on all of the pages of your website that has the logo or footer.
  • 4. HTML HTML 1999 XHTML 2002 HTML 5 For every new standard you get more features and you lose some <!DOCTYPE HTML> <html> Indent with 2 spaces (not tab) <head> <title>Here’s a title<//title> </head> <body> </body> </html>
  • 6. CSS body { background-image: url(images/background.jpg); background-repeat: no-repeat; watch for semi-colon background-position: center top; margin: 0 auto; padding: 30px; } h1 { color: gray; font-size: 25px; font-family: "century gothic"; border-bottom: 2px white solid; } p { color: gray; font-size: 13px; font-family: "century gothic"; } watch for uppercase #home #homeLink { color: black;
  • 7. You can either drag and drop that file to your browser or R click on it / Open With / Firefox (or fav browser) or On Aptana, click on: to view there to view in your browser As you change your project and want to see the changes on the Browser, just refresh the browser (after saving it, of course) or click Shift + Command + R To validate that your page doesn’t have any bugs always go to: http://validator.w3.org/ (demo) You can validate a link, or upload a file
  • 8. Create new folder New index.html doc New style.css doc To point HTML to CSS: <link href="style.css" rel="stylesheet" type="text/css" /> Add images you’ll want to use in a folder called images inside that folder
  • 9.
  • 10. Internal vs External Style Sheet Internal <style type="text/css"> h1 { color: #FF7643; font-family: Arial; } When you insert the internal style sheet, make sure to place it in the page’s head section, between the link tag and the closing </head> tag External HTML: <link rel="stylesheet" type="text/css" href="css/global.css”> XHTML: <link rel="stylesheet" type="text/css" href="css/global.css" /> External helps page load faster
  • 11. Order matters This link example must be in this order: a:link { color: #F60; } a:visited { color: #900; } a:hover { color: #F33; } a:active { color: #B2F511; } ps- a:active covers the brief nanosecond when someone’s pressing the mouse button, before releasing it.
  • 12. Tutorial Ch 2 Page 39 (or page 11 if you downloaded the book) Download tutorials here: www.sawmac.com/css2e/
  • 13. <div> and <span> The <div> tag and the <span> tag are like empty vessels that you fill with content. A div is a block/box meaning it has a line break before it and after it, while a span appears inline, as part of a paragraph <div> = division (box where you can put stuff) <div id=“page wrap”> Tag with # on CSS #page wrap { } <span> lets you apply a class or ID style to just part of a tag. You can place <span> tags around individual words and phrases within paragraphs to format them independently. Here, a class called .companyName styles the inline elements “CosmoFarmer.com,” “Disney,” and “ESPN”: <p>Welcome to <span class="companyName"> CosmoFarmer.com</span>, the parent company of such well-known corporations as <span class="companyName">Disney </span> and <span class="companyName"> ESPN</span>...well, not really.</p>
  • 14. Class and ID for any tags you can make a class class can be repeated <p class=“copyright”> the most specific rule overules css should be .copyright id is for one specific element, it is unique and cannot be repeated <div id=“banner”> css should be #banner what would CSS look like for this class? <div class="photo"> <img src="holidays.jpg" alt="Penguins getting frisky"/> <p>Mom, dad and me on our yearly trip to Antarctica.</p> </div> Demo with validator.w3.org the difference between id and class
  • 15.
  • 16. Tutorial Ch 3 Page 70 (or page 24 if you downloaded the book)
  • 17. Cool stuff 1. Open up Chrome 2. Go to ecobold.com 3. Right click and select “Inspect Element” 4. Right click “Sell” on the top of the page select “Inspect Element” 5. On the bottom R side, double click on the color green #87B503 6. Type “pink” If you want to copy the site for testing: copy the HTML, CSS and Images
  • 18. Cool stuff http://csszengarden.com Samples of only using CSS to change the look and feel of a page Download the sample html file and css file to try yourself!
  • 19.
  • 21. Go to aws.amazon.com • Login/Sign up • Insert credit card info (or insert credit under payments) • Click EC2 at the top of the page • Click Launch Instance / Continue / • Select Amazon Linux AMI 2012.03 it should look like this:
  • 22. 1. Select Availability Zone: us-east-1a (or whatever you prefer) 1. Click Continue / Continue / Continue
  • 23. Under Create new key pair enter a name for your key pair • Click Create and download your key pair (remember name) • As it downloads go back to AWS click Choose one or more of your existing security group • Select Default • Click Launch / Close • You should be taken to the Amazon EC2 Console Dashboard On the R side click Running Instance
  • 24. 1. When it launches the State should turn green 2. Select the one that’s launched
  • 25. 1. Copy the public DNS number at the bottom of the page 18. Open your terminal on your desktop, type: cd Desktop (enter) • Type ssh –i RockNRoll.pem ec22-user@(paste) (enter) RockNRoll.pem should be substituted by the file name you created
  • 26. Type sudo yum install tomcat7* Type Y (enter) Type sudo /etc/rc.d/init.d/tomcat7 start (enter) Go back to AWS, click Security Groups under NETWORK & SECURITY on the L si Select “default” click inbound Under “Port Range” type 8080 Click Add Rule Click Apply Rule Changes Go back to AWS and copy the Public DNS Number again Paste into a browser and add :8080 to the end of the link (enter) Go back to your terminal type cd /var/lib/tomcat7/webapps/ROOT (enter) Type sudo nano index.html (enter) Create an html document Click “control x” on your keyboard Type Y (enter) (enter) Go back to your browser that you typed :8080 and type /index.xtml at the end of the link
  • 27. It’s live! Ps- it’s likely that you missed a step, now is the time to buy a friend drinks and ask where you messed up.
  • 28. What’s next? - Finish book - Wordpress - http://twitter.github.com/bootstrap/examples/fluid.html - Javascript -?
  • 30. Misc <ol> ordered list <ul> unordered list (bulleted, non-numbered) list-style: none (removes bullets on any list) <blockquote> for quotes If you want to include a quotation like a snippet of text from another website, a movie review, or just some wise saying, try: <q> for one-liners <cite> for referencing a book title, newspaper article, or website <address> identify and supply contact information for the author of a page (great for a copyright notice) for IE 8 to behave properly: <meta http-equiv="X-UA-Compatible" content="IE=edge" /> (put in ,head> below <title> (must put on every page) a:hover to change color when hovering over a link a:visited a:link must be in this order: a:link { color: #F60; } a:visited { color: #900; } a:hover { color: #F33; } a:active {color: #B2F511; } a:active covers the brief nanosecond when someone’s pressing the mouse button, before releasing it.
  • 31. Misc border: 1px solid z-index: for images to overlap padding: starts on top, then right for email to popup (as contact form) <a href="mailto:s@eadfilms.com" title="contact us” text-decoration: none; for underline to disappear on a text Including !important after a property value means that specific property always wins . Make sure you attach the external style sheet before the internal style sheet in the <head> section of the HTML. This ensures that the styles from the internal style sheet win. fonts easy on the eye (easy to read): Times, Times New Roman, Georgia if you buy a font type, the person who opens your browser must have also installed that font, otherwise a standard font will show The normal line-height setting for a browser is 120 percent The last two properties must be font-size followed by font-family content -> padding -> border -> margin for image to stay on the page as they scroll down (like Pinterest’s ”Request an invite” button), use this: body { background-image: url(images/logo.gif); background-repeat: no-repeat; background-attachment: fixed;
  • 32. Misc css intro: http://www.w3schools.com/css/css_intro.asp free photos: http://www.morguefile.com/ http://www.sxc.hu/ http://openphoto.net/gallery/browse.html http://search.creativecommons.org/ http://www.somerandomdude.com/work/sanscons/ drop shadow: www.alistapart.com/articles/cssdrop2 www.ploughdeep.com/onionskin

Editor's Notes

  1. We are following the book “CSS: The Missing Manual” by David Sawyer McFarland Buy the print version here: http://www.amazon.com/CSS-Missing-David-Sawyer-McFarland/dp/0596802447 Buy and download the ebook version here: http://www.ebooks.com/536649/css-the-missing-manual/mcfarland-david/ Before starting, watch this great CSS Beginners tutorial: http://css-tricks.com/video-screencasts/58-html-css-the-very-basics/ This presentation is targeted towards chapter 1-3 which you should’ve read and done the tutorial by now You should also download http://aptana.com/ to work on your files and the tutorials
  2. Hang in there!
  3. Why indent with 2 spaces instead of 1 tab? So that your HTML document isn’t that long horizontally and you don’t have to scroll too much to the R to read your code
  4. To open your html page on your browser, follow any of these instructions
  5. To create a new html page, save the main page as index.html To create a new css page, save it as style.css
  6. Work on the tutorial for chapter 2
  7. GIVE EXAMPLE Watch this: http://www.youtube.com/watch?v=kb4n5xOpVck&amp;list=PL7761FCF889E7D36D&amp;index=26&amp;feature=plpp_video The full class is here: http://www.youtube.com/playlist?list=PL7761FCF889E7D36D&amp;feature=plcp
  8. For more read: http://www.impressivewebs.com/difference-class-id-css/
  9. Work on the tutorial for chapter 3