gpt4 book ai didi

asp.net - 无法对齐 div

转载 作者:太空宇宙 更新时间:2023-11-04 15:42:11 25 4
gpt4 key购买 nike

我无法水平对齐两个 div

这是我的 aspx 母版页中的 html;

           <div class="hdrimg">
</div>
<div class="rightofhdrimg">
<asp:ContentPlaceHolder ID="HeaderRight" runat="server"> </asp:ContentPlaceHolder>
</div>

这是 CSS(我使用的是 CSS3);

.hdrimg
{
width: 680px;
margin-left: 8px;
height: 130px;
background-color: White;
background-image: url('Images/Banner/WebsiteHeader8.13.2012.jpg');
background-repeat: no-repeat;
background-size: 100%;
-moz-border-radius-bottomleft: 1em;
-webkit-border-bottom-left-radius: 1em;
border-bottom-left-radius: 1em;
-moz-border-radius-bottomright: 1em;
-webkit-border-bottom-right-radius: 1em;
border-bottom-right-radius: 1em;

.rightofhdrimg
{
float: right;
display: inline-block;
background-color: #008000 ;
height: 190px;
width:240px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;

标题图像右侧的 div 应该是一个绿色背景矩形,但它的顶部边缘是标题图像的底部边缘。

最佳答案

您可以将第一个 div 向左浮动,并假设有足够的宽度来容纳它们,它们应该在顶部对齐。

http://jsfiddle.net/Z93dM/

关于asp.net - 无法对齐 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12020674/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com