-1
 <asp:Menu ID="Menu1" runat="server" DynamicHorizontalOffset="2" ForeColor="Blue"
                    StaticSubMenuIndent="10px" Style="font-size: medium; margin-left: 25px; margin-top: 0px;
                    margin-bottom: 0px; color: #333333; text-align: left;" Width="180px" BorderStyle="None"
                    SkipLinkText="" Height="358px">
                    <StaticMenuStyle BorderStyle="None" />
                    <StaticSelectedStyle BackColor="#5D7B9D" />
                    <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" BorderStyle="Solid"
                        BorderColor="White" BorderWidth="1px" />
                    <DynamicHoverStyle BackColor="#5E2433" ForeColor="White" />
                    <DynamicMenuStyle BorderColor="#666666" Width="130px" BackColor="#EFEDED" />
                    <DynamicSelectedStyle BackColor="#5D7B9D" />
                    <DynamicMenuItemStyle Width="130px" BorderColor="White" BorderStyle="Solid" BorderWidth="1px"
                        HorizontalPadding="5px" VerticalPadding="2px" />
                    <StaticHoverStyle BackColor="#5E2433" ForeColor="White" />
                    <Items>
                        <asp:MenuItem Text="Register New Patient" Value="Register New Patient" NavigateUrl="DoctorNewRegisteration.aspx">
                        </asp:MenuItem>
                        <asp:MenuItem Text="Wait List" Value="Wait List" NavigateUrl="DoctorWaitList.aspx">
                        </asp:MenuItem>
                        <asp:MenuItem Text="Appointments" Value="Appointments" 
                            NavigateUrl="DoctorAppointments.aspx"></asp:MenuItem>
                        <asp:MenuItem NavigateUrl="DoctorCheckup.aspx" Text="Patient Visit" Value="Patient Visit">
                        </asp:MenuItem>
                        <asp:MenuItem Text="Add/Delete Vaccine" Value="Add/Delete Vaccine" NavigateUrl="DoctorNewVaccine.aspx">
                        </asp:MenuItem>
                        <asp:MenuItem Text="Vaccination Schedule" Value="Vaccination Schedule" NavigateUrl="DoctorVacSchedule.aspx">
                        </asp:MenuItem>
                        <asp:MenuItem Text="Vaccination Due List" Value="Vaccination Due List" NavigateUrl="DoctorVacDueList.aspx">
                        </asp:MenuItem>
                        <asp:MenuItem Text="My Profile" Value="My Profile" NavigateUrl="DoctorMyProfile.aspx">
                        </asp:MenuItem>
                        <asp:MenuItem Text="Announcements" Value="Announcements" NavigateUrl="DoctorAnnouncements.aspx">
                        </asp:MenuItem>
                        <asp:MenuItem Text="Reference Documents" Value="Reference Documents" NavigateUrl="DoctorUploadDoc.aspx">
                        </asp:MenuItem>
                        <asp:MenuItem Text="Message To Patients" Value="Message To Patients" NavigateUrl="DoctorMessage.aspx">
                        </asp:MenuItem>
                        <asp:MenuItem Text="Inactive List" Value="Inactive List" 
                            NavigateUrl="DoctorInactiveList.aspx">
                        </asp:MenuItem>
                        <asp:MenuItem NavigateUrl="DoctorBirthList.aspx" Text="Birthday List" 
                            Value="Birthday List"></asp:MenuItem>
                        <asp:MenuItem Text="Change Password" Value="Change Password" NavigateUrl="DoctorChangePassword.aspx">
                        </asp:MenuItem>
                        <asp:MenuItem NavigateUrl="DoctorMenuPage.aspx" Text="Home" Value="Home"></asp:MenuItem>
                        <asp:MenuItem Text="Logout" Value="Logout"></asp:MenuItem>
                    </Items>
                </asp:Menu>

我如何在右上角水平对齐这个 asp.net 菜单,现在它在左侧垂直对齐。

如果我使用 css 或更改 Asp.net 菜单的某些属性,请帮助

4

1 回答 1

3

菜单控件有一个设置orientation="Horizontal",或者您可以手动将其添加到属性中

--EDIT 当您将方向更改为水平时,您必须确保菜单适合该方向的给定宽度。您已将宽度设置为 180 像素,如果您删除菜单会自动水平定向

<asp:Menu ID="Menu1" runat="server" DynamicHorizontalOffset="2" ForeColor="Blue"
                    StaticSubMenuIndent="10px" Style="font-size: medium; margin-left: 25px; margin-top: 0px;
                    margin-bottom: 0px; color: #333333; text-align: left;"  BorderStyle="None"
                    SkipLinkText="" Height="358px" orientation="Horizontal">
于 2012-09-13T07:01:41.767 回答