html 第七章样式表改变文本格式

来源:互联网 发布:手机淘宝多图变大代码 编辑:程序博客网 时间:2024/04/24 08:09
指定字体系列
在样式表中:
p{font-family:"Arial","Helvetica",sans-serif}//font-family是啥;是指定某字体;如指定宋体
在单独的文本中:
<p style="font-family:Arial,Helvetica,sans-serif">
----------------------------------------------------------------
p,li{font-family:"Verdana","Arial","Helvetica",sans-serif}
--------------------------------------------------------------
<p class="copyright">
Copyright</p>
-----------------------------------------------------------------
设定字体的尺寸和颜色
单位是:px,像素,em,基准字体放大倍数,2em就是放大200
如在css中
h1{font-size:2em}
p{font-size:x-large}
大小有:x-small,small,medium,large,x-large;
--------------------------------------------------------------
总结:在css中
x(p){font-size:....;color:.....}
在html文件中写:
..(p)<style="color:blue;font-size:.......">
无论hr,p,h1都有color,background-color;
其余font-size;height;width;text-align;
-----------------------------------------------------------------------
应用粗体和斜体
粗体可以应用属性font-weight=....数值(100-900)
.boldface{font-weight:bold}


斜体:p{font-style:italic}真实斜体
p{font-style:fasle}虚假斜体


---------------------------------分割线君----------------------------------
应用删除线和下划
underline(线在字符下面)
overline(...上面)
line-through(删除线)
blink(字符文本闪烁)没啥人用,效果极差。
none(去除所有继承下来的属性)
旧版:<del>删除线,<ins>下划线


css中的写法:.underlined{text-decoration:underline}
假若不想要某条线:<a href="ww.baidu.com"style="color:white;
text-decoration:none">这是一个百度传送门</a>




-------------------------------分割线君----------------------------------------
创建内联跨度
比如:<p>I had a<b>great</great>time.</p>
但b的类型又不是你想要的b,
<p>I had a <span style="text-weight:bold">great</span>time.</p>


可以简化成:
<span class="vocabulary">great</span>
在css里面写:
.vocabulary{font-styleitalic}
--------------------------分割线君--------------------------------------
调整字符间距
p{letter-spacing:4px}





0 0
原创粉丝点击