2015-01-21 84 views
0
<p style="text-align:left"> 
         View Map <br /> 
         <asp:DropDownList ID="ddlViewMapGroupName" runat="server"></asp:DropDownList> 
         </p>  

         <p style="text-align:left"> 
         Edit Map <br /> 
         <asp:DropDownList ID="ddlEditMapGroupName" runat="server"></asp:DropDownList> 
         </p> 

         <p style="text-align:left"> 
         Publish Map <br /> 
         <asp:DropDownList ID="ddlPublishMapGroupName" runat="server"></asp:DropDownList> 
         </p> 

顯示:改變排列爲水平

View Map 
//DDList 

Edit Map 
//DDList 

Publish Map 
//DDList 

我想看起來像:

View Map Edit Map Publish Map 
//DDList //DDList //DDList 

是它像汽車?不知道任何幫助表示讚賞。 ta

回答

0

您不希望將項目包裹在段落標記中以構建它們,因爲名稱暗示它們用於包裝段落,並且這些段落沒有水平格式。

相反,你會更適合使用列表,這使您可以輕鬆地將格式從垂直更改爲水平。

所以,你的HTML是:

<ul id="navlist"> 
    <li> 
     <asp:DropDownList ID="ddlViewMapGroupName" runat="server">/asp:DropDownList> 
    </li> 
    <li> 
    <asp:DropDownList ID="ddlEditMapGroupName" runat="server"></asp:DropDownList> 
    </li> 
    <li> 
    <asp:DropDownList ID="ddlPublishMapGroupName" runat="server"></asp:DropDownList> 
    </li> 
    </ul> 

和你的CSS是:

#navlist li 
{ 
display: inline; 
list-style-type: none; 
padding-right: 10px; 
} 

中發揮主要的事情在這裏是:

display: inline; 
list-style-type: none; 
0

這是不是自動。但你可以寫一個很好的舊錶並添加它:

<table> 
    <tr> 
    <td> 
     <asp:DropDownList ID="ddlViewMapGroupName" runat="server"></asp:DropDownList> 
    </td> 
    <td> 
     <asp:DropDownList ID="ddlEditMapGroupName" runat="server"></asp:DropDownList> 
    </td> 
    <td> 
     <asp:DropDownList ID="ddlPublishMapGroupName" runat="server"></asp:DropDownList> 
    </td> 
    </tr> 
    <tr> 
    <td> 
     View Map 
    </td> 
    <td> 
     Edit Map 
    </td> 
    <td> 
     Publish Map 
    </td> 
    </tr> 
</table>