2013-12-09 26 views
0

我想在我的網頁中實現用戶配置文件狀態欄。爲此,我做了以下:在CSS中的用戶配置文件狀態

<ul style="width:250px;background-color:#F5F5F5;"> 
    <li style="width: 20%;background-color:#abb230;"/> 
</ul> 

對於這個代碼我得到下面的結果:

enter image description here

所以在這裏我想刪除子彈的綠色欄的左側,並讓綠色條向左沖洗。

我也試着這樣做:

<ul style="width:250px;background-color:#F5F5F5;list-style:none;"> 
    <li style="width: 20%;background-color:#abb230;"/> 
</ul> 

但是,這使得整個<ul>元素消失。

回答

4

嘗試:

ul { 
    width: 250px; 
    background-color: #F5F5F5; 
    list-style-type: none; 
    padding: 0; 
} 
li { 
    width: 20%; 
    background-color: #abb230; 
    height: 20px; 
} 

DEMO here.

+0

這個偉大的工程! thanx很多 –

+0

@Shabarinath歡迎:) – Hiral

1
ul 
{ 
    list-style-type: none; 
    list-style-position:inside; 
    margin:0; 
    padding:0; 
} 

這將幫助你

+1

我都試過,但它不工作,這樣做整個UL被消失 –

1

對 「UL」 下面的造型。

list-style:none; 

快速指針。避免太多內聯樣式。從結構上單獨介紹邏輯