撠文嗆舐雯蝡撣摮銵,詆SS∟身摰甇撣豢靘蝮桀,敶Z敶,脰霈雿輻刻擃撽銝雿喟銝臬蔣,甇斗撠梢閬寡:
4 f( i- Y! O; S# L+ M
3 [# v) s; [) s) z* [, J" ? ?; r$ T- 甇撣豢靘蝮桀
" t6 d' A M; A! p) G' t7 t , Y1 k6 u; F1 j
- img {
8 s/ P" G; n* i4 I - max-height:200px; /*甇方隞交憭折摨衣箔*/
! P0 K& x3 r+ B4 j1 ?/ u" | - width:inherit;/ |$ {) q- q0 j9 x* P4 }
- height:expression(document.body.clientHeight>200?"200px""auto");/*亙擃200px撠梯矽*/
* B. x' N, v7 f. ? - overflow:hidden; /*頞銝憿舐內*/
/ D& @' f' _& j( u9 p5 L7 ` - }
銴鋆賭誨蝣 3 [8 @- e4 `' a$ ^7 j0 t2 q
- 瘞游像渡蔭銝2 A! q$ y' M" X' Y$ G
5 r% W) [ ?$ q# S- H
敺憭寞,雿桀箸迫雿輻 Flexbox寞舀蝪∪桃孵
( m0 _% t" f: P, O# Z摰銋質鋆⊿Y芷拇憭X
: i$ x+ o# m5 C函寞敺蝪∪殷芾冽憭撅文蝢拙末隤瘜撠梯賭蝙
; \% d3 z1 F7 q- F) l2 a0 j" ]: [. n; `' o, D9 r# P% T
html隤瘜
4 Q1 y0 ~. ^; a4 q, X$ j# M6 _' t- <div class="exam">0 }7 T% v# T5 I F* N' b) d
- <img src="頝臬">9 i9 }" a" V" _0 g# F
- </div>
銴鋆賭誨蝣 css隤瘜
1 p. d& f# X' ^9 S/ j$ ]3 v- .exam{
& ]8 h% ]) _9 U3 X4 ~ - width: 150px;6 w* c" N* k! Q% z" s* @6 L
- height: 150px;0 t' i- f$ _) n, R0 f
- max-width: 100%;) u7 [, y8 c8 L; g: a% u
- background-color: #eb9700;
& g w: |( }( X2 W J( N" G4 ?0 Y - display: flex;% S R, N) k ?+ z$ t
- align-items: center; /*渡蔭銝*/
4 F6 s; y M0 A6 @6 \3 J - justify-content: center; /*瘞游像蝵桐葉*/0 j; w9 Z9 O5 D4 W+ |2 A6 F! H! N
- }
銴鋆賭誨蝣 |
|