2014年1月8日 星期三

CSS 建立CSS文件並引用



建立 CSS 文件夾:
老師是建議建立一個 CSS 資料夾,再將文件放資料夾中。

Visual Studio 中新增 CSS 檔:
檔案總管中,對專案點選右鍵 〉 加入 〉新增項目 〉樣式表。

樣式表內容:

body
    {
    font-family:Verdana;
    }
   
    .c01
    {
    color:Red;
    font-size:1.2em;
    }
   
    .c02 { color:Blue; font-size:1.4em; }


引用 CSS 範例:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link type="text/css" href="CSS/Site.css" rel="Stylesheet" />
</head>
<body>
<p class="c01">
Did you know we feature your uploads to <span>myMoleskine</span> on our homepage? Share with us today and then check out www.moleskine.com to see your upload!
</p>
<hr />
<p class="c01" >
Did you know we feature your uploads to myMoleskine on our homepage? Share with us today and then check out www.moleskine.com to see your upload!

</p>
<hr />
<p class="c02" >
Did you know we feature your uploads to myMoleskine on our homepage? Share with us today and then check out www.moleskine.com to see your upload!
</p>
<hr />
<p class="c02">
Did you know we feature your uploads to myMoleskine on our homepage? Share with us today and then check out www.moleskine.com to see your upload!

</p>
abc&nbsp;&nbsp;xyz<br />
abc&amp;&gt;&lt;
<a>
&lt;a&gt;
</body>
</html>




沒有留言:

張貼留言