SlideShare a Scribd company logo
TAO OF CSS
ROB PORTER
I LOVE CSS WAY TOO MUCH
Rob Porter
BASIC CSS SHAPES
▸ Circle
▸ Square
▸ Rectangle
▸ Ovals
.circle {
background-color:
#298BE2;
width: 200px;
height: 200px;
border-radius: 50%;
}
<div class=“max-circle">
<img src="Max-fall.png" />
</div>
.square {
background: #298BE2;
width: 200px;
height: 200px;
}
.rectangle {
background-color: #298BE2;
width: 100px;
height: 200px;
float: left;
}
.oval {
width: 100px;
height: 200px;
background-color: #298BE2;
/*border-radius: 50px / 100px;*/
border-radius: 50%;
}
BORDER DRAWN CSS SHAPES
▸ Triangles
▸ Trapezoid
▸ Star
.triangle-up {
width: 0;
height: 0;
border-left: 50px solid
transparent;
border-right: 50px solid
transparent;
border-bottom: 100px
solid #298BE2;
}
Triangles
.triangle-up {
width: 0;
height: 0;
border-left: 50px solid
white;
border-right: 50px solid
white;
border-bottom: 100px
solid #298BE2;
}
Triangles
.triangle-down {
width: 0;
height: 0;
border-left: 50px solid
transparent;
border-right: 50px solid
transparent;
border-top: 100px solid
#298BE2;
}
Triangles
.triangle-right {
width: 0;
height: 0;
border-top: 50px solid
transparent;
border-left: 100px solid
#298BE2;
border-bottom: 50px
solid transparent;
}
Triangles
.triangle-left {
width: 0;
height: 0;
border-top: 50px solid
transparent;
border-right: 100px
solid #298BE2;
border-bottom: 50px
solid transparent;
}
Triangles
.triangle-top-left {
width: 0;
height: 0;
border-top: 100px solid
#298BE2;
border-right: 100px solid
transparent;
}
Triangles
.triangle-top-left {
width: 0;
height: 0;
border-top: 100px solid
#298BE2;
border-right: 100px solid
white;
}
Triangles
.triangle-top-right {
width: 0;
height: 0;
border-top: 100px solid
#298BE2;
border-left: 100px solid
transparent;
}
Triangles
.triangle-bottom-left {
width: 0;
height: 0;
border-bottom: 100px
solid #298BE2;
border-right: 100px solid
transparent;
}
Triangles
.triangle-bottom-right {
width: 0;
height: 0;
border-bottom: 100px
solid #298BE2;
border-left: 100px solid
transparent;
}
Triangles
Triangles
.trapezoid {
height: 0;
width: 100px;
border-bottom: 100px
solid #298BE2;
border-left: 50px solid
transparent;
border-right: 50px solid
transparent;
}
Triangles
.star-six {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 100px solid #298BE2;
position: relative;
}
Triangles
.star-six:after {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-top: 100px solid #298BE2;
position: absolute;
content: "";
top: 30px;
left: -50px;
}
COOL CSS SHAPES
▸ Talk Bubble
▸ Pac-Man
▸ Yin Yang
Tao of CSS
.t.talkbubble {
width: 120px;
height: 80px;
background: #298BE2;
position: relative;
border-radius: 10px;
margin-left: 26px;
padding: 1em 0em 0em 1.4em;
font-size: 1.5em;
font-weight: bold;
}
.talkbubble:before {
content:"";
position: absolute;
right: 100%;
top: 26px;
width: 0;
height: 0;
border-top: 13px solid transparent;
border-right: 26px solid #298BE2;
border-bottom: 13px solid transparent;
}
.pacman {
width: 0px;
height: 0px;
border-right: 60px solid transparent;
border-top: 60px solid #E9E900;
border-left: 60px solid #E9E900;
border-bottom: 60px solid #E9E900;
border-radius: 60px;
}
.yin-yang {
/* by Alexander Futekov */
width: 96px;
height: 48px;
background: #eee;
border-color: #298BE2;
border-style: solid;
border-width: 2px 2px 50px 2px;
border-radius: 100%;
position: relative;
}
.yin-yang:before {
content: "";
position: absolute;
top: 50%;
left: 0;
background: #eee;
border: 18px solid #298BE2;
border-radius: 100%;
width: 12px;
height: 12px;
}
.yin-yang:after {
content: "";
position: absolute;
top: 50%;
left: 50%;
background: #298BE2;
border: 18px solid #eee;
border-radius:100%;
width: 12px;
height: 12px;
}
CSS TRANSFORMS
▸ Skew, SkewX(), SkewY()
▸ Scale, ScaleX(), ScaleY()
▸ Rotate
▸ Translate
Tao of CSS
.rectangle2.skew {
transform: skewX(20deg);
margin-left: 21px;
font-size: 2em;
padding: 0.3em;
display: inline-block;
}
.rectangle2.skew:hover {
transform: skewX(-20deg);
}
.scalable .scale:hover {
transform: scale(1.2);
}
Triangles
.heart {
/* by http://nicolasgallagher.com/ */
position: relative;
width: 100px;
height: 90px;
}
Heart
.heart:before, .heart:after {
position: absolute;
content: "";
left: 50px;
top: 0;
width: 50px;
height: 80px;
background: red;
border-radius: 50px 50px 0 0;
transform: rotate(-45deg);
transform-origin: 0 100%;
}
.heart:after {
left: 0;
transform: rotate(45deg);
transform-origin :100% 100%;
}
Rotate
.infinity {
/* by http://nicolasgallagher.com/ */
position: relative;
width: 212px;
height: 100px;
}
Heart
.infinity:before, .infinity:after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 60px;
height: 60px;
border: 20px solid #298BE2;
border-radius: 50px 50px 0 50px;
transform: rotate(-45deg);
}
.infinity:after {
left: auto;
right: 0;
border-radius: 50px 50px 50px 0
transform: rotate(45deg);
}
Rotate
.rotate .yin-yang:hover {
transform: rotate(99deg);
}
.translate .pacman:hover {
transform: translate(50px,
0px);
border-right: 60px solid
#E9E900;
}
CSS TRANSITIONS
.example {
transition: [transition-property] [transition-duration]
[transition-timing-function] [transition-delay];
}
CSS TRANSITIONS
.foo {
transition: background-color 0.5s linear;
}
.drupal {
transition: all 1.5s ease-out;
}
.Plone {
transition: all 1.5s ease-in;
}
http://css3.bradshawenterprises.com/transitions/
CSS TRANSITIONS
ease
linear
ease-in
ease-out
ease-in-out
step-start
step-end
cubic-bezier(0, 0, 0.58, 1);
http://css3.bradshawenterprises.com/transitions/
Thank you!
Rob Porter
Email: rob.porter@wildcardcorp.com
Twitter: @robzonenet
PLEASE USE THE
SURVEY APP TO SEND
US FEEDBACK.
HELP US IMPROVE!
ploneconf.sixfeetup.com

More Related Content

PDF
響應式網頁實作坊
PDF
12.string and pointer
PDF
Simple flat ui css accordion
TXT
Css3 process bar
TXT
PYTHON PROGRAMS FOR BEGINNERS
PDF
키보드 키와 기호 이름 알아보기
PDF
PDF
Getting Things Done with Content Rules
響應式網頁實作坊
12.string and pointer
Simple flat ui css accordion
Css3 process bar
PYTHON PROGRAMS FOR BEGINNERS
키보드 키와 기호 이름 알아보기
Getting Things Done with Content Rules

Similar to Tao of CSS (20)

DOCX
Week ThreeExpress Holidayscssstyle.csshtml{ height 100.docx
PDF
Making Links Magical Again with CSS
DOCX
cssblocks.css.b_page{ width 930px; margin 0 auto; position.docx
TXT
Theme 23
KEY
Sass, Compass
PPT
Learn to love CSS3 | Joomla! Day Deutschland
PPT
Learn to Love CSS3 [English]
TXT
Yeni metin belgesi (2)
PDF
HTML&CSS 5 - Intermediate CSS (2/2)
PDF
Harendra Singh,BCA Third Year
PPTX
Css rounded corners
DOCX
Bloggdesign #2 - hawaa.blogg.no
TXT
Corilennyg gmail-com-rsp2
TXT
Formato encuesta
TXT
This is a test
PDF
PDF
DOCX
Week ThreeExpress Holidayscssstyle.csshtml{ height 100.docx
Making Links Magical Again with CSS
cssblocks.css.b_page{ width 930px; margin 0 auto; position.docx
Theme 23
Sass, Compass
Learn to love CSS3 | Joomla! Day Deutschland
Learn to Love CSS3 [English]
Yeni metin belgesi (2)
HTML&CSS 5 - Intermediate CSS (2/2)
Harendra Singh,BCA Third Year
Css rounded corners
Bloggdesign #2 - hawaa.blogg.no
Corilennyg gmail-com-rsp2
Formato encuesta
This is a test
Ad

Recently uploaded (20)

PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Mushroom cultivation and it's methods.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Encapsulation theory and applications.pdf
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
project resource management chapter-09.pdf
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
Web App vs Mobile App What Should You Build First.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Mushroom cultivation and it's methods.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
A comparative study of natural language inference in Swahili using monolingua...
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
cloud_computing_Infrastucture_as_cloud_p
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Encapsulation theory and applications.pdf
Accuracy of neural networks in brain wave diagnosis of schizophrenia
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Programs and apps: productivity, graphics, security and other tools
Hindi spoken digit analysis for native and non-native speakers
Building Integrated photovoltaic BIPV_UPV.pdf
Unlocking AI with Model Context Protocol (MCP)
DP Operators-handbook-extract for the Mautical Institute
1 - Historical Antecedents, Social Consideration.pdf
project resource management chapter-09.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf
Assigned Numbers - 2025 - Bluetooth® Document
Ad

Tao of CSS