css的引用檔案方式

來源:互聯網
上載者:User
1 使用<link>元素連結到外部的樣式檔案

eg:<link rel=”stylesheet” type=”text/css” href="http://www.php1.cn/">2 在<head>元素中使用”style”元素來指定

eg:<html>
<head>
<title>css demo</title>
<link rel=stylesheet type=”text/css” href="http://www.php1.cn/"> <style>
@import url(css/name.css);
H1 {color:red}
</style>
</head>
<body>
<H1>CSS demo</H1>
<p style=”color:blue”>good luck.</p>
</body>
</html>
3 使用CSS ”標記來匯入樣式表單
eg:<style type=”text/css”>
@import url(default.css);
</style>
或:<style type=”text/css”>
@import url(“default.css”);
</style>
4 在<body>內部的元素中使用”style”屬性來定義樣式

eg:<div style=”width:800px;”></div>

  • 相關文章

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.