我无法定位.menubox div
(红色)...因为我希望它很好地坐在左边.menu div
。相反,它顽固地拒绝从.menu
. 简而言之,我想将这些并排放置,所以我有错,我知道,只要推动正确的方向,将不胜感激。
请参阅我的js fiddle的链接
html:
<div id="parent_container">
<div id='prod_cont'>
<div id="menu">
<ul>
<li><a class="menuitem" href="#smPlates">Product Preview 1</a>
</li>
<li><a class="menuitem" href="#salads">Product Preview 2</a>
</li>
<li><a class="menuitem" href="#burgers">Product Preview 3</a>
</li>
<li><a class="menuitem" href="#desserts">Product Preview 4</a>
</li>
</ul>
</div>
</div>
<!-- P1 -->
<div class="menubox" id="smPlates">
<p>Product Detail 1</p>
</div>
<!-- P2 -->
<div class="menubox" id="salads">
<p>Product Detail 2</p>
</div>
<!-- P3 -->
<div class="menubox" id="burgers">
<p>Product Detail 3</p>
</div>
<!-- P4 -->
<div class="menubox" id="desserts">
<p>Product Detail 4</p>
</div>
</div>
CSS:
#parent_container {
height:700px;
display:block;
background-color:#66CCCC;
border:1px solid #000;
padding:20px;
}
#prod_cont {
width:255px;
height:410px;
background-color:#fff;
padding:10px;
}
.menuitem {
height:100px;
width:250px;
display:block;
background-color:#FFFFE0;
border:1px solid #000;
margin-right:5px;
}
.menubox {
width:30%;
height:260px;
-webkit-border-bottom-right-radius: 25px;
-moz-border-radius-bottomright: 25px;
border-bottom-right-radius: 25px;
-webkit-border-top-left-radius: 25px;
-moz-border-radius-topleft: 25px;
border-top-left-radius: 25px;
text-align:right;
color:#ffffff;
background-color:#FF0000;
border:1px solid #000;
margin-top:0px;
margin-right:10px;
padding:10px;
}
感谢您的解决方案...