Home  >  Article  >  Web Front-end  >  CSS的三种样式_html/css_WEB-ITnose

CSS的三种样式_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:37:071045browse

从CSS 样式代码插入的形式来看基本可以分为以下3种:内联式、嵌入式和外部式三种。

 

1:内联式css样式表就是把css代码直接写在现有的HTML标签中,如下面代码:

<p style="color:red";font-size:12px>这里文字是红色。</p>

2:嵌入式,嵌入式css样式,就是可以把css样式代码写在标签之间。

<head>  <style type="text/css">   span{     color:red;    }  </style></head>

3:外部式css样式,写在单独的一个文件中.

 

外部式css样式(也可称为外联式)就是把css代码写一个单独的外部文件中,这个css样式文件以“.css”为扩展名,在

内(不是在
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn