2014-01-26 29 views

回答

1

類型在一個名爲style.css的 文件`然後包括它如下所示:

<link rel="stylesheet" href="style.css"> 

放置在同一文件夾和開放`page.html中style.css and a HTML page, for example page.html中。應該工作:)

我已經設置了一個JS搗鼓你: http://jsfiddle.net/kr2XU/

1

你必須link你的CSS在HTML文件中像這樣:

<link rel="stylesheet" href="style.css"> 

對於未來,你應該知道在您的HTML文件中動畫內容的非常簡單和好用的方法是使用名爲Edge Animate的Adobe產品。它具有免費的Creative Cloud會員資格。

您可以瞭解更多關於它here

關於調用CSS選擇器,讓我們有一個例子:

main.css 

.class1 
{ 
    background-color: #fff; 
    border: 1px solid #000; 
} 

#another_selector 
{ 
    background-color: #eee; 
    border: 1px solid #666; 
} 

在HTML文件中,你將有:

<div class="class1"> This div has the CSS class ".class1" </div> 
<div id="another_selector"> This div has the "#another_selector" id </div> 

here a JSFiddle,將幫助你弄清楚發生了什麼事情與那些類和ID。