2013-12-16 29 views
0

我在果园中创建了列表,并且h1标签采用列表的标题。我需要为标题添加一个项目符号。在果园的标题标签中添加子弹

我需要子弹像下面的图片h1标签之前

enter image description here

http://jsfiddle.net/nRq27/1/

<header> 
    <h1>School info</h1> 
    </header> 

我使用的背景:图像属性,但它不显示子弹。我怎样才能得到子弹?

+0

http://fiddle.jshell.net/4wLZ6/5/检查这个小提琴 –

回答

0

尝试:

h1:before { 
    background-image: url(http://www.alexander-bown.com/wp-content/uploads/2011/05/big-black-dot.jpg); 
    background-repeat: no-repeat; 
    background-size: 20px; 
    width: 20px; 
    height: 20px; 
    display: inline-block; 
    content:""; 
    vertical-align: middle; 
} 

Updated fiddle here.

0

添加下面的CSS

h1:before{ 
    content: '\2022'; 
    margin:0 10px 
} 

DEMO

0

HTML

<header> 
    <ul> 
     <li><h1> School Info </h1> </li> 
    </ul> 
</header> 

CSS

li 
{ 
    list-style-type:square; 
    font-size:small; 
} 
h1 
{ 
color: #3E5DA3; 
    font-size: 12px; 
    padding-bottom: 10px; 
    font-weight: bold; 
} 

Fiddle Demo Here