텍스트,그림,수평,수직 가운데
12136 단어 수직 으로 가운데
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<
html
xmlns
="http://www.w3.org/1999/xhtml"
>
<
head
>
<
meta
http-equiv
="Content-Type"
content
="text/html; charset=gb2312"
/>
<
title
>
</
title
>
<
style
type
="text/css"
>
.wrap
{
text-align
:
center
;
width
:
500px
;
height
:
500px
;
background-color
:
#0F9
;
vertical-align
:
middle
;
display
:
table-cell
;
/*
IE6
*/
position
:
relative
;
}
.wrap2
{
*position
:
absolute
;
*top
:
50%
;
*left
:
50%
}
.con
{
width
:
270px
;
*position
:
relative
;
*top
:
-50%
;
*left
:
-50%
;
border
:
1px solid #000
;
display
:
inline-block
;
}
img
{
/*
DIV IE6 , BUG 3 vertical-align:bottom font-size:0
*/
display
:
block
;
}
</
style
>
</
head
>
<
body
>
<
div
class
="wrap"
>
<
div
class
="wrap2"
>
<
div
class
="con"
>
<
a
href
="#"
>
</
a
><
img
src
="http://www.baidu.com/img/baidu_logo.gif"
/></
div
>
</
div
>
</
div
>