2011-12-06 32 views
0

我有CSS这个JQMobile - 造型H1/SPAN/DIV文本

<h1 id="coins"></h1> 

,但不能风格的它,当我使用jQuery Mobile的?

.coins{ 
font-family: Verdana; 
font-style: bold; 
font-size: 50px; 
color: #ecb502; 
margin: 30px 30px 0px 0px; 
} 

也试过h1{}并没有帮助吗?

有人知道为什么吗?

回答

3

如果您使用句号'。'设置样式。那么这就是你的问题。样式ID带有散列'#'和带有句点'。'。

另外,您可以使用font-weight:bold而不是font-style。字体风格将主要用于斜体。

而且,虽然它更偏好,但作为参考,您不需要需要来为您的保证金中的值0指定单位。零时间任何东西仍然是零,不管它是什么。

0

你只需要在您的选择更具体,使其过度写入jQuery Mobile的CSS(它的目标在<div data-role="header">元素<h1>元素搭配:.ui-header .ui-title):

变化:

.coins{ 

收件人:

/*this selects all elements that have both the `ui-title` and the `coins` classes and is a descendant of an element with the `ui-header` class*/ 
.ui-header .ui-title.coins{ 

请记住,具有最具体选择器的规则将在CSS中使用。

这里是一个jsfiddle:http://jsfiddle.net/YdP7S/2/