73
73
< h3 class ="f6 ttu tracked mt0 "> Vertical Align</ h3 >
74
74
< p class ="measure f4 f3-ns lh-copy ">
75
75
Use vertical align to set typography just right. Vertical align
76
- works on text and on table cells.
76
+ works on inline-level elements (display inline and inline-block) and on table cells.
77
77
</ p >
78
78
< p class ="measure f5 f4-ns lh-copy ">
79
79
This documents how vertical align affects text elements. If you'd
@@ -82,54 +82,127 @@ <h3 class="f6 ttu tracked mt0">Vertical Align</h3>
82
82
</ article >
83
83
< div class ="ph3 ph5-ns pt4 pb5 ">
84
84
< h3 class ="f5 mb4 pb2 bb "> Examples</ h3 >
85
- < h3 class ="f5 book sans-serif pt4 caps "> Inline Alignment</ h3 >
86
- < p class ="f4 measure ">
87
- Lorem ipsum dolor sit amet, consetetur sadipscing
88
- < span class ="v-sub bg-lightest-red "> Sub aligned text (v-sub)</ span >
89
- elitr, sed diam nonumy eirmod
90
- tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
91
- < span class ="v-sup bg-lightest-red "> Super aligned text (v-sup)</ span >
92
- vero eos et accusam et justo duo dolores et ea rebum.
93
- </ p >
94
- < h3 class ="f5 book sans-serif pt4 caps "> Table Alignment</ h3 >
85
+ < h3 class ="f5 mt4 "> Table Alignment</ h3 >
86
+ < p class ="measure lh-copy "> You can use vertical alignment classes on either td elements or on elements with a class of < code > dtc</ code > that are direct
87
+ children of an element with a class of < code > dt</ code > .
95
88
< table border ="0 " cellspacing ="8 " cellpadding ="8 ">
96
89
< tr >
97
- < td >
98
- .v-mid
99
- </ td >
100
- < td class ="measure bg-black-10 ">
101
- Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
102
- tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
90
+ < td class ="measure bg-light-red ">
91
+ < img width ="128 " src ="http://mrmrs.io/images/0001.jpg ">
103
92
</ td >
104
- < td class ="v-mid bg-black-05 ">
105
- Aligned to middle
93
+ < td class ="v-mid bg-black-025 ">
94
+ < code class ="db f6 "> .v-mid</ code >
95
+ Align text to the middle.
106
96
</ td >
107
97
</ tr >
108
98
< tr class ="bt b--white bw3 ">
109
- < td >
110
- .v-top
111
- </ td >
112
- < td class ="measure bg-black-10 ">
113
- Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
114
- tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
99
+ < td class ="bg-light-red ">
100
+ < img width ="128 " src ="http://mrmrs.io/images/0002.jpg ">
115
101
</ td >
116
- < td class ="v-top bg-black-05 ">
117
- Aligned to top
102
+ < td class ="v-top bg-black-025 ">
103
+ < code class ="db f6 "> .v-top</ code >
104
+ Align text to the top.
118
105
</ td >
119
106
</ tr >
120
107
< tr class ="bt b--white bw3 ">
121
- < td >
122
- .v-btm
108
+ < td class =" measure bg-light-red " >
109
+ < img width =" 128 " src =" http://mrmrs.io/images/0005.jpg " >
123
110
</ td >
124
- < td class ="measure bg-black-10 ">
125
- Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
126
- tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
127
- </ td >
128
- < td class ="v-btm bg-black-05 ">
129
- Aligned to Bottom
111
+ < td class ="v-btm bg-black-025 ">
112
+ < code class ="db f6 "> .v-btm</ code >
113
+ Align text to the middle.
130
114
</ td >
131
115
</ tr >
132
116
</ table >
117
+ < h3 class ="f5 mt5 "> Inline-block Alignment</ h3 >
118
+ < h4 class ="f6 mt4 "> Align to the top</ h4 >
119
+ < code class ="f6 pre db ">
120
+ <p class="dib v-top">Content</p>
121
+ <p class="dib v-top">Content</p>
122
+ <p class="dib v-top">Content</p>
123
+ </ code >
124
+ < div class ="pl4-l bl-l bw2-l b--black-10 mt4 ">
125
+ < p class ="f6 measure-narrow dib v-top mr4 outline ">
126
+ You can say, "I love you," in Helvetica. And you can say it with Helvetica
127
+ Extra Light if you want to be really fancy. Or you can say it with the Extra
128
+ Bold if it's really intensive and passionate, you know, and it might work.
129
+ </ p >
130
+ < p class ="f6 measure-narrow dib v-top mr4 outline ">
131
+ You can say, "I love you," in Helvetica. And you can say it with Helvetica
132
+ Extra Light...
133
+ </ p >
134
+ < p class ="f6 measure-narrow dib v-top outline ">
135
+ if you want to be really fancy. Or you can say it with the Extra
136
+ Bold if it's really intensive and passionate, you know, and it might work.
137
+ </ p >
138
+ </ div >
139
+ < h4 class ="f6 mt5 "> Mix and match</ h4 >
140
+ < code class ="f6 pre db ">
141
+ <p class="dib v-top">Content</p>
142
+ <p class="dib v-btm">Content</p>
143
+ <p class="dib v-top">Content</p>
144
+ </ code >
145
+ < div class ="pl4-l bl-l bw2-l b--black-10 mt4 ">
146
+ < p class ="f6 measure-narrow dib v-top mr4 outline ">
147
+ You can say, "I love you," in Helvetica. And you can say it with Helvetica
148
+ Extra Light if you want to be really fancy. Or you can say it with the Extra
149
+ Bold if it's really intensive and passionate, you know, and it might work.
150
+ </ p >
151
+ < p class ="f6 measure-narrow dib v-btm mr4 outline ">
152
+ You can say, "I love you," in Helvetica. And you can say it with Helvetica
153
+ Extra Light...
154
+ </ p >
155
+ < p class ="f6 measure-narrow dib v-top outline ">
156
+ if you want to be really fancy. Or you can say it with the Extra
157
+ Bold if it's really intensive and passionate, you know, and it might work.
158
+ </ p >
159
+ </ div >
160
+ < h4 class ="f6 mt5 "> Align to the middle</ h4 >
161
+ < code class ="f6 pre db ">
162
+ <p class="dib v-mid">Content</p>
163
+ <p class="dib v-mid">Content</p>
164
+ <p class="dib v-mid">Content</p>
165
+ </ code >
166
+ < div class ="pl4-l bl-l bw2-l b--black-10 mt4 ">
167
+ < p class ="f6 measure-narrow dib v-mid mr4 outline ">
168
+ You can say, "I love you," in Helvetica. And you can say it with Helvetica
169
+ Extra Light if you want to be really fancy. Or you can say it with the Extra
170
+ Bold if it's really intensive and passionate, you know, and it might work.
171
+ </ p >
172
+ < p class ="f6 measure-narrow dib v-mid mr4 outline ">
173
+ You can say, "I love you," in Helvetica. And you can say it with Helvetica
174
+ Extra Light...
175
+ </ p >
176
+ < p class ="f6 measure-narrow dib v-mid outline ">
177
+ if you want to be really fancy.
178
+ </ p >
179
+ </ div >
180
+ < h4 class ="f6 mt5 "> Align to the bottom</ h4 >
181
+ < code class ="f6 pre db ">
182
+ <p class="dib v-btm">Content</p>
183
+ <p class="dib v-btm">Content</p>
184
+ <p class="dib v-btm">Content</p>
185
+ </ code >
186
+ < div class ="pl4-l bl-l bw2-l b--black-10 mt4 ">
187
+ < p class ="f6 measure-narrow dib v-btm mr4 outline ">
188
+ You can say, "I love you," in Helvetica. And you can say it with Helvetica
189
+ Extra Light if you want to be really fancy. Or you can say it with the Extra
190
+ Bold if it's really intensive and passionate, you know, and it might work.
191
+ </ p >
192
+ < p class ="f6 measure-narrow dib v-btm mr4 outline ">
193
+ You can say, "I love you," in Helvetica. And you can say it with Helvetica
194
+ Extra Light...
195
+ </ p >
196
+ < p class ="f6 measure-narrow dib v-btm outline ">
197
+ if you want to be really fancy.
198
+ </ p >
199
+ </ div >
200
+
201
+
202
+
203
+
204
+
205
+
133
206
< div class ="mt5 cf ">
134
207
< div class ="dib mr4 ">
135
208
< h4 class ="f6 fw6 "> Previous</ h4 >
@@ -145,7 +218,7 @@ <h4 class="f6 fw6">Reference</h4>
145
218
< a href ="https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align " class ="link fw6 blue dim "> MDN - Vertical Align</ a >
146
219
</ div >
147
220
</ div >
148
- < section class ="bg-white black-70 bt bb b--black-40 pt4 pb5 overflow-container ">
221
+ < section class ="bg-white black-70 bt bb b--black-40 pt4 pb5 overflow-container mb5 ">
149
222
< header class ="ph3 ph5-ns pt4 ">
150
223
< h4 class ="f4 mv0 fw6 dib mr4 "> tachyons-vertical-align</ h4 >
151
224
< span class ="f4 b dib pl0 ml0 mr4 "> v4.0.1</ span >
0 commit comments