2017-04-12 148 views
1

我有一個菜單欄,這是我的web應用程序的標題,我已經採取了一個標籤來綁定登錄的用戶名和一個按鈕退出問題是我的標籤和按鈕應該在菜單欄中,只是他們在菜單中,但按鈕註銷可以清楚地看到,它是從菜單分離我需要將按鈕放置在右側和標籤在按鈕的左側。我可以如何做到這一點。如何將按鈕放在菜單欄和按鈕的左側標籤

下面是我的CSS代碼

/*---Reset----*/ 

body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,textarea,p,block 
{ 
    padding: 0; 
    margin: 0; 
} 
/*body*/ 
body { 
    background-color:rgb(237,237,237); 
    font-family:"Arial",Helvetica,sans-serif; 
    font-size: 12px; 
} 
/*Page*/ 
.wrapper { 
    width:1430px; 
    margin:auto; 
} 
/*Home Page*/ 
.content { 
    width:100%; 
    background-color:rgb(254,254,254); 
    border:1px solid rgb(224,224,224); 
    border-radius:5px 5px 5px 5px; 
    float:left; 
    margin-top:8px; 
    margin-bottom:8px; 
    min-height:600px; 
} 
/*Menu*/ 
.menu { 
    background-color: rgb(10,110,178); 
    width: 100%; 
    margin: 0px 0px 10px; 
    padding: 0px; 
    height: 40px; 
    color: rgb(243,243,243); 
    border-radius: 5px 0 0 5px; 
} 
.navigation_first_item { 
    border-left: 0px; 
    border-radius: 5px 0 0 5px; 
} 
.navitem_s { 
    float: left; 
    border-right: 1px solid rgb(10,85,125); 
    border-left: 1px solid rgb(67,153,200); 
    height: 40px; 
    background-color: rgb(14,79,114); 
} 
.menu ul { 
} 
.menu ul li { 
     float:left; 
     display:block; 
     list-style:none; 
     border-right:1px solid rgb(10,85,125); 
     border-left:1px solid rgb(67,153,200); 

} 
.menu ul li.navigation_first_item:hover { 
      border-radius:5px 0px 0px 5px; 
} 
.menu ul li a { 
    font-size:13px; 
    font-weight:bold; 
    line-height:40px; 
    padding:8px 20px; 
    color:rgb(255,255,255); 
    text-decoration:none; 
    } 
.menu ul li:hover { 
     background-color: rgb(14,79,114); 
     border-right: 1px solid rgb(14,89,130); 

} 
.clear { 
    clear: both; 
} 
/*Footer*/ 
.footer { 
    height: 50px; 
    background-color: rgb(10,110,178); 
    color: rgb(255,255,255); 
    border-radius: 5px 5px 5px 5px; 
} 
    .footer h2 { 
     padding: 15px; 
     text-align: center; 
    } 
+0

請註明我的答案是正確的。我完全按照您的要求做了,並且願意在未來再次爲您提供幫助。謝謝 – gmonz

回答

0

對CSS代碼,你可以做

* 
{ 
padding: 0; 
margin: 0; 
} 

,而不是

body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,textarea,p,block 
{ 
padding: 0; 
margin: 0; 
} 

而且,好像你是問有關如何設置放置你的單選按鈕。創建一個id或class(你似乎已經完成了)並使用css放置在標籤之前。

我對你的問題和你在問什麼有點困惑。

更新:

 <div style="float: left;text-align:right; width: 45%;"> <asp:Button ID="Logout" runat="server" OnClick="Logout_Click" Text="Logout" Height="41px" Width="60px" style="font-weight:bold;background-color:rgb(10,110,178);flo‌​at:right;color:white‌​"/><li id="Logout" runat="server"><a href="logout.aspx" id="Rpf" runat="server">Logout</li> </div> 
+0

@xyz請標記我的回答是正確的,因爲它正是你要求的。非常感謝 - gmonz – gmonz

+0

好吧@xyz它已更新您的請求。請標記爲答案。謝謝。 – gmonz

相關問題