簡體   English   中英

div中的垂直對齊元素

[英]Vertical-align element in div

我有一個div與CSS:

.row
{
width: 100%;
margin-bottom: 3px;
padding: 5px;
border-radius: 7px;
background-color: #F3F3F3;
text-align: right;
min-height: 20px;
}

並為span使用樣式:

  .rowtitle
{
display: inline-block;
border-radius: 5px;
background-color: white;
padding: 3px;
margin-left: 5px;
width: 55px;
}

在html中,我使用它。

   <div class="row" style="vertical-align:top">
    <span class="rowtitle" style="width:85px">جنسیت  </span>
       <asp:RadioButtonList ID="jensiatRadioButtonList" runat="server" RepeatDirection="Horizontal" >
         <asp:ListItem Selected="True" Value="1">مرد</asp:ListItem>
         <asp:ListItem Value="0">زن</asp:ListItem>
       </asp:RadioButtonList>
   </div>

但是當我的控件寬度很大時,將其設置為div的底部。

當我使用單選按鈕時,它會設置div的botton。

我想將元素設置為div的頂部。

在此處輸入圖片說明

在.rowtitle中添加float:right;clear:both

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM