SlideShare una empresa de Scribd logo
1 de 86
Embrace the MulletCSS is the Party in the Back (a CSS ‘how-to’) TOM HAPGOOD WordCamp Fayetteville #wcfay / 2011
To those of you in the room still rocking the mullet, I salute your bravery and dedication to the glory years.
University of Arkansas Art Department, Design Area ,[object Object]
Art of Interactive Journalism		// WP, FCP, PS, DW
Motion Design					// C4D, AE, AI, PS, FCP
Typography						// ID, PS, HTML5, CSS3http://www.hapgooddesign.com @thapgood
Structure + Presentation A key concept is to keep the structure and presentation separate (in separate files). structure:									presentation: HTML									CSS index.htmlstyle.css
Often-Used CSS Properties { font-family { font-size { font-weight { font-style { text-align { color { background-image { background-color { background-repeat { padding { margin { float { line-height { letter-spacing { border { border-radius { box-shadow { text-transform { text-shadow { display { position { width { height
margin padding border Content padding padding margin margin padding The Box Model margin
margin padding border padding padding margin margin padding The Box Model margin
margin padding border padding padding margin margin padding The Box Model margin
margin padding border padding padding margin margin padding The Box Model margin
Padding Nicki-G/Flickr The content The padding
The padding The margin The border
Linking the HTML and CSS Between the <head> tags in the HTML document, the following line is inserted: <head> 	<link rel=“stylesheet” href=“style.css”> </head> (making sure that the path to the style.css file is correct.)
Syntax HTML                      							CSS <body> 	<h1>Hello, world.</h1> </body> h1 { 	font-size: large; 	color: #003366; 	padding: 20px; 	}
CSS Syntax A CSS rule consists of two main parts: selector { declaration;}
CSS Syntax A CSS rule consists of two main parts: 	selector { declaration;} 				The declaration has two parts: selector { property: value; }
CSS Syntax A CSS rule consists of two main parts: 	selector { declaration;} 				The declaration has two parts: selector { property: value; } selector { color: #000000; }
CSS Syntax / element type selector Styling an existing HTML tag: To make all p (paragraph) tags on your page black: 	p { color: #000000; }
HTML                      		 index.html <html> <body> <link rel=“stylesheet” … > <h1>Headline</h1> </body> </html>
HTML                      		CSS style.css index.html <html> <body> <link rel=“stylesheet” … > <h1>Headline</h1> </body> </html> h1 { color:#003366; font-family:Georgia, serif; text-transform:uppercase; font-size:large; }
HTML                      		CSS style.css index.html <html> <body> <link rel=“stylesheet” … > <h1>Headline</h1> </body> </html> h1 { color:#003366; font-family:Georgia, serif; text-transform:uppercase; font-size:large; } HEADLINE
CSS Syntax / class selectors What if you wanted some h1 tags to be blue and some red? Expand the existing tag set with the use of classes:  Classes use the dot notation as below: 	h1.breakingnews { color: #ff0000; } So, used whenever there is an h1 tag with a class of “breakingnews”.
HTML                      		 index.html <html> <body> <link rel=“stylesheet” … >  <h1>Headline</h1>  <h1 class=“breakingnews”> This Just In!</h1> </body> </html>
HTML                      		CSS style.css index.html <html> <body> <link rel=“stylesheet” … >  <h1>Headline</h1>  <h1 class=“breakingnews”> This Just In!</h1> </body> </html> h1 { color:#003366; font-family:Georgia, serif; text-transform:uppercase; font-size:large; 	} h1.breakingnews { color:#ff0000; font-family:Georgia, serif; text-transform:none; font-size:medium; 	}
HTML                      		CSS style.css index.html <html> <body> <link rel=“stylesheet” … >  <h1>Headline</h1>  <h1 class=“breakingnews”> This Just In!</h1> </body> </html> h1 { color:#003366; font-family:Georgia, serif; text-transform:uppercase; font-size:large; } h1.breakingnews { color:#ff0000; font-family:Georgia, serif; text-transform:none; font-size:medium; 	} HEADLINE This Just In!
CSS Syntax / descendant selectors What if you wanted some h1 tags to be blue, but only when they are inside of the <header> tag?:  Descendant selectors look like this: 	header  h1 { color: #003366; } or header  .breakingnews{ color: #ff0000;} The h1 will only style blue when it’s nested inside the header tag: <header><h1>WordCamp</h1></header>
CSS Syntax / adjacent sibling selectors What if you wanted some p tags to be bold, but only when they directly follow an h2? Use the + symbol: 	h2+p { font-weight:bold; }  The p will only style bold when directly follows the h2: <h2>Welcome to WordCamp!</h2> <p>WordCamp (This will be bold)</p> <p>OtherCamp (This will not be bold)</p>
Lots more General sibling selectors E~F	{ declarations; } Child selectors E>F {declarations; } Pseudo-classes li:hover, li:first-child, :nth-of-type Pseudo-elements p:first-line, ::selection
Shorthand header { border-width:1px; border-style: dashed; border-color: #ff0000; }
Shorthand header { border:1px dashed #ff0000; }
Shorthand header { border-right:1px dashed #ff0000; }
Shorthand header { border-bottom:1px dashed #ff0000; }
Hexadecimal colors In mathematics and computer science, hexadecimal (also base 16, or hex) is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F (or alternatively a–f) to represent values ten to fifteen. For example, the hexadecimal number 2AF3 is equal, in decimal, to (2 × 163) + (10 × 162) + (15 × 161) + (3 × 160) , or 10,995.
Hexadecimal colors A few to remember (the grayscales): #000000; /* black */ #333333; #666666; #999999; #cccccc; #ffffff; /* white */ (When each pairing is identical, it’s a gray).
When the HEX RGB pairings are identical, it’s a gray.
147 color names are defined in the HTML and CSS color specification (17 standard colors plus 130 more).
Layout with CSS
Layout with CSS
<header> Layout with CSS <div> <div> <footer>
<header> Layout with CSS What’s a div tag? It’s short for “division” and it’s a way to think about creating “areas” or “segments” or “portions” of the page. Visually, these end up looking like columns or any other boxes on the page. <div> <div> <footer>
<header> Layout with CSS What’s a div tag? It’s short for “division” and it’s a way to think about creating “areas” or “segments” or “portions” of the page. Visually, these end up looking like columns or any other boxes on the page. You may have many divs on a page, so you’ll need to give them a name, like this: 					<div class=“promobox”> <div> <div> <footer>
<header> Layout with CSS What’s a div tag? It’s short for “division” and it’s a way to think about creating “areas” or “segments” or “portions” of the page. Visually, these end up looking like columns or any other boxes on the page. You may have many divs on a page, so you’ll need to give them a name, like this: 					<div class=“promobox”> Then, the CSS can talk directly to that div(s) for styling. <div> <div> <footer>
<header> Layout with CSS What’s a div tag? It’s short for “division” and it’s a way to think about creating “areas” or “segments” or “portions” of the page. Visually, these end up looking like columns or any other boxes on the page. You may have many divs on a page, so you’ll need to give them a name, like this: 					<div class=“promobox”> Then, the CSS can talk directly to that div(s) for styling. 				.promobox { 							width:200px; 							} <div> <div> <footer>
<header> Layout with CSS <div id=“main_nav”> <div> <footer>
<header> Layout with CSS Wait, what’s an ID? Instead of giving an element, such as a div, a class name, you can give it an ID. An ID is used once per page. A class can be used many times on a page. Assigning an ID is very similar: 					<div id=“main_nav”> Then, you can have the CSS talk directly to that div for styling. 				#main_nav { 							width:200px; 							/* notice the # notation */ 							} <div id=“main_nav”> <div> <footer>
<header> Layout with CSS Wait, what’s an ID? In other words, an ID is a unique identifier. I use an ID on a div when I’m certain that div is going to have a unique presence on the page, such as the main navigation or the page header. <div id=“main_nav”> <div> <footer>
<header> Layout with CSS Wait, what’s an ID? In other words, an ID is a unique identifier. I use an ID on a div when I’m certain that div is going to have a unique presence on the page, such as the main navigation or the page header. Use a class designation on a div (or other element) that may be re-used on the page, such as a typographic treatment or multiple promotional boxes that sit in the sidebar. <div id=“main_nav”> <div> <footer>
<header> Layout with CSS <div id=“main_nav”> 	<nav> 		<ul> 			<li>Link</li> 	</ul> </nav> </div> <div> <footer>
<header> Layout with CSS <div id=“main_nav”> 	<nav> 		<ul> 			<li>Link</li> 	</ul> </nav> </div> <div id=“content”> <footer>
<header> Layout with CSS <div id=“main_nav”> 	<nav> 		<ul> 			<li>Link</li> 	</ul> </nav> </div> <div id=“content”> <section> 	<h1>About Us</h1> 	<p>We are a full-service blah blah blah.</p> </section> </div> <footer>
<header id=“pageheader”> Layout with CSS <div id=“main_nav”> 	<nav> 		<ul> 			<li>Link</li> 	</ul> </nav> </div> <div id=“content”> <section> 	<h1>About Us</h1> 	<p>We are a full-service blah blah blah.</p> </section> </div> <footer>
<header id=“pageheader”> Layout with CSS <div id=“main_nav”> 	<nav> 		<ul> 			<li>Link</li> 	</ul> </nav> </div> <div id=“content”> <section> 	<h1>About Us</h1> 	<p>We are a full-service blah blah blah.</p> </section> </div> <footer id=“pagefooter”>
<header id=“pageheader”> Layout with CSS The CSS #pageheader {  margin-bottom:10px;} <div id=“main_nav”> 	<nav> 		<ul> 			<li>Link</li> 	</ul> </nav> </div> <div id=“content”> <section> 	<h1>About Us</h1> 	<p>We are a full-service blah blah blah.</p> </section> </div> <footer id=“pagefooter”>
<header id=“pageheader”> Layout with CSS The CSS #pageheader {  margin-bottom:10px;} #main_nav { float:left; width:200px; } <div id=“main_nav”> 	<nav> 		<ul> 			<li>Link</li> 	</ul> </nav> </div> <div id=“content”> <section> 	<h1>About Us</h1> 	<p>We are a full-service blah blah blah.</p> </section> </div> <footer id=“pagefooter”>
<header id=“pageheader”> Layout with CSS The CSS #pageheader {  margin-bottom:10px;} #main_nav { float:left; width:200px; } #content {margin-left: 210px;} <div id=“main_nav”> 	<nav> 		<ul> 			<li>Link</li> 	</ul> </nav> </div> <div id=“content”> <section> 	<h1>About Us</h1> 	<p>We are a full-service blah blah blah.</p> </section> </div> <footer id=“pagefooter”>
<header id=“pageheader”> Layout with CSS The CSS #pageheader {  margin-bottom:10px;} #main_nav { float:left; width:200px; } #content {margin-left: 210px;} #pagefooter {clear: both; margin-top:10px;} <div id=“main_nav”> 	<nav> 		<ul> 			<li>Link</li> 	</ul> </nav> </div> <div id=“content”> <section> 	<h1>About Us</h1> 	<p>We are a full-service blah blah blah.</p> </section> </div> <footer id=“pagefooter”>
A COOL, GREEN BOX WITH ROUNDED EDGES AND DROP SHADOW. HTML <body> <header id=“pageheader”> 	<h1>A cool, green box with 		some rounded edges and 		drop shadow.</h1> 	</header> </body> CSS #pageheader { 	margin:30px; padding:35px; color: #fff; 	background: #aac46b; 	border:1px solid #91ab53; 	text-transform: uppercase; box-shadow: 0px 6px 6px #666; 	text-shadow: 0 0 2px #999; 	border-radius: 14px; -moz-border-radius: 14px; /* other vendor prefixes here */ }
A COOL, GREEN BOX WITH ROUNDED EDGES AND DROP SHADOW. HTML <body> 	<header> 		<h1>A cool, green box with 		some rounded edges and 		drop shadow.</h1> 	</header> </body> CSS header  h1  { 	margin:30px; padding:35px; color: #fff; 	background: #aac46b; 	border:1px solid #91ab53; 	text-transform: uppercase; box-shadow: 0px 6px 6px #666; 	text-shadow: 0 0 2px #999; 	border-radius: 14px; -moz-border-radius: 14px; /* other vendor prefixes here */ }
A COOL, GREEN BOX WITH ROUNDED EDGES AND DROP SHADOW. HTML <body> 	<header> 	<h1>A cool, green box with 		some rounded edges and 		drop shadow.</h1> 	</header> </body> CSS body+header { 	margin:30px; padding:35px; color: #fff; 	background: #aac46b; 	border:1px solid #91ab53; 	text-transform: uppercase; box-shadow: 0px 6px 6px #666; 	text-shadow: 0 0 2px #999; 	border-radius: 14px; -moz-border-radius: 14px; /* other vendor prefixes here */ }
HTML <body> 	<aside>     <figure> 	<imgsrc=“images/agassi.jpg”>     </figure> </aside> </body> CSS body { background:#999999; } figure  img { 	border:10px solid #ffffff; 	box-shadow: 3px 3px 3px #333333; }
Thanks to Christopher Spencer (ca. 1987) for organizing WordCamp.
Mullet Resources Google: “mullet”

Más contenido relacionado

La actualidad más candente

Introduction to Cascading Style Sheets
Introduction to Cascading Style SheetsIntroduction to Cascading Style Sheets
Introduction to Cascading Style SheetsTushar Joshi
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet pptabhilashagupta
 
Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to htmlpalhaftab
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to htmlvikasgaur31
 
Basics Of Css And Some Common Mistakes
Basics Of Css And Some Common MistakesBasics Of Css And Some Common Mistakes
Basics Of Css And Some Common Mistakessanjay2211
 
LAMP_TRAINING_SESSION_3
LAMP_TRAINING_SESSION_3LAMP_TRAINING_SESSION_3
LAMP_TRAINING_SESSION_3umapst
 
Wdf 222chp iii vi
Wdf 222chp iii viWdf 222chp iii vi
Wdf 222chp iii viBala Ganesh
 
Intro to html revised2
Intro to html revised2Intro to html revised2
Intro to html revised2mmvidanes29
 
CSS For Online Journalism
CSS For Online JournalismCSS For Online Journalism
CSS For Online Journalismamherstwire
 
Getting into HTML
Getting into HTMLGetting into HTML
Getting into HTMLispkosova
 
Html Intro2
Html Intro2Html Intro2
Html Intro2mlackner
 

La actualidad más candente (19)

Introduction to Cascading Style Sheets
Introduction to Cascading Style SheetsIntroduction to Cascading Style Sheets
Introduction to Cascading Style Sheets
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
 
Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to html
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
Basics Of Css And Some Common Mistakes
Basics Of Css And Some Common MistakesBasics Of Css And Some Common Mistakes
Basics Of Css And Some Common Mistakes
 
Html1
Html1Html1
Html1
 
LAMP_TRAINING_SESSION_3
LAMP_TRAINING_SESSION_3LAMP_TRAINING_SESSION_3
LAMP_TRAINING_SESSION_3
 
Wdf 222chp iii vi
Wdf 222chp iii viWdf 222chp iii vi
Wdf 222chp iii vi
 
Html ppt
Html pptHtml ppt
Html ppt
 
Html
HtmlHtml
Html
 
Intro to html revised2
Intro to html revised2Intro to html revised2
Intro to html revised2
 
CSS For Online Journalism
CSS For Online JournalismCSS For Online Journalism
CSS For Online Journalism
 
Html basic
Html basicHtml basic
Html basic
 
Html tag
Html tagHtml tag
Html tag
 
Getting into HTML
Getting into HTMLGetting into HTML
Getting into HTML
 
Basic-CSS-tutorial
Basic-CSS-tutorialBasic-CSS-tutorial
Basic-CSS-tutorial
 
Html Intro2
Html Intro2Html Intro2
Html Intro2
 
HTML
HTMLHTML
HTML
 

Destacado

Progetto parco pubblico Esame corso garden design I progetto di giardino pubb...
Progetto parco pubblico Esame corso garden design I progetto di giardino pubb...Progetto parco pubblico Esame corso garden design I progetto di giardino pubb...
Progetto parco pubblico Esame corso garden design I progetto di giardino pubb...NAD Nuova Accademia del Design
 
Search Engine Advertising
Search Engine AdvertisingSearch Engine Advertising
Search Engine AdvertisingNextBee Media
 
óLeo de coco para atletas
óLeo de coco para atletasóLeo de coco para atletas
óLeo de coco para atletasÓleo de Coco
 
Coaching Clinic Tahap ke-2 Hari ke-5 Jakarta Football Festival - GrabBike Rus...
Coaching Clinic Tahap ke-2 Hari ke-5 Jakarta Football Festival - GrabBike Rus...Coaching Clinic Tahap ke-2 Hari ke-5 Jakarta Football Festival - GrabBike Rus...
Coaching Clinic Tahap ke-2 Hari ke-5 Jakarta Football Festival - GrabBike Rus...Uni Papua Football
 
Learning Method
Learning MethodLearning Method
Learning Method晟 沈
 
SEDES DE LA XIII ONEM
SEDES DE LA XIII ONEMSEDES DE LA XIII ONEM
SEDES DE LA XIII ONEMGerson Ames
 
RESULTADO DIRECTORES DE UGEL
RESULTADO DIRECTORES DE UGELRESULTADO DIRECTORES DE UGEL
RESULTADO DIRECTORES DE UGELGerson Ames
 
Examinaos si esta en la fe
Examinaos si esta en la feExaminaos si esta en la fe
Examinaos si esta en la feJose Cambero 2
 
Progetto garden design di Alberto Farè Esame corso garden design 50 ore per c...
Progetto garden design di Alberto Farè Esame corso garden design 50 ore per c...Progetto garden design di Alberto Farè Esame corso garden design 50 ore per c...
Progetto garden design di Alberto Farè Esame corso garden design 50 ore per c...NAD Nuova Accademia del Design
 
2º sec registro-lectura entrada 1 y 2
2º sec registro-lectura entrada 1 y 22º sec registro-lectura entrada 1 y 2
2º sec registro-lectura entrada 1 y 2Gerson Ames
 
Los principios del tesoro celestial
Los principios del tesoro celestialLos principios del tesoro celestial
Los principios del tesoro celestialebenezermd
 
Tolerance Stackups Using Oracle Crystal Ball
Tolerance Stackups Using Oracle Crystal BallTolerance Stackups Using Oracle Crystal Ball
Tolerance Stackups Using Oracle Crystal BallRamon Balisnomo
 

Destacado (20)

Lessen groep 8
Lessen groep 8Lessen groep 8
Lessen groep 8
 
Progetto parco pubblico Esame corso garden design I progetto di giardino pubb...
Progetto parco pubblico Esame corso garden design I progetto di giardino pubb...Progetto parco pubblico Esame corso garden design I progetto di giardino pubb...
Progetto parco pubblico Esame corso garden design I progetto di giardino pubb...
 
Search Engine Advertising
Search Engine AdvertisingSearch Engine Advertising
Search Engine Advertising
 
-REPORT1_GEO (1)
-REPORT1_GEO (1)-REPORT1_GEO (1)
-REPORT1_GEO (1)
 
Qno 1 (a)
Qno 1 (a)Qno 1 (a)
Qno 1 (a)
 
Alaska
AlaskaAlaska
Alaska
 
óLeo de coco para atletas
óLeo de coco para atletasóLeo de coco para atletas
óLeo de coco para atletas
 
Coaching Clinic Tahap ke-2 Hari ke-5 Jakarta Football Festival - GrabBike Rus...
Coaching Clinic Tahap ke-2 Hari ke-5 Jakarta Football Festival - GrabBike Rus...Coaching Clinic Tahap ke-2 Hari ke-5 Jakarta Football Festival - GrabBike Rus...
Coaching Clinic Tahap ke-2 Hari ke-5 Jakarta Football Festival - GrabBike Rus...
 
Learning Method
Learning MethodLearning Method
Learning Method
 
SEDES DE LA XIII ONEM
SEDES DE LA XIII ONEMSEDES DE LA XIII ONEM
SEDES DE LA XIII ONEM
 
RESULTADO DIRECTORES DE UGEL
RESULTADO DIRECTORES DE UGELRESULTADO DIRECTORES DE UGEL
RESULTADO DIRECTORES DE UGEL
 
Examinaos si esta en la fe
Examinaos si esta en la feExaminaos si esta en la fe
Examinaos si esta en la fe
 
Progetto garden design di Alberto Farè Esame corso garden design 50 ore per c...
Progetto garden design di Alberto Farè Esame corso garden design 50 ore per c...Progetto garden design di Alberto Farè Esame corso garden design 50 ore per c...
Progetto garden design di Alberto Farè Esame corso garden design 50 ore per c...
 
Mixing Mill - A story of woes to wows!!
Mixing Mill - A story of woes to wows!!Mixing Mill - A story of woes to wows!!
Mixing Mill - A story of woes to wows!!
 
Chapter 2.datatypes and operators
Chapter 2.datatypes and operatorsChapter 2.datatypes and operators
Chapter 2.datatypes and operators
 
2º sec registro-lectura entrada 1 y 2
2º sec registro-lectura entrada 1 y 22º sec registro-lectura entrada 1 y 2
2º sec registro-lectura entrada 1 y 2
 
Los principios del tesoro celestial
Los principios del tesoro celestialLos principios del tesoro celestial
Los principios del tesoro celestial
 
C++ functions
C++ functionsC++ functions
C++ functions
 
Tolerance Stackups Using Oracle Crystal Ball
Tolerance Stackups Using Oracle Crystal BallTolerance Stackups Using Oracle Crystal Ball
Tolerance Stackups Using Oracle Crystal Ball
 
Function C++
Function C++ Function C++
Function C++
 

Similar a Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)

IPW 3rd Course - CSS
IPW 3rd Course - CSSIPW 3rd Course - CSS
IPW 3rd Course - CSSVlad Posea
 
Css Best Practices
Css Best PracticesCss Best Practices
Css Best Practicesguest3ebcca
 
Css Best Practices
Css Best PracticesCss Best Practices
Css Best Practicessachin9737
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introductionapnwebdev
 
Html, CSS & Web Designing
Html, CSS & Web DesigningHtml, CSS & Web Designing
Html, CSS & Web DesigningLeslie Steele
 
Block2 Session2 Presentation
Block2 Session2 PresentationBlock2 Session2 Presentation
Block2 Session2 PresentationMichael Gwyther
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technologyvikram singh
 
Webpages And Dynamic Content
Webpages And Dynamic ContentWebpages And Dynamic Content
Webpages And Dynamic Contentmaycourse
 
Creating Web Sites with HTML and CSS
Creating Web Sites with HTML and CSSCreating Web Sites with HTML and CSS
Creating Web Sites with HTML and CSSBG Java EE Course
 
3.2 introduction to css
3.2 introduction to css3.2 introduction to css
3.2 introduction to cssBulldogs83
 
3.2 introduction to css
3.2 introduction to css3.2 introduction to css
3.2 introduction to cssBulldogs83
 
Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.netProgrammer Blog
 
Stylesheets for Online Help - Scott DeLoach, ClickStart
Stylesheets for Online Help - Scott DeLoach, ClickStartStylesheets for Online Help - Scott DeLoach, ClickStart
Stylesheets for Online Help - Scott DeLoach, ClickStartScott DeLoach
 

Similar a Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to) (20)

IPW 3rd Course - CSS
IPW 3rd Course - CSSIPW 3rd Course - CSS
IPW 3rd Course - CSS
 
CSS
CSSCSS
CSS
 
Html Expression Web
Html Expression WebHtml Expression Web
Html Expression Web
 
Css Best Practices
Css Best PracticesCss Best Practices
Css Best Practices
 
Css Best Practices
Css Best PracticesCss Best Practices
Css Best Practices
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
 
Html, CSS & Web Designing
Html, CSS & Web DesigningHtml, CSS & Web Designing
Html, CSS & Web Designing
 
Block2 Session2 Presentation
Block2 Session2 PresentationBlock2 Session2 Presentation
Block2 Session2 Presentation
 
AK css
AK cssAK css
AK css
 
CSS
CSSCSS
CSS
 
CSS
CSSCSS
CSS
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technology
 
Webpages And Dynamic Content
Webpages And Dynamic ContentWebpages And Dynamic Content
Webpages And Dynamic Content
 
CSS
CSSCSS
CSS
 
Creating Web Sites with HTML and CSS
Creating Web Sites with HTML and CSSCreating Web Sites with HTML and CSS
Creating Web Sites with HTML and CSS
 
3.2 introduction to css
3.2 introduction to css3.2 introduction to css
3.2 introduction to css
 
3.2 introduction to css
3.2 introduction to css3.2 introduction to css
3.2 introduction to css
 
Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.net
 
Css intro
Css introCss intro
Css intro
 
Stylesheets for Online Help - Scott DeLoach, ClickStart
Stylesheets for Online Help - Scott DeLoach, ClickStartStylesheets for Online Help - Scott DeLoach, ClickStart
Stylesheets for Online Help - Scott DeLoach, ClickStart
 

Último

Niintendo Wii Presentation Template.pptx
Niintendo Wii Presentation Template.pptxNiintendo Wii Presentation Template.pptx
Niintendo Wii Presentation Template.pptxKevinYaelJimnezSanti
 
办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书
办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书
办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书zdzoqco
 
Color Theory Explained for Noobs- Think360 Studio
Color Theory Explained for Noobs- Think360 StudioColor Theory Explained for Noobs- Think360 Studio
Color Theory Explained for Noobs- Think360 StudioThink360 Studio
 
Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...
Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...
Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...Associazione Digital Days
 
10 must-have Chrome extensions for designers
10 must-have Chrome extensions for designers10 must-have Chrome extensions for designers
10 must-have Chrome extensions for designersPixeldarts
 
Unit1_Syllbwbnwnwneneneneneneentation_Sem2.pptx
Unit1_Syllbwbnwnwneneneneneneentation_Sem2.pptxUnit1_Syllbwbnwnwneneneneneneentation_Sem2.pptx
Unit1_Syllbwbnwnwneneneneneneentation_Sem2.pptxNitish292041
 
Iconic Global Solution - web design, Digital Marketing services
Iconic Global Solution - web design, Digital Marketing servicesIconic Global Solution - web design, Digital Marketing services
Iconic Global Solution - web design, Digital Marketing servicesIconic global solution
 
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...Rishabh Aryan
 
Interior Design for Office a cura di RMG Project Studio
Interior Design for Office a cura di RMG Project StudioInterior Design for Office a cura di RMG Project Studio
Interior Design for Office a cura di RMG Project StudioRMG Project Studio
 
The spirit of digital place - game worlds and architectural phenomenology
The spirit of digital place - game worlds and architectural phenomenologyThe spirit of digital place - game worlds and architectural phenomenology
The spirit of digital place - game worlds and architectural phenomenologyChristopher Totten
 
Making and Unmaking of Chandigarh - A City of Two Plans2-4-24.ppt
Making and Unmaking of Chandigarh - A City of Two Plans2-4-24.pptMaking and Unmaking of Chandigarh - A City of Two Plans2-4-24.ppt
Making and Unmaking of Chandigarh - A City of Two Plans2-4-24.pptJIT KUMAR GUPTA
 
Piece by Piece Magazine
Piece by Piece Magazine                      Piece by Piece Magazine
Piece by Piece Magazine CharlottePulte
 
10 Best WordPress Plugins to make the website effective in 2024
10 Best WordPress Plugins to make the website effective in 202410 Best WordPress Plugins to make the website effective in 2024
10 Best WordPress Plugins to make the website effective in 2024digital learning point
 
Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Rndexperts
 
怎么办理英国Newcastle毕业证纽卡斯尔大学学位证书一手渠道
怎么办理英国Newcastle毕业证纽卡斯尔大学学位证书一手渠道怎么办理英国Newcastle毕业证纽卡斯尔大学学位证书一手渠道
怎么办理英国Newcastle毕业证纽卡斯尔大学学位证书一手渠道yrolcks
 
Pearl Disrtrict urban analyusis study pptx
Pearl Disrtrict urban analyusis study pptxPearl Disrtrict urban analyusis study pptx
Pearl Disrtrict urban analyusis study pptxDanielTamiru4
 
Pharmaceutical Packaging for the elderly.pdf
Pharmaceutical Packaging for the elderly.pdfPharmaceutical Packaging for the elderly.pdf
Pharmaceutical Packaging for the elderly.pdfAayushChavan5
 
world health day 2024.pptxgbbvggvbhjjjbbbb
world health day 2024.pptxgbbvggvbhjjjbbbbworld health day 2024.pptxgbbvggvbhjjjbbbb
world health day 2024.pptxgbbvggvbhjjjbbbbpreetirao780
 
Karim apartment ideas 01 ppppppppppppppp
Karim apartment ideas 01 pppppppppppppppKarim apartment ideas 01 ppppppppppppppp
Karim apartment ideas 01 pppppppppppppppNadaMohammed714321
 
General Knowledge Quiz Game C++ CODE.pptx
General Knowledge Quiz Game C++ CODE.pptxGeneral Knowledge Quiz Game C++ CODE.pptx
General Knowledge Quiz Game C++ CODE.pptxmarckustrevion
 

Último (20)

Niintendo Wii Presentation Template.pptx
Niintendo Wii Presentation Template.pptxNiintendo Wii Presentation Template.pptx
Niintendo Wii Presentation Template.pptx
 
办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书
办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书
办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书
 
Color Theory Explained for Noobs- Think360 Studio
Color Theory Explained for Noobs- Think360 StudioColor Theory Explained for Noobs- Think360 Studio
Color Theory Explained for Noobs- Think360 Studio
 
Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...
Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...
Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...
 
10 must-have Chrome extensions for designers
10 must-have Chrome extensions for designers10 must-have Chrome extensions for designers
10 must-have Chrome extensions for designers
 
Unit1_Syllbwbnwnwneneneneneneentation_Sem2.pptx
Unit1_Syllbwbnwnwneneneneneneentation_Sem2.pptxUnit1_Syllbwbnwnwneneneneneneentation_Sem2.pptx
Unit1_Syllbwbnwnwneneneneneneentation_Sem2.pptx
 
Iconic Global Solution - web design, Digital Marketing services
Iconic Global Solution - web design, Digital Marketing servicesIconic Global Solution - web design, Digital Marketing services
Iconic Global Solution - web design, Digital Marketing services
 
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
 
Interior Design for Office a cura di RMG Project Studio
Interior Design for Office a cura di RMG Project StudioInterior Design for Office a cura di RMG Project Studio
Interior Design for Office a cura di RMG Project Studio
 
The spirit of digital place - game worlds and architectural phenomenology
The spirit of digital place - game worlds and architectural phenomenologyThe spirit of digital place - game worlds and architectural phenomenology
The spirit of digital place - game worlds and architectural phenomenology
 
Making and Unmaking of Chandigarh - A City of Two Plans2-4-24.ppt
Making and Unmaking of Chandigarh - A City of Two Plans2-4-24.pptMaking and Unmaking of Chandigarh - A City of Two Plans2-4-24.ppt
Making and Unmaking of Chandigarh - A City of Two Plans2-4-24.ppt
 
Piece by Piece Magazine
Piece by Piece Magazine                      Piece by Piece Magazine
Piece by Piece Magazine
 
10 Best WordPress Plugins to make the website effective in 2024
10 Best WordPress Plugins to make the website effective in 202410 Best WordPress Plugins to make the website effective in 2024
10 Best WordPress Plugins to make the website effective in 2024
 
Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025
 
怎么办理英国Newcastle毕业证纽卡斯尔大学学位证书一手渠道
怎么办理英国Newcastle毕业证纽卡斯尔大学学位证书一手渠道怎么办理英国Newcastle毕业证纽卡斯尔大学学位证书一手渠道
怎么办理英国Newcastle毕业证纽卡斯尔大学学位证书一手渠道
 
Pearl Disrtrict urban analyusis study pptx
Pearl Disrtrict urban analyusis study pptxPearl Disrtrict urban analyusis study pptx
Pearl Disrtrict urban analyusis study pptx
 
Pharmaceutical Packaging for the elderly.pdf
Pharmaceutical Packaging for the elderly.pdfPharmaceutical Packaging for the elderly.pdf
Pharmaceutical Packaging for the elderly.pdf
 
world health day 2024.pptxgbbvggvbhjjjbbbb
world health day 2024.pptxgbbvggvbhjjjbbbbworld health day 2024.pptxgbbvggvbhjjjbbbb
world health day 2024.pptxgbbvggvbhjjjbbbb
 
Karim apartment ideas 01 ppppppppppppppp
Karim apartment ideas 01 pppppppppppppppKarim apartment ideas 01 ppppppppppppppp
Karim apartment ideas 01 ppppppppppppppp
 
General Knowledge Quiz Game C++ CODE.pptx
General Knowledge Quiz Game C++ CODE.pptxGeneral Knowledge Quiz Game C++ CODE.pptx
General Knowledge Quiz Game C++ CODE.pptx
 

Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)

  • 1. Embrace the MulletCSS is the Party in the Back (a CSS ‘how-to’) TOM HAPGOOD WordCamp Fayetteville #wcfay / 2011
  • 2. To those of you in the room still rocking the mullet, I salute your bravery and dedication to the glory years.
  • 3.
  • 4.
  • 5. Art of Interactive Journalism // WP, FCP, PS, DW
  • 6. Motion Design // C4D, AE, AI, PS, FCP
  • 7. Typography // ID, PS, HTML5, CSS3http://www.hapgooddesign.com @thapgood
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. Structure + Presentation A key concept is to keep the structure and presentation separate (in separate files). structure: presentation: HTML CSS index.htmlstyle.css
  • 16.
  • 17. Often-Used CSS Properties { font-family { font-size { font-weight { font-style { text-align { color { background-image { background-color { background-repeat { padding { margin { float { line-height { letter-spacing { border { border-radius { box-shadow { text-transform { text-shadow { display { position { width { height
  • 18. margin padding border Content padding padding margin margin padding The Box Model margin
  • 19. margin padding border padding padding margin margin padding The Box Model margin
  • 20. margin padding border padding padding margin margin padding The Box Model margin
  • 21. margin padding border padding padding margin margin padding The Box Model margin
  • 22. Padding Nicki-G/Flickr The content The padding
  • 23. The padding The margin The border
  • 24. Linking the HTML and CSS Between the <head> tags in the HTML document, the following line is inserted: <head> <link rel=“stylesheet” href=“style.css”> </head> (making sure that the path to the style.css file is correct.)
  • 25. Syntax HTML CSS <body> <h1>Hello, world.</h1> </body> h1 { font-size: large; color: #003366; padding: 20px; }
  • 26. CSS Syntax A CSS rule consists of two main parts: selector { declaration;}
  • 27. CSS Syntax A CSS rule consists of two main parts: selector { declaration;} The declaration has two parts: selector { property: value; }
  • 28. CSS Syntax A CSS rule consists of two main parts: selector { declaration;} The declaration has two parts: selector { property: value; } selector { color: #000000; }
  • 29. CSS Syntax / element type selector Styling an existing HTML tag: To make all p (paragraph) tags on your page black: p { color: #000000; }
  • 30. HTML index.html <html> <body> <link rel=“stylesheet” … > <h1>Headline</h1> </body> </html>
  • 31. HTML CSS style.css index.html <html> <body> <link rel=“stylesheet” … > <h1>Headline</h1> </body> </html> h1 { color:#003366; font-family:Georgia, serif; text-transform:uppercase; font-size:large; }
  • 32. HTML CSS style.css index.html <html> <body> <link rel=“stylesheet” … > <h1>Headline</h1> </body> </html> h1 { color:#003366; font-family:Georgia, serif; text-transform:uppercase; font-size:large; } HEADLINE
  • 33. CSS Syntax / class selectors What if you wanted some h1 tags to be blue and some red? Expand the existing tag set with the use of classes: Classes use the dot notation as below: h1.breakingnews { color: #ff0000; } So, used whenever there is an h1 tag with a class of “breakingnews”.
  • 34. HTML index.html <html> <body> <link rel=“stylesheet” … > <h1>Headline</h1> <h1 class=“breakingnews”> This Just In!</h1> </body> </html>
  • 35. HTML CSS style.css index.html <html> <body> <link rel=“stylesheet” … > <h1>Headline</h1> <h1 class=“breakingnews”> This Just In!</h1> </body> </html> h1 { color:#003366; font-family:Georgia, serif; text-transform:uppercase; font-size:large; } h1.breakingnews { color:#ff0000; font-family:Georgia, serif; text-transform:none; font-size:medium; }
  • 36. HTML CSS style.css index.html <html> <body> <link rel=“stylesheet” … > <h1>Headline</h1> <h1 class=“breakingnews”> This Just In!</h1> </body> </html> h1 { color:#003366; font-family:Georgia, serif; text-transform:uppercase; font-size:large; } h1.breakingnews { color:#ff0000; font-family:Georgia, serif; text-transform:none; font-size:medium; } HEADLINE This Just In!
  • 37. CSS Syntax / descendant selectors What if you wanted some h1 tags to be blue, but only when they are inside of the <header> tag?: Descendant selectors look like this: header h1 { color: #003366; } or header .breakingnews{ color: #ff0000;} The h1 will only style blue when it’s nested inside the header tag: <header><h1>WordCamp</h1></header>
  • 38. CSS Syntax / adjacent sibling selectors What if you wanted some p tags to be bold, but only when they directly follow an h2? Use the + symbol: h2+p { font-weight:bold; } The p will only style bold when directly follows the h2: <h2>Welcome to WordCamp!</h2> <p>WordCamp (This will be bold)</p> <p>OtherCamp (This will not be bold)</p>
  • 39. Lots more General sibling selectors E~F { declarations; } Child selectors E>F {declarations; } Pseudo-classes li:hover, li:first-child, :nth-of-type Pseudo-elements p:first-line, ::selection
  • 40. Shorthand header { border-width:1px; border-style: dashed; border-color: #ff0000; }
  • 41. Shorthand header { border:1px dashed #ff0000; }
  • 42. Shorthand header { border-right:1px dashed #ff0000; }
  • 43. Shorthand header { border-bottom:1px dashed #ff0000; }
  • 44. Hexadecimal colors In mathematics and computer science, hexadecimal (also base 16, or hex) is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F (or alternatively a–f) to represent values ten to fifteen. For example, the hexadecimal number 2AF3 is equal, in decimal, to (2 × 163) + (10 × 162) + (15 × 161) + (3 × 160) , or 10,995.
  • 45. Hexadecimal colors A few to remember (the grayscales): #000000; /* black */ #333333; #666666; #999999; #cccccc; #ffffff; /* white */ (When each pairing is identical, it’s a gray).
  • 46. When the HEX RGB pairings are identical, it’s a gray.
  • 47. 147 color names are defined in the HTML and CSS color specification (17 standard colors plus 130 more).
  • 50. <header> Layout with CSS <div> <div> <footer>
  • 51. <header> Layout with CSS What’s a div tag? It’s short for “division” and it’s a way to think about creating “areas” or “segments” or “portions” of the page. Visually, these end up looking like columns or any other boxes on the page. <div> <div> <footer>
  • 52. <header> Layout with CSS What’s a div tag? It’s short for “division” and it’s a way to think about creating “areas” or “segments” or “portions” of the page. Visually, these end up looking like columns or any other boxes on the page. You may have many divs on a page, so you’ll need to give them a name, like this: <div class=“promobox”> <div> <div> <footer>
  • 53. <header> Layout with CSS What’s a div tag? It’s short for “division” and it’s a way to think about creating “areas” or “segments” or “portions” of the page. Visually, these end up looking like columns or any other boxes on the page. You may have many divs on a page, so you’ll need to give them a name, like this: <div class=“promobox”> Then, the CSS can talk directly to that div(s) for styling. <div> <div> <footer>
  • 54. <header> Layout with CSS What’s a div tag? It’s short for “division” and it’s a way to think about creating “areas” or “segments” or “portions” of the page. Visually, these end up looking like columns or any other boxes on the page. You may have many divs on a page, so you’ll need to give them a name, like this: <div class=“promobox”> Then, the CSS can talk directly to that div(s) for styling. .promobox { width:200px; } <div> <div> <footer>
  • 55. <header> Layout with CSS <div id=“main_nav”> <div> <footer>
  • 56. <header> Layout with CSS Wait, what’s an ID? Instead of giving an element, such as a div, a class name, you can give it an ID. An ID is used once per page. A class can be used many times on a page. Assigning an ID is very similar: <div id=“main_nav”> Then, you can have the CSS talk directly to that div for styling. #main_nav { width:200px; /* notice the # notation */ } <div id=“main_nav”> <div> <footer>
  • 57. <header> Layout with CSS Wait, what’s an ID? In other words, an ID is a unique identifier. I use an ID on a div when I’m certain that div is going to have a unique presence on the page, such as the main navigation or the page header. <div id=“main_nav”> <div> <footer>
  • 58. <header> Layout with CSS Wait, what’s an ID? In other words, an ID is a unique identifier. I use an ID on a div when I’m certain that div is going to have a unique presence on the page, such as the main navigation or the page header. Use a class designation on a div (or other element) that may be re-used on the page, such as a typographic treatment or multiple promotional boxes that sit in the sidebar. <div id=“main_nav”> <div> <footer>
  • 59. <header> Layout with CSS <div id=“main_nav”> <nav> <ul> <li>Link</li> </ul> </nav> </div> <div> <footer>
  • 60. <header> Layout with CSS <div id=“main_nav”> <nav> <ul> <li>Link</li> </ul> </nav> </div> <div id=“content”> <footer>
  • 61. <header> Layout with CSS <div id=“main_nav”> <nav> <ul> <li>Link</li> </ul> </nav> </div> <div id=“content”> <section> <h1>About Us</h1> <p>We are a full-service blah blah blah.</p> </section> </div> <footer>
  • 62. <header id=“pageheader”> Layout with CSS <div id=“main_nav”> <nav> <ul> <li>Link</li> </ul> </nav> </div> <div id=“content”> <section> <h1>About Us</h1> <p>We are a full-service blah blah blah.</p> </section> </div> <footer>
  • 63. <header id=“pageheader”> Layout with CSS <div id=“main_nav”> <nav> <ul> <li>Link</li> </ul> </nav> </div> <div id=“content”> <section> <h1>About Us</h1> <p>We are a full-service blah blah blah.</p> </section> </div> <footer id=“pagefooter”>
  • 64. <header id=“pageheader”> Layout with CSS The CSS #pageheader { margin-bottom:10px;} <div id=“main_nav”> <nav> <ul> <li>Link</li> </ul> </nav> </div> <div id=“content”> <section> <h1>About Us</h1> <p>We are a full-service blah blah blah.</p> </section> </div> <footer id=“pagefooter”>
  • 65. <header id=“pageheader”> Layout with CSS The CSS #pageheader { margin-bottom:10px;} #main_nav { float:left; width:200px; } <div id=“main_nav”> <nav> <ul> <li>Link</li> </ul> </nav> </div> <div id=“content”> <section> <h1>About Us</h1> <p>We are a full-service blah blah blah.</p> </section> </div> <footer id=“pagefooter”>
  • 66. <header id=“pageheader”> Layout with CSS The CSS #pageheader { margin-bottom:10px;} #main_nav { float:left; width:200px; } #content {margin-left: 210px;} <div id=“main_nav”> <nav> <ul> <li>Link</li> </ul> </nav> </div> <div id=“content”> <section> <h1>About Us</h1> <p>We are a full-service blah blah blah.</p> </section> </div> <footer id=“pagefooter”>
  • 67. <header id=“pageheader”> Layout with CSS The CSS #pageheader { margin-bottom:10px;} #main_nav { float:left; width:200px; } #content {margin-left: 210px;} #pagefooter {clear: both; margin-top:10px;} <div id=“main_nav”> <nav> <ul> <li>Link</li> </ul> </nav> </div> <div id=“content”> <section> <h1>About Us</h1> <p>We are a full-service blah blah blah.</p> </section> </div> <footer id=“pagefooter”>
  • 68. A COOL, GREEN BOX WITH ROUNDED EDGES AND DROP SHADOW. HTML <body> <header id=“pageheader”> <h1>A cool, green box with some rounded edges and drop shadow.</h1> </header> </body> CSS #pageheader { margin:30px; padding:35px; color: #fff; background: #aac46b; border:1px solid #91ab53; text-transform: uppercase; box-shadow: 0px 6px 6px #666; text-shadow: 0 0 2px #999; border-radius: 14px; -moz-border-radius: 14px; /* other vendor prefixes here */ }
  • 69. A COOL, GREEN BOX WITH ROUNDED EDGES AND DROP SHADOW. HTML <body> <header> <h1>A cool, green box with some rounded edges and drop shadow.</h1> </header> </body> CSS header h1 { margin:30px; padding:35px; color: #fff; background: #aac46b; border:1px solid #91ab53; text-transform: uppercase; box-shadow: 0px 6px 6px #666; text-shadow: 0 0 2px #999; border-radius: 14px; -moz-border-radius: 14px; /* other vendor prefixes here */ }
  • 70. A COOL, GREEN BOX WITH ROUNDED EDGES AND DROP SHADOW. HTML <body> <header> <h1>A cool, green box with some rounded edges and drop shadow.</h1> </header> </body> CSS body+header { margin:30px; padding:35px; color: #fff; background: #aac46b; border:1px solid #91ab53; text-transform: uppercase; box-shadow: 0px 6px 6px #666; text-shadow: 0 0 2px #999; border-radius: 14px; -moz-border-radius: 14px; /* other vendor prefixes here */ }
  • 71.
  • 72. HTML <body> <aside> <figure> <imgsrc=“images/agassi.jpg”> </figure> </aside> </body> CSS body { background:#999999; } figure img { border:10px solid #ffffff; box-shadow: 3px 3px 3px #333333; }
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85. Thanks to Christopher Spencer (ca. 1987) for organizing WordCamp.
  • 86. Mullet Resources Google: “mullet”
  • 87.
  • 89. Maybe mock the ‘90s goatee next year…

Notas del editor

  1. Based on my concept last year of the mullet hair style and its relationship to web markup (HTMLis the ‘business front’ and CSS is the ‘party in the back’), this presentation will be a demonstration on the fun and effectiveness of implementing graphic design with HTML and cascading style sheets, with special attention to CSS3 techniques.
  2. “To those of you in the room still rocking the mullet, I salute your bravery and dedication to the past.”
  3. Tom Hapgood in front of the Berlin Wall with a mullet, Monsters of Rock ‘86 (Mannheim) and pegged, torn jeans. The quintessential ‘80s picture.
  4. Rocky Grove Sun Company web site design and coding by Tom Hapgood, using WordPress and the Pods plugin. A project of Haden Interactive.
  5. Vertz and Company web site design and coding by Tom Hapgood, using WordPress and the Pods plugin. A project of Haden Interactive.
  6. Deutsch | Parker Design web site design and coding by Tom Hapgood, using WordPress and the Pods plugin.
  7. When a web page starts to load, it’s all business. HTML tags providing a skeleton structure for marking up the content. As the page continues to load in the browser, the browser reads the code very quickly line-by-line starting at the top. In this example, when it arrives at line 6, the browser is told to bring up some more files from “the back” and load them.
  8. This normal HTML page as it would load without style sheets.
  9. When lines 6 and 7 are loaded in, the party starts. Line 6 (and 7) is a call to bring out the style sheet and load it also, thereby giving the page its presentational elements such as color, layout, fonts and even drop shadows, animations and rounded edges.
  10. The same page with the style sheets loaded and all the color, layout and typography.
  11. A style sheet (CSS) file that provides presentation elements to the web page, such as typography, colors and layout.
  12. The Box Model. Students always seem to confuse padding and margins.
  13. The Box Model. Students always seem to confuse padding and margins.
  14. The Box Model. Students always seem to confuse padding and margins.
  15. The Box Model. Students always seem to confuse padding and margins. A video
  16. Students always seem to confuse padding and margins. You don’t want your content to get hurt by bouncing off the hard inside edges of the border, so you add padding.
  17. Another type of padded cell. Some basic elements of the box model. The margin is the space around a box or outside the border, or between two adjacent boxes pushing them apart. The padding goes inside the border, between the content and the border, while the margin goes outside the border.
  18. Linking the HTML and CSSBetween the &lt;head&gt; tags in the HTML document, the following line is inserted:&lt;head&gt; &lt;link rel=“stylesheet” href=“style.css”&gt;&lt;/head&gt;(making sure that the path to the style.css file is correct.)
  19. Linking the HTML and CSSBetween the &lt;head&gt; tags in the HTML document, the following line is inserted:&lt;head&gt; &lt;link rel=“stylesheet” href=“style.css”&gt;&lt;/head&gt;(making sure that the path to the style.css file is correct.)
  20. CSS SyntaxA CSS rule consists of two main parts: selector and declaration
  21. CSS SyntaxA CSS rule consists of two main parts: selector and declarationThe declaration has two parts: property and value
  22. CSS SyntaxA CSS rule consists of two main parts: selector and declarationThe declaration has two parts: property and valueFor instance, color: #000000 (black)
  23. CSS Syntax / element type selector, Styling an existing HTML tagTo make all p (paragraph) tags on your page black: p { color: #000000; }
  24. The basic relationship between an HTML page and a CSS document, and the basic styling of an h1 tag.
  25. The basic relationship between an HTML page and a CSS document, and the basic styling of an h1 tag.
  26. The basic relationship between an HTML page and a CSS document, and the basic styling of an h1 tag.
  27. What if you wanted some h1 tags to be blue and some red? Expand the existing tag set with the use of classes: Classes use the dot notation as below: h1.breakingnews { color: #ff0000; }
  28. Using a class to style the h1 tag in two different ways.
  29. The basic relationship between an HTML page and a CSS document, and the basic styling of an h1 tag.
  30. Using a class to style the h1 tag in two different ways.
  31. What if you wanted some h1 tags to be blue and some red? Expand the existing tag set with the use of classes: Classes use the dot notation as below: h1.breakingnews { color: #ff0000; }
  32. What if you wanted some h1 tags to be blue and some red? Expand the existing tag set with the use of classes: Classes use the dot notation as below: h1.breakingnews { color: #ff0000; }
  33. The official explanation of hexadecimal colors. I just use Photoshop or one of the color pickers in the coding programs.
  34. The official explanation of hexadecimal colors. I just use Photoshop or one of the color pickers in the coding programs. (When each pairing is identical, it’s a gray).
  35. Layout with CSS
  36. The basic web page layout, with a header, two columns and a footer
  37. The basic web page layout, with a header, two columns and a footer, using a &lt;header&gt; tag, two &lt;div&gt; tags and a &lt;footer&gt; tag.
  38. What’s a div tag?It’s short for “division” and it’s a way to think about creating “areas” or “segments” or “portions” of the page. Visually, these end up looking like columns or any other boxes on the page.
  39. What’s a div tag?It’s short for “division” and it’s a way to think about creating “areas” or “segments” or “portions” of the page. Visually, these end up looking like columns or any other boxes on the page.You may have many divs on a page, so you’ll need to give them a name, like this: &lt;div class=“promobox”&gt;
  40. What’s a div tag?It’s short for “division” and it’s a way to think about creating “areas” or “segments” or “portions” of the page. Visually, these end up looking like columns or any other boxes on the page.You may have many divs on a page, so you’ll need to give them a name, like this: &lt;div class=“promobox”&gt;Then, the CSS can talk directly to that div(s) for styling.
  41. What’s a div tag?It’s short for “division” and it’s a way to think about creating “areas” or “segments” or “portions” of the page. Visually, these end up looking like columns or any other boxes on the page.You may have many divs on a page, so you’ll need to give them a name, like this: &lt;div class=“promobox”&gt;Then, the CSS can talk directly to that div(s) for styling. .promobox { width:200px; }
  42. The left div gets and ID of “main_nav”
  43. Wait, what’s an ID?Instead of giving an element, such as a div, a class name, you can give it an ID. An ID is used once per page. A class can be used many times on a page.Assigning an ID is very similar: &lt;div id=“main_nav”&gt;Then, you can have the CSS talk directly to that div for styling. #main_nav { width:200px; /* notice the # notation */ }
  44. Wait, what’s an ID?In other words, an ID is a unique identifier.I use an ID on a div when I’m certain that div is going to have a unique presence on the page, such as the main navigation or the page header.
  45. Wait, what’s an ID?In other words, an ID is a unique identifier.I use an ID on a div when I’m certain that div is going to have a unique presence on the page, such as the main navigation or the page header.Use a class designation on a div (or other element) that may be re-used on the page, such as a typographic treatment or multiple promotional boxes that sit in the sidebar.
  46. Go ahead and give the header an id, as there can be many other header tags on the page.
  47. Go ahead and give the footer an id, as there can be many other footer tags on the page.
  48. The CSS for the basic layout#pageheader { margin-bottom:10px;}
  49. The CSS for the basic layout#pageheader { margin-bottom:10px;}#main_nav { float:left; width:200px; }
  50. The CSS for the basic layout#pageheader { margin-bottom:10px;}#main_nav { float:left; width:200px; }#content {margin-left: 210px;}
  51. The CSS for the basic layout#pageheader { margin-bottom:10px;}#main_nav { float:left; width:200px; }#content {margin-left: 210px;}#pagefooter {clear: both; margin-top:10px;}
  52. Example of a header box HTML and CSS with a hint of vendor prefixing for explanation. This method uses an ID of “pageheader” on the header tag for a styling hook.
  53. Example of a header box HTML and CSS with a hint of vendor prefixing for explanation. This method uses a descendant selector header h1. But, what if there was another header h1 scenario on the page, perhaps within a section in the content div?
  54. Example of a header box HTML and CSS with a hint of vendor prefixing for explanation. This method uses an adjacent sibling selector body+header, meaning this header will only style in this way if it is directly preceded by the body tag. This is a good method in that it doesn’t involve the need to use an ID or class in the HTML. Less markup.
  55. Example of styling an image with a large, white border and box shadow on a gray body (browser viewport).
  56. Example of styling an image with a large, white border and box shadow. The styling “hook” used here is a figure img. This would, of course, style all images in figure tags throughout the whole site.
  57. Example of styling an image with a large, white border and box shadow.
  58. Coda – One-window Web Development, by Panic. Sometimes I use this, but it hasn’t been updated enough in a long time.
  59. Textmate for code editing
  60. Cssedit by macrabbit. Make your edits and watch them happen in real time.
  61. Adobe Dreamweaver CS5.5 on Windows and Macintosh
  62. Microsoft Expression Web 4 on Windows
  63. Ultimate CSS Gradient Generator at http://www.colorzilla.com/gradient-editor/
  64. Progressive Internet Explorer at http://www.css3pie.com
  65. border-radius.com, a service by jacobbijani, at http://www.border-radius.com
  66. CSS3 Generator at http://www.css3generator.com
  67. Previewing the Deutsch | Parker Design web site in Internet Explorer 7/8/9 in Windows 7 through Parallels 6 Desktop for Mac.
  68. Previewing the Deutsch | Parker Design web site in Internet Explorer 7/8/9 in Windows 7 through Parallels 6 Desktop for Mac.
  69. Thanks to Christopher Spencer, 1987 (Photoshopped image of Christopher today with a mullet), the organizer of WordCamp Fayetteville 2010 and 2011.
  70. Mullet Resources
  71. If you are a Northwest Arkansas creative or an alumnus/alumna of the UA Art Department, please join our Facebook group!
  72. Done with the mullet.
  73. Maybe mock the ‘90s goatee next year…