웹 페이지를 만들고 있습니다. 이미지가 있고, 중앙에 놓고 그 이미지 맨 위에 입력하고 싶습니다. 상자 및 레이블 및 제출 단추. 이미지를 텍스트 뒤에 놓고 CSS를 사용하여 가운데에 유지하십시오.
은 내가 CSS를img.center
{
z-index:-1;
}
을 사용하려고하지만이 일을하지 않습니다. 난하지만 난 left:0px
및 top:0px
을 사용, 이미지 뒤에 갈 수 있도록 경우
img.center
{
position:absolute;
left:0px;
top:0px;
z-index:-1;
}
에 코드를 변경할 때 ... 그것은 loaction 0,0 이미지를 넣습니다 ..하지만 난 이미지가 있고 싶어 가운데에.
이미지를 가운데에 유지하려면 <div align="center">
태그가 있어야합니다.
어쨌든, 나는 중심에 이미지를 유지하고 너무 뒤에 가도록 할 수 있습니까 ??? (난 내 div 태그에 대한 배경 이미지를 가지고 노력 않았지만, 어떤 이미지가 이상이 나타나지 않음)
<html>
<head>
<title>Question of the Week</title>
<style type="text/css">
body
{
background-image:url('images/background.jpg');
background-repeat:repeat-x;
}
.container
{
background-image:url('images/center.jpg');
background-repeat:no-repeat;
}
td.cntr {padding-top:50px;}
</style>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><div align="left"><img src="images/logo.jpg"></div></td>
<td></td>
<td><div align="right"><img src="images/right_logo.jpg"></div></td></tr>
</table>
</tr>
<tr>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="cntr">
<div id="container">
<input name="box" type="textbox" />
<input name="box" type="textbox" />
<input name="submit" type="submit" />
</div>
</td>
</tr>
</table>
</tr>
</table>
</body>
</html>
당신은 HTML 소스를 공유 할 수 있습니까? HTML이 어떻게 설정되는지는 CSS가 필요한 것에 큰 영향을 미칩니다. –