Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Frontend 102
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Sebastiaan Deckers
April 15, 2013
Programming
540
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Frontend 102
Sebastiaan Deckers
April 15, 2013
Transcript
13 slides
102 Layout Box model Content flow Positioning Weirdness
box model
box model content box < padding box < border box
< margin box
box model clockwise from the top top right bottom left
img { margin: 10px 5px 0px 20px; }
content box determined by text or fixed size p {
font-size: 14pt; line-height: 1.5; font-family: "Helvetica Neue"; } img { width: 300px; height: 150px; }
padding box adds a gap between content and border, makes
it easier to click elements button { padding: 20px; }
border box width, style, color header { border: 8px solid
gold; }
adds a gap between border and other boxes img {
margin: 25px; } margin box
content flow
1. Left to right 2. Top to bottom
Floats: easy to abuse, better to avoid Useful mostly for
images in a blog post Absolute/fixed positioning: Choose the top, right, bottom, or left distance from a container or viewport. Take it out of the flow
positioning X/Y axis: left to right, top to bottom Reference:
static, fixed, relative, absolute
weirdness Negative margin Overlapping z-index Cut off overflow
More Decks by Sebastiaan Deckers
See All by Sebastiaan Deckers
Commons Host: Building a CDN for the rest of the world
sebdeckers
1
180
SVG Reality
sebdeckers
5
200
About Sebastiaan
sebdeckers
0
190
Frontend 100
sebdeckers
1
540
Frontend 101
sebdeckers
4
590
Frontend 103
sebdeckers
2
550
Frontend Testing
sebdeckers
3
380
Grunt: The JavaScript Task Runner
sebdeckers
8
440
Other Decks in Programming
See All in Programming
Growing PicoRuby's Ecosystem on ESP32
yuuu
2
150
はじめてのPLATEAU
nokonoko1203
1
660
Kotlin JVM用に作られたライブラリのKMPを前提とした再設計
jsoizo
0
200
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
220
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
270
Vue.jsで作る空間解析アプリとCapacitorプラグインのData Bridge
hal_spidernight
1
180
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
320
SODA - FACT BOOK(JP)
sodainc
1
40k
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
250
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
190
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
260
どうしても Eloquent でリポジトリパターンをやりたいんだ #phpcon_niigata / phpcon-niigata-2026
shogogg
0
620
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
560
Navigating Team Friction
lara
192
16k
Crafting Experiences
bethany
1
450
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
GraphQLとの向き合い方2022年版
quramy
50
15k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
2
3.9k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
A Soul's Torment
seathinner
9
3.9k