現在のプロジェクトでは、CSS に関する深刻なヘルプが必要です。ページをどのように表示したいかのスクリーンショットを添付しました。私が抱えている問題は、divを互いに適切に配置することと、幅/高さをページの100%に維持することです。Javascriptを使わずにこれをやりたいです。これは私のHTMLです:
<body>
<div class="wrapper">
<div class="container_24">
<div class="grid_16">
<input type="text" value="Username" /><input type="text" value="Password" /><input type="button" value="Submit" /><span class="mainLink">Register</span>
</div>
</div>
<div class="container_16">
<form id="form1" runat="server">
<asp:ContentPlaceHolder ID="Body" runat="server">
</asp:ContentPlaceHolder>
</form>
</div>
<div class="container_24"></div>
</div>
</body>
これは私のCSSです:
.wrapper{
min-height: 100%;
min-width: 100%;
/* Set up proportionate scaling */
width: 100%;
height: auto;
/* Set up positioning */
position: fixed;
top: 0;
left: 0;
}
.container_16 {
margin-left: auto;
margin-right: auto;
width: 960px;
min-height: 100%;
/* Set up proportionate scaling */
height: auto;
margin-top:0px;
padding-top:0px;
background-image:url(../images/Content_bkg.gif);
box-shadow: 0px 0px 15px rgb(0,0,0);
-webkit-box-shadow: 0px 0px 15px rgb(0,0,0);
}
.container_24 {
background-image: url(../images/headerFooter_bkg.gif);
height: 60px;
margin: 0px;
padding: 0px;
border: 1px solid rgb(71, 89, 32);
box-shadow: 0px 0px 15px rgb(0,0,0);
-webkit-box-shadow: 0px 0px 15px rgb(0,0,0);
position:relative;
width:100%;
}
私がどのように見せたいかの画像(ブラウザウィンドウ全体にまたがる):
実際: