xhtml使用style属性
生活随笔
收集整理的這篇文章主要介紹了
xhtml使用style属性
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE htmlPUBLIC "~//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head><title> First XTHML document</title>
</head>
<body style="background-color:white"><div style="color:blue;font-size:16pt;font-family:arial,sans-serif">This is 16 point blue,arial,type.</div><div style="background-color:purple;color:yellow;font-size:16pt;font-family:'courier new','monospace'">This is a 16 point yellow,courier,type on a blue background.</div>This is the browser default type.<div style="background-color:yellow;margin:24pt;">This is the browser default type on a yelolow background with a 24pt margin all around</div><div>This is the browser default type again.</div>
</body>
</html>
~
工作原理:
? ? ? 在元素中,表示使用style屬性設(shè)置頁面的背景為白色,而不是缺省的灰色。我們使用了樣式單特性background-color。
? ? ? 在這個(gè)div元素中,我們使用了三個(gè)樣式單的特性:color、font-size和font-family。注意,我們用分號(hào)分割每個(gè)特性/值對。
? ? ? ?這些值是一目了然的,但請注意,我們包含了兩種字體:一個(gè)命名的字體和一個(gè)“通用的”字體名稱。
總結(jié)
以上是生活随笔為你收集整理的xhtml使用style属性的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 内联函数的声明和定义
- 下一篇: c++三五法则(适合学完一遍不怎么清楚的