css1

本文介绍了CSS(层叠样式表)的基础知识,包括其定义、作用及三种应用方式:内联样式、外部样式表和内部样式。同时详细讲解了字体设置、位置设置等常见样式属性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 CSSCascading Style Sheet(层叠样式表)的缩写。

是用于控制网页样式并允许将样式信息与网页内容分离的一种标记性语言

ONE:

3种类型以及顺序

内联 ->  外部样式表 ---->内部样式

格式:

1.内联:

<html 标签> <style "css样式">

 css控制显示区域

</html标签>

<p style="margin-left:.5in;margin-right:0.5in">
....
<p>

2.外部样式表

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

eg:<link rel=stylesheet href="xx.css" type="text/css">

3.first between </title>&&</head>

<style type="text/css">

<!--

body  {font:10pt "arial"}  和加点区别

h1{font:15pt "arial";font-weight:bole;color:marnoon}

p{font:10px "arial"; color:black}

-->

</style>

TWO: 样式表的分类:

1.字体设置 font-family字体类型  font-size   

 font-style 字体风格  italic normal   oblique

font-weight:bold

text-decoration:文字修饰 underline  overline  line-through  blink  none

text-transform 文字变形  upcase  lowcase

2.位置设置

word-spacing词间距设置

letter-spacing字间距设置

line-height行距设置

text-align 文字水平/垂直对齐  可用属性:center,left,right,justify

vertical-align 

top将要素顶部同最高的母体要素对齐

bottom将要素的底部同最低的母体要素对齐

text-top将要素的顶部同母体要素文字的顶部对齐

text-bottom将要素的底部同母体要素文字的底部对齐

baseline将要素的基准线同母体要素的基准线对齐

middle将要素的中点同母体要素的中点对齐

sub将要素以下标的形式显示

sup将要素以上标的形式显示

3.link

<style type="text/css">
A:link { text-decoration:none }
A:active {text-decoration:none ; font-size:13px }
A:visited {text-decoration:none }
A:hover {
         text-decoration:underline;
   }
 </style>

补充:

h4{margin-top:10px;margin-bottom:10px;margin-left:10px;margin-right:10px}
td {padding-top:10px;padding-bottom:10px;padding-left:10px;padding-right:10px}

td {border-top-width:10px;
   border-bottom-width:10px;
   border-left-width:10px;
   border-right-width:10px
}

border-color:#ff0000
border-style:double;border-width:3px;border-color:#ff0000
type:solid double  dotted  dashed  groove  ridge   inset  outset

  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值