】。"/> 】。">

首頁  >  文章  >  web前端  >  詳解css行內樣式、內嵌樣式與外部引用樣式的使用方法

詳解css行內樣式、內嵌樣式與外部引用樣式的使用方法

王林
王林轉載
2020-03-21 11:01:543426瀏覽

詳解css行內樣式、內嵌樣式與外部引用樣式的使用方法

三中的使用方法的簡單實例如下:

行內樣式:

<!doctype html>
<html>
<head>
 <meta charset="UTF-8">
 <title>css行内样式</title>
</head>
<body>
<div style="width:100px;height:100px;background:red;"></div>>
 
</body>
</html>

(推薦教學:CSS教學 )

內嵌樣式:

<!!doctype html>
<html>
<head>
 <meta charset="UTF-8">
 <title>css内嵌样式</title>
</head>
<body>
<style type="text/css">
#div{width:100px;height:100px;background:red;}
</style>
<div id="div"></div>>
 
</body>
</html>

外部式:

<!doctype html>
<html>
<head>
 <meta charset="UTF-8">
 <title>css内嵌样式</title>
 <link rel="stylesheet" type="text/css" href="ccss.css">
</head>
<body>
<div id="div"></div>>
 
</body>
</html>

css檔:

#div{width:100px;height:100px;background:red;}

總結:

################################### ##行內樣式:就是程式碼寫在具體網頁中的一個元素內;例如:69488b5ef9e0d45b3c24d1c2c63b861416b28748ea4df4d9c2150843fecfba68######內嵌式:就是在< ;/head>前面寫;例如:080b747a20f9163200dd0a7d304ba388.div{color:#F00}531ac245ce3e4fe3d50054a55f265927######外部式:就是引用外部css檔案;例如:035edf72ed074421fd586ae87126add1######相關影片教學推薦:###css影片教學#######

以上是詳解css行內樣式、內嵌樣式與外部引用樣式的使用方法的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:jb51.net。如有侵權,請聯絡admin@php.cn刪除