1.
The Question
“ Trying to move toward absolute positioning versus floats for
layout.... I am trying to figure out if [you] have to always use a height
on the wrapper div. If I have text columns that have no specific
”
height it seems everything breaks at that point.
Shane Perran, graphicalwonder.com
ethan marcottESXSW2006www.vertua.com
2.
Absolute Positioning
It’s all about the x and the y (axes, that is)
❖
Treating parts of your document as distinct
❖
“layers”
Use CSS to precisely place them upon a
❖
coordinate grid
Cake, yes? Let’s look at an example.
ethan marcottESXSW2006www.vertua.com
3.
A new “positioning context”
div.photo {
<div class="photo">
position: relative;
<p>Here’s a caption. Yay.</p>
}
<img src="photo.jpg" alt="" />
</div>
p.caption {
position: absolute;
bottom: 9px;
}
ethan marcottESXSW2006www.vertua.com
8.
The basics
img { float: left; }
ethan marcottESXSW2006www.vertua.com
9.
The basics
img { float: right; }
ethan marcottESXSW2006www.vertua.com
10.
Reflow, floats, and you
img { float: left; }
ethan marcottESXSW2006www.vertua.com
11.
Restoring order to the flow
p.clear { clear: left; }
ethan marcottESXSW2006www.vertua.com
12.
Okay, great. Kitty pictures. So?
Floats can provide us with a more flexible
❖
layout model
Clearing allows the components of our
❖
designs to become “context aware”
Let’s view a simple example.
❖
ethan marcottESXSW2006www.vertua.com
13.
Marrying floats and positioning
ethan marcottESXSW2006www.vertua.com
Clipping is a handy way to collect and organize the most important slides from a presentation. You can keep your great finds in clipboards organized around topics.
Be the first to comment