怎么把CSS样式写到一个文件里面..

html-css014

怎么把CSS样式写到一个文件里面..,第1张

css可以用嵌入方法和外部连接方法

嵌入法 是在 网页的<head></head>中通过<style></style>来实现如:

<html>

<head>

<title>---</title>

<style>

body{Background: #FFFFFF Margin: 0 Padding: 0 Font-Size: 12px Font-Family: Tahoma, Verdana, Arial, Helvetica, Sans-Serif Text-Align: Center}

</style>

</head>

…………

外部连接就是像楼上的朋友 新建一个.css的文件把样式写到里面 然后在你需要的页面里附加样式表就行了

如:

<html>

<head>

<title>---</title>

<link href="../css/css.css" rel="stylesheet" type="text/css">

</head>

…………

.title_top a:hover{color:#BC2D09} 明白了?

.title_top下级,也就是说它里面的a链接标签hover了

不明白的话,发站内信给我吧