2011-06-16 128 views
0

我需要像往常一樣在酒吧的左側有一些標籤,並且2個標籤位於酒吧的右端如何將標籤定位到標籤欄的右側?

我的jsfiddle文件是here

標籤欄必須位於屏幕的底部部分一些點。因此,我必須將其定位爲絕對值。因此,我無法找到標籤相對到酒吧。

我試過float:right但它也沒有工作。

有什麼建議嗎?

回答

0

這是否讓你走在正確的方向:

.tab-box { 
    margin: 0; 
    position: absolute; /*I need to fix these tabs at some point at the bottom part of the screen*/ 
    bottom: 248px; 
    left: 0;  
} 
#complexTab { 
    width:100%; 
} 
.tab-box a { 
    font-family:Helvetica, Arial, sans-serif; 
    border: 1px solid #3A3D42; 
    color: #666666; 
    padding: 5px 5px; 
    background-color: #eee;   
    float:right;  
    -webkit-border-top-left-radius: 4px; 
    -moz-border-top-left-radius: 4px;  
    -webkit-border-top-right-radius: 4px; 
    -moz-border-top-right-radius: 4px; 
    margin: -2px; /*remove space btw tabs*/ 
} 

.tab-box a:first-child { 
    -webkit-border-top-left-radius: 0; 
    -moz-border-top-left-radius: 0; 
} 

.tabcontent { 
    height:248px; 
    margin:0; 
    padding:0; 
    overflow:hidden; 
    border-top:1px solid #3A3D42; 

    background-color:#757D8A; 

    box-shadow:0 1px 0 rgba(255,255,255,.3) inset; 
    -moz-box-shadow:0 1px 0 rgba(255,255,255,.3) inset; 
    -webkit-box-shadow:0 1px 0 rgba(255,255,255,.3) inset; 

    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
} 

.hiden { 
    display : none; 
} 
+0

我想我忘了設置寬度:100%。但是,有一個小問題。當我將2個選項卡向右浮動時,左邊的選項卡上升一點。這使得這些標籤和內容有點小差距。你有什麼想法如何解決它?謝謝, – chepukha 2011-06-16 19:44:20

+0

你可以展示jsFiddle嗎? – 2011-06-16 19:48:16

+0

哎呀。抱歉。 [Here](http://jsfiddle.net/chepukha/jXAZx/15/)它是 – chepukha 2011-06-16 19:54:40