DIV CSS 佈局教程網

DIV 字體顏色:設定 DIV 內文字顏色的方法
編輯:布局基本知識     

本文說明 DIV 字體顏色(DIV 內文字顏色)該怎麼設,用到的 CSS 屬性是 color。

一、在 div 標籤內設字體顏色

在 DIV 標籤內用 style 屬性設定 CSS color:

 <div style="color:#F00">我顏色為紅色</div> 


在 div 標籤內用 style 把文字設為紅色

二、用外部方式設定 div 字體顏色

以下用外部 CSS 把 DIV 內字體顏色設為藍色。

1、head 內的 CSS:

 <style> 
.abc{ color:#00F}
</style>

2、body 內容:

 <div class="abc">我顏色為藍色</div> 

3、效果截圖


外部 CSS 設定 div 字體顏色

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved