Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
HTML and CSS
Search
João Justo
February 20, 2015
Programming
1
46
HTML and CSS
João Justo
February 20, 2015
Tweet
Share
More Decks by João Justo
See All by João Justo
Real Time gaming with Web RTC
joaojusto
0
35
Other Decks in Programming
See All in Programming
if constexpr文はテンプレート世界のラムダ式である
faithandbrave
3
650
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
210
AWS Application Composerで始める、 サーバーレスなデータ基盤構築 / 20240406-jawsug-hokuriku-shinkansen
kasacchiful
1
260
初心者のためのRubyKaigi入門/RubyKaigi Introduction
a_matsuda
2
860
Blue/Greenデプロイの導入による 運用フローの改善
kudoas
1
380
⼤規模⾔語モデルの拡張(RAG)が 終わったかも知れない件について
nearme_tech
23
15k
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
820
雑に思考を整理する技術と効能
konifar
60
29k
Rethinking UI building strategies @ SFI 2024
letelete
0
270
ONE WEDGE_company_guide
1wedge_one
0
490
VSCodeでのDatabricks開発もお勧めしたい/I would also recommend Databricks development with VSCode.
kazumain
0
260
What We Can Learn From OSS
inouehi
0
420
Featured
See All Featured
The Cult of Friendly URLs
andyhume
74
5.7k
Rails Girls Zürich Keynote
gr2m
91
13k
Being A Developer After 40
akosma
57
580k
What's new in Ruby 2.0
geeforr
337
31k
Optimizing for Happiness
mojombo
370
69k
Optimising Largest Contentful Paint
csswizardry
8
2.4k
GitHub's CSS Performance
jonrohan
1025
450k
10 Git Anti Patterns You Should be Aware of
lemiorhan
648
58k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
322
20k
For a Future-Friendly Web
brad_frost
172
9k
Fontdeck: Realign not Redesign
paulrobertlloyd
76
4.9k
Adopting Sorbet at Scale
ufuk
68
8.6k
Transcript
None
joaojusto jpjustonunes
None
https://github.com/groupbuddies/theshelf
https://github.com/groupbuddies/tripl.it
None
None
None
None
HTML good practices
Never use inline styles
<p style="color: red;">I'm going to make this text red!</p>
<p this text red! .red { color: red; }
Javascript files at the bottom
<p>All right, the use can see the whole page!</p> <script
type="text/javascript" src="file.js"></script> <script type="text/javascript" src=“another_file.js"></script> </body> </html>
Write semantic HTML
<div> <span class="big">Hello World</span> <a href="/home">Home</a> <a href="/link">Link</a> </div> <div
class="main"> <div class="title">Some article</div> </div>
<nav> <h1>Hello World</h1> <a href="/home">Home</a> <a href="/link">Link</a> </nav> <section> <h2>Some
article</h2> </section>
Minify Resources Optimize Images
Make your site accessible
Headings for structure not for style
None
<body> <h1>Page Title</h1> <section> <h1>First Section</h1> <article> <h1>Article title</h1> </article>
</section> </body>
<body> <h1>Page Title</h1> <section> <h2>First Section</h2> <article> <h3>Article title</h3> </article>
</section> </body>
ARIA Landmark Roles
None
blog.groupbuddies.com/posts/50-accessibility-matters
Tricks
How to add style to a checkbox?
http://codepen.io/joaojusto/ pen/emMLar
CSS architecture
Suit CSS SMACSS Atomic
But why?
The ugly
https://github.com/cesium/SEI15
#speakers { text-align: center; background-attachment: scroll; background-image: url(../img/background_events.png); background-position: center
center; background-repeat: none; -webkit-background-size: cover; -moz-background-size: cover; background-size: cover; -o-background-size: cover; height: 100%; padding-bottom: 30px; }
#organization { padding-bottom: 75px; background-attachment: scroll; background-image: url(../img/stuff-dark.png); background-position: center
center; background-repeat: none; -webkit-background-size: cover; -moz-background-size: cover; background-size: cover; -o-background-size: cover; }
stuff-dark.png background_events.png
The bad
.container { text-align: center; background-attachment: scroll; background-image: url(../img/background_events.png); background-position: center
center; background-repeat: none; -webkit-background-size: cover; -moz-background-size: cover; background-size: cover; -o-background-size: cover; height: 100%; }
.container-speakers { padding-bottom: 30px; } <section class=“container container-speakers“> .container-organization {
padding-bottom: 75px; } <section class=“container container-organization“>
None
joaojusto jpjustonunes Thanks