好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

web前端:css_html/css_WEB-ITnose

css简介:

web文档的结构由html元素定义,而这些html元素是如何显示的,则是由层叠样式表css来定义,这样就实现了结构与表现的分离。

1、外部样式表

可以将样式定义放在一个单独的文件中,并且在需要该样式的文档中使用,这样样式表称为外部样式表。

2、嵌入式样式表

嵌入式样式表是用 元素将样式包含在网页内部的样式设置,其作用范围仅限于该网页。

元素与其它html元素一样,有一个开始标记和一个结束标记。在两个标记之间的任何代码都被看作为样式定义。同样, 标记之间的任何代码必须遵循样式定义规则。

文档的 段必须出现在文档的 段内,并且可以有多个 段。

标记语法格式:

.....样式定义.....

3、内联样式表

大多数的html标记都包含有一个style属性,允许指定在标记显示时的样式,这种样式规则的定义方法称为内联样式。

如果想要一个特定的

标记的文本显示为红色,可以使用以下代码:

红色标题列

4、样式规则语法

body(选择器){【color(属性):black(值); padding(属性):lem(值)】(声明);}

5、绝对长度:cm厘米,mm毫米,in英寸,pt点,pc(picas)

相对长度:em(ems),px像素,ex(exes)

6、设置元素内容字体:

设置字体名称font-family (值:arial,verdana,和times,new,roman )

设置字体倾斜程度font-style (值:normal,italic,oblique)

设置字体的变体font-variant (值:normal,small-caps)

设置字重font-weight (值:normal,bold,bolder,lighter,100、200、300、400、500、600、700、800、900)

设置字体大小font-size (值:xx-small,x-small,small,medium,large,x-large,xx-large)

content:内容

border:边框

padding:内边框

margin:外边距

border-style边框 border-width边框粗细 border-color边框颜色

padding-top内层上边距 padding-left左侧 padding-right右侧 padding-bottom高度

margin-top margin-left margin-right padding-bottom

float:left(浮动)

vertical-align:baseline(文字行高)

letter-spacing(每个文字的间行)

列如:

.xin1{ background-color: black; border: 1px solid red; width: 1001px; height: 1420px; padding-top: 10px; padding-left: 10px; padding-right: 10px; } .xin2 { font-size: 80px; font-weight: 900; color: azure; float: left; } .xin3{ color: azure; font-size: 10px; margin-top: 2px; } .xin4{ font-size: 10px; margin-top: 20px; text-decoration: underline; color: aliceblue; margin-left: 2px; } .xin5{ margin-top: 2px; float: left; border:1px dashed azure; } .xin6{ color: azure; font-size: 10px; margin-left:168px; margin-right: 350px; } .xin7{ font-size: 10px; margin-top: 2px; text-decoration: underline; color: aliceblue; float: right; } .xin8{ margin-top: 40px; float: right; border:1px dashed azure; margin-right: 2px; } .xin9{ color: azure; font-size: 10px; margin-top: 50px; margin-right: 235px; margin-left: 2px; } .xin10{ font-size: 10px; margin-top: 2px; text-decoration: underline; color: azure; } .xin11{ margin-top: 10px; float: left; border:1px dashed azure; margin-left: 2px; } .xin12{ color: azure; font-size: 10px; margin-top: 19px; margin-left: 263px; margin-right: 235px; } .xin13{ font-size: 10px; margin-top: 2px; text-decoration: underline; color: azure; float: right; } .xin14{ margin-top:35px ; float: right; border: 1px dashed azure; margin-right: 1px; } .xin15{ color: azure; font-size: 10px; margin-top: 48px; margin-left: 263px; margin-right: 271px; } .xin16{ color: azure; font-size: 10px; margin-top: 2px; text-decoration: underline; } .xin17{ margin-top: 5px; float: left; border: 1px dashed azure; } .xin18{ color: azure; font-size: 10px; margin-top: 17px; margin-left: 250px; margin-right: 275px; } .xin19{ color: azure; font-size: 10px; margin-top: 2px; text-decoration: underline; float: right; } .xin20{ margin-top:30px; float: right; border: 1px dashed azure; } .xin21{ color: azure; font-size: 10px; margin-top: 40px; margin-left: 250px; margin-right: 281px; } .xin22{ color: azure; font-size: 10px; margin-top: 2px; text-decoration: underline; } .xin23{ margin-top: 5px; float: left; border: 1px dashed azure; } .xin24{ font-size: 10px; color: azure; margin-top: 18px; margin-left: 250px; margin-right: 5px; } .xin25{ color: azure; font-size: 10px; float: right; margin-top: 2px; text-decoration: underline; } .xin26{ margin-top: 38px; float: right; border: 1px dashed azure; } .xin27{ color: azure; font-size: 10px; margin-top: 50px; margin-right: 285px; margin-left: 250px; }

太 阳系是以太阳为中心,和所有受到太阳的重力约束天体的集 合体:8颗行星、至少165颗已知的卫星、3颗已经辨认出来的矮行星(冥王星和他的卫星)和数以亿计的太阳系小天体。这些小天体包括小行星 、柯伊伯带的天体、彗星和星际尘埃。依照至太阳的距离,行星序是水星、金星、地球、火星、木星、土星、天王星、和海王星,8颗中的6颗 有天然的卫星环绕着。

水星

查看更多关于web前端:css_html/css_WEB-ITnose的详细内容...

  阅读:32次