2013-04-20 39 views
0

我厭倦了試圖以水平方式保持菜單(家庭,照片,繪畫)。這些鏈接像第一個家庭一樣以垂直方式出現,然後是照片和繪畫。我不想要這些垂直方式。我想保持它在horizo​​ntal.Please幫我如何以水平方式保持菜單鏈接

<style> 
body{background:black} 
li a{ 
    white-space: nowrap; 
    color: transparent; 
    display: block; 
    text-transform: uppercase; 
    text-align: center; 
    text-shadow: 0px 0px 0px #fff; 
    letter-spacing: 1px; 
    -moz-transform: scale(0.5); 
    -ms-transform: scale(0.5); 
    -o-transform: scale(0.5); 
    -webkit-transform: scale(0.5); 
    transform: scale(0.5); 
    -webkit-transition: all 0.6s linear; 
    -moz-transition: all 0.6s linear; 
    -o-transition: all 0.6s linear; 
    -ms-transition: all 0.6s linear; 
    transition: all 0.6s linear; text-decoration:none 
} 
li a:hover{ 
    text-shadow: 0px 0px 1px #fff; 
    -moz-transform: scale(1); 
    -ms-transform: scale(1); 
    -o-transform: scale(1); 
    -webkit-transform: scale(1); 
    transform: scale(1); 
    text-decoration:none 
} 
li a:hover:before{content:"<"} 
li a:hover:after{content:">"} 

</style> 
<ul> 
    <li><a href="#">Home</a></li> 
    <li><a href="#">Photos</a></li> 
    <li><a href="#">Paintings</a></li> 
</ul> 
+0

「我褪去了」 :DDD – Virus721 2013-04-20 11:40:36

回答

1

使用float CSS屬性

li{ 
float:left; 
} 

jsFiddle Demo

+0

感謝您的答案。我正在使用frameSet,上面的一個是我的菜單。所以菜單內容下來了。你可以保持它的頂部? – JavaCoding 2013-04-20 11:45:02

+0

即使我想寫在右上角的東西,然後也沒有working.i想要保持左邊的菜單和一些東西在右邊 – JavaCoding 2013-04-20 12:22:00

+0

@JavaCoding你可以請更新你的問題的小提琴嗎? – 2013-04-20 12:25:44

0

您還可以使用

li{ 
    display:inline-block; 
}