样式单CSS.ppt
上传人:sy****28 上传时间:2024-09-14 格式:PPT 页数:75 大小:161KB 金币:16 举报 版权申诉
预览加载中,请您耐心等待几秒...

样式单CSS.ppt

样式单CSS.ppt

预览

免费试读已结束,剩余 65 页请下载文档后查看

16 金币

下载此文档

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

样式单CSS主要内容HTML块元素HTML列表元素HTML表格元素Frameset和frameHTML表单元素样式单的出现1层叠样式表的特点2CSS样式单如何加入HTML2.1嵌入式样式表:Style属性<HTML><HEAD><TITLE>FormattingwithCSS:DIVandSPAN</TITLE></HEAD><BODY><H1>IntroductiontoHTML/CSS</H1><p>Thispageis<DIVSTYLE="font-size:24pt;color:red">formattedwithCSS</DIV>specification.<p>Thispageis<SPANSTYLE="font-size:24pt;color:red">formattedwithCSS</SPAN>specification.</BODY></HTML>效果2.2内联式样式表:<style>标记标记{特性:特性值;}例子:css2.3外联式样式表:<link>标记2.4输入式样式表:@importurl(URL)样式单实施的优先级<html><head><linkhref=“mystyle.css”rel=“stylesheet”type=“text/css”><styletype=“text/css”>BODY{background:white;}</style></head><body><pstyle=“color:blue”>Hello.</p></body></html>同时使用3指定样式实施的方法CSS与标记对应的三种方式<HTML><HEAD><TITLE>FormattingwithCSS:CLASSandID</TITLE><STYLE>DIV.style1{font-size:24pt;font-weight:bold}DIV.style2{font-size:24pt;font-style:italic}SPAN.test{font-weight:bold}SPAN#freaky{color:green;font-size:90pt;font-style:italic}</STYLE></HEAD><BODY><DIVCLASS="style1”>ThisisabigboldDIV.</DIV><DIVCLASS="style2”>ThisisabigitalicDIV.</DIV>Thisisanormalparagraphwithanodd<SPANID="freaky”>SPAN</SPAN>stuckinthemiddleofit,aswellasa<SPANCLASS="test”>bold</SPAN>bumpandanother<SPANCLASS="test”>bold</SPAN>bumpinthemiddleofit.</P><DIVCLASS="style1”>ThisisanotherbigboldDIV.</DIV></BODY></HTML><!--效果见CSS-id-class.html-->在单独文件中的风格说明4CSS基本属性CSS基本属性字体背景区块(定位)盒子(box)边框(border)列表定位与扩展字体font-family(serif,fantasy,monospace...)字号font-size(small,medium,large,150%)样式font-style(normal,italic,oblique)字号变化font-variant(normal,small-caps)文字粗细font-weight(normal,bold,bolder,lighter)大小写text-transform行高line-height文字修饰text-decoration颜色colorfont:1~8.1字体族font-familyh1{font-family:Georgia,TimesNewRoman,Garamond,Times,serif}p{font-family:Verdana,Arial,Helvetica,sans-serif}.2字体尺寸font-size设置字体尺寸p{font-size:90%}h1{font-size:20pt;}h2{font-size:1.5em;}h3{font-size:150%}blockquote{font-size:70%}b{font-size:20px}.3字体样式font-style.4字体粗细font-weight.5使文本成为大写或小写.6文本修饰text-decor