Heim  >  Artikel  >  Web-Frontend  >  CSS的内联样式和外链样式简单介绍_html/css_WEB-ITnose

CSS的内联样式和外链样式简单介绍_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:30:492671Durchsuche

CSS的内联样式和外链样式简单介绍:
关于标题中的概念可能很多朋友根本就有在意过,或者没有特别的注意,但并不说明他们就没有使用对应的方式设置样式,但是能够明白各自的代表那种方式总比不明白的好,下面就介绍一下它们各自的概念。
一.内联样式:
所谓的内联样式就是直接写在标签内部的样式,代码如下:

 

<div style="color:red">蚂蚁部落</div>

 

以上代码可以将字体颜色设置为红色。
二.外链样式表:
外链样式表就是通过在网页头部利用link标签引用一个单独的css文件,代码如下:

 

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

 

三.嵌入式样式表:
嵌入式样式表就是使用定义在当前页面内的css样式,代码如下:

 

<style type="text/css">div{color:red}</style>

 

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=11766

更多内容可以参阅:http://www.softwhy.com/divcss/

 

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn