360的CSS样式表能发个么 我不太会正在学 求大神指导 最好附带样式表附件 谢谢啦

html-css09

360的CSS样式表能发个么 我不太会正在学 求大神指导 最好附带样式表附件 谢谢啦,第1张

亲,360主页的样式表是直接写在html中的 没有单独的CSS文件!

以下是HTML中部分CSS样式:

@charset "gb2312"

/*common*/

html, body, div, h1, h2, h3, h4, h5, h6, ul, ol, li, dl, dt, dd, p, blockquote, pre, form, input, textarea, fieldset, table, th, td{margin:0padding:0}

body, button, input, select, textarea{font:12px/1.5 "微软雅黑", sans-serif}

body{background:url(http://p2.qhimg.com/t01796bde7698ed9f5d.png) repeat-x #fffcolor:#000}

ul, ol{list-style:none}

img{border:nonevertical-align:top}

:focus{outline:0}

/*float*/

.f-l{float:left}

.f-r{float:right}

.c-b{clear:both}

.clear{clear:bothheight:0font-size:0overflow:hidden}

.clearfix:after{content:"."display:blockheight:0clear:bothvisibility:hidden}

.clearfix{clear:bothzoom:1}

.v-a-m{vertical-align:middle}

/*font*/

h1{font-size:18px}

h2{font-size:16px}

h3{font-size:14px}

h4, h5, h6{font-size:100%}

.f-w-b{font-weight:bold}

.f-w-n{font-weight:normal}

.black{color:#000}

.red{color:#f00}

.gray{color:#999}

.t-a-l{text-align:left}

.t-a-c{text-align:center}

.t-a-r{text-align:right}

.t-d-u{text-decoration:underline}

.f-s-12{font-size:12px}

.f-s-14{font-size:14px}

/*link*/

a{color:#0092catext-decoration:none}

a:hover{text-decoration:underline}

/*table*/

table{border-collapse:collapseborder-spacing:0}

/*layout*/

.m-b-10{margin-bottom:10px}

.m-a{margin:0 auto}

.doc{background:url(http://p2.qhimg.com/t0190747860f190589a.gif) no-repeat 50% 60pxwidth:970pxmargin:0 auto}

/*header*/

.doc-hd{height:60px}

.logo{float:leftmargin:6px 0 0 13px}

/*footer*/

.doc-ft{color:#999border-top:1px solid #e8e8e8padding:12px 0text-align:center}

/*nav*/

.pri-nav{float:rightfont-size:13pxposition:relativemargin-top:16px}

.pri-nav li{float:left}

.pri-nav .arrow{width:69pxheight:31pxbackground:url(http://p4.qhimg.com/t01af7380076093a62f.png) no-repeatposition:absoluteleft:8pxtop:0z-index:9}

.pri-nav a{color:#444width:69pxheight:31pxline-height:28pxdisplay:blocktext-align:centerpadding:0 8pxposition:relativez-index:99}

.pri-nav a:hover{text-decoration:nonecolor:#fff}

.pri-nav .cur a{color:#fff}

/*更新日志*/

.update{background:url(http://w.qhimg.com/images/v2/site/weishi/0509/update.png) no-repeat 100% 100% #fffborder:1px solid #cddbe8margin-bottom:10pxpadding:35px 0 0 75px*zoom:1}

.update-1st{margin-top:30pxborder-color:rgba(26, 90, 150, 0.2)}

.update h2{height:46pxline-height:46pxborder-bottom:2px solid #d7d7d7margin:0 75px 20px 0padding-right:5px}

.update h2 .tit{height:46pxline-height:46pxfloat:leftcolor:#444font-weight:normalfont-size:22pxborder-bottom:2px solid #438bbdpadding:0 5px_position:relative_bottom:-2px}

.update h2 .date{float:rightcolor:#757575font-size:12pxfont-weight:normal}

.update li{min-height:30pxmargin-bottom:20pxfont-size:14px}

.update li .no{background:url(http://w.qhimg.com/images/v2/site/weishi/0509/no.png) no-repeatwidth:30pxheight:30pxdisplay:inline-blocktext-align:centerfont:normal 16px/30px arialmargin-right:10px}

.update .more{text-align:rightfont-size:14pxpadding:5px 10px 10px}

/*tips*/

.tip-1{width:935pxmin-height:85px_height:85pxmargin:0 auto 40pxbackground:#fef8efborder:1px solid #faecd3position:relative}

.tip-1 h2{font-size:20pxcolor:#eb6100font-weight:normalpadding:10px 0 5px 82px}

.tip-1 h2 a{color:#eb6100}

.tip-1 p{color:#434343padding-left:82px}

.tip-1 .more{width:97pxheight:30pxline-height:30pxbackground:url(http://w.qhimg.com/images/v2/site/weishi/0509/btn_1.png) no-repeatposition:absoluteleft:794pxtop:39pxtext-align:center}

.tip-1 .more:hover{text-decoration:none}

.tip-1 .new{width:82pxheight:82pxposition:absoluteleft:-2pxtop:-2px}

/*feature*/

.feature{width:936pxheight:339pxmargin:0 auto 40pxbackground:url(http://p8.qhimg.com/t010d24d102b76ef2f3.jpg) no-repeatposition:relative}

.feature li,

.feature a{width:193pxheight:339pxposition:absolutetop:0padding:0 20px}

.feature .item-1,

.feature .a1{left:1px}

.feature .item-2,

.feature .a2{left:235px}

.feature .item-3,

.feature .a3{left:469pxwidth:195px}

.feature .item-4,

.feature .a4{left:705pxwidth:190px}

.feature h3{font-size:20pxcolor:#0789d3font-weight:normalpadding:18px 0 5px_display:inline-block}

.feature p{color:#797979line-height:20px_display:inline-block}

.feature a:hover{background:#00a0e9

filter:alpha(opacity=10)-moz-opacity:0.1-khtml-opacity:0.1opacity:0.1}

/*首页轮播*/

#container{width:970pxheight:440pxmargin:0 autoposition:relativez-index:0}

#example{width:970pxheight:440pxposition:relative}

#slides{position:absolutetop:0left:0z-index:100}

.slides_container{width:970pxheight:420pxoverflow:hiddenposition:relativedisplay:none}

.slide{width:970pxheight:440pxdisplay:block}

.slide-1{background:url(http://p2.qhimg.com/t0103e742328ec1c95c.jpg) no-repeat 50% 0}

.slide-2{background:url(http://p4.qhimg.com/t014fd31eb3e1f028ca.jpg) no-repeat 50% 0}

.slide-3{background:url(http://p9.qhimg.com/t0146fbcdc588064c94.jpg) no-repeat 50% 0}

.slide-4{background:url(http://p0.qhimg.com/t01749f2b94ec291ca9.jpg) no-repeat 50% 0}

/*

.slide-5{background:url(http://w.qhimg.com/images/v2/site/weishi/0516/slide_5.jpg) no-repeat 50% 0}

.slide-6{background:url(http://w.qhimg.com/images/v2/site/weishi/0509/slide_6.jpg) no-repeat 50% 0}

*/

.slide .ver{position:absoluteleft:823pxtop:56pxfont-size:16pxfont-weight:boldcolor:#fff}

.slide h1{height:1pxoverflow:hidden}

.slide h2{font-size:20pxcolor:#fffpadding:102px 0 0 562px

text-shadow:0 0 3px rgba(4, 0, 0, .3)}

.slide h3{height:76pxcolor:#ffffont-weight:normalpadding:5px 100px 0 562pxline-height:22pxoverflow:hidden

text-shadow:1px 1px 50px rgba(4, 0, 0, .3)}

.slide .dl{margin:10px 0 0 556px}

.slide .p-1{margin:2px 0 0 562pxbackground:#fff}

.slide .p-1 a{background:url(http://w.qhimg.com/images/v2/site/weishi/0509/arr_1.gif) no-repeat 0 5pxpadding-left:10pxmargin-right:20px}

.slide ul{padding:0 0 0 562px}

.slide li{height:20pxcolor:#6e7479}

.slide .next,

.slide .prev{display:none}

.pagination{position:absoluteleft:215pxtop:365pxz-index:9}

.pagination li{float:leftmargin-right:12px}

.pagination li a{display:blockwidth:14pxheight:0padding-top:14pxbackground-image:url(http://p2.qhimg.com/t0116f179e18d27ddfc.png)background-position:0 0float:leftoverflow:hidden}

.pagination li.current a{background-position:0 -14px}

.loading{position:absoluteleft:405pxtop:126pxz-index:99999}

.loading h3{color:#ffffont-size:16pxfont-weight:normalpadding-bottom:8px}

.loading a{color:#00ffont-size:12pxtext-decoration:underline}

/*feature list*/

.f-list{border:1px solid #cddbe8border-color:rgba(26, 90, 150, 0.2)background:#fffmargin:48px 0 10px}

.f-list h2{width:438pxheight:80pxbackground:url(http://w.qhimg.com/images/v2/site/weishi/0509/f_list_tit.png) no-repeatline-height:200pxoverflow:hiddenposition:relativeleft:-23pxtop:18pxmargin-bottom:20px}

.f-list li{height:260pxbackground:url(http://w.qhimg.com/images/v2/site/weishi/0509/f_list_sep.png) no-repeat 50% 100%padding:50px 0*zoom:1}

.f-list .item-2{height:265px}

.f-list .item-3{height:235px}

.f-list .item-4{height:255px}

.f-list .item-5{height:250px}

.f-list .item-6{height:250px}

.f-list .item-1 .pic,

.f-list .item-3 .pic,

.f-list .item-5 .pic,

.f-list .item-7 .pic{float:left}

.f-list .item-2 .pic,

.f-list .item-4 .pic,

.f-list .item-6 .pic{float:right}

.f-list .item-1 .pic{margin:0 170px 0 100px}

.f-list .item-2 .pic{margin:0 140px 0 130px}

.f-list .item-3 .pic{margin:0 180px 0 130px}

.f-list .item-4 .pic{margin:0 120px 0 160px}

.f-list .item-5 .pic{margin:25px 30px 0 150px}

.f-list .item-6 .pic{margin:0 110px 0 170px}

.f-list .item-7 .pic{margin:25px 170px 0 150px}

.f-list .last{background:none}

.f-list .cont{overflow:hidden*zoom:1}

.f-list .item-1 .cont,

.f-list .item-3 .cont,

.f-list .item-5 .cont,

.f-list .item-7 .cont{padding-right:50px}

.f-list .item-2 .cont,

.f-list .item-4 .cont,

.f-list .item-6 .cont{padding-left:70px}

.f-list .item-2 .cont{padding-top:30px}

.f-list .item-3 .cont{padding-top:30px}

.f-list .item-4 .cont{padding-top:40px}

.f-list .item-5 .cont{padding-top:40px}

.f-list h3{font:normal 26px/50px "微软雅黑"color:#434343}

.f-list h3 span{font-size:22px}

.f-list h3 img{vertical-align:middle}

.f-list .item-6 h3,

.f-list .item-7 h3{line-height:32pxpadding-bottom:10px}

.f-list p{font:normal 14px/28px "微软雅黑"color:#797979}

在dreamweaver cc中可以直接创建css文件,或在内面内手写输入css代码定义规则等等。

如果要使用可视化css编辑,可以使用css设计器,在默认的界面下,在软件窗口右侧的活动窗口内就可以找到css设计器。

例如:新建一个html文件,点击css设计器的“源”窗口的“+”号,选择创建css的方式,包括:新建css;附件已有的css或在页面内创建css样式。

点击“选择器“窗口的”+“号,选择body,可以看到下面的”属性“窗口内显示出可以编辑的属性列表,鼠标点击相应的属性就可以选择或填写数值进行编辑了,在编辑的时候在”设计“窗口会显示样式的变化。

最后如果是新建的css文件,保存路径要正确。

CSS样式表代码布局基础教程

CSS样式表代码布局基础教程—课程10:外部样式表(一)

十、外部样式表

外部样式表是把各种样式单独存在一个文件里,供其他多个网页调用,下面我们来看一个练习;

1、文本编辑器

1)打开记事本或 gedit、leafpad 文本编辑器,gedit 在查看菜单里选择“HTML”;

2)点菜单“文件-保存”命令,以“lx10.html”为文件名,类型所有文件,编码 UTF-8,保存到自己的文件夹;

3)按照基础02课的方法,输入、和的内容;

2、外部样式表

1)点菜单“文件-新建”,新建一个空白文档,保存文件名为 style.css ,位置跟 lx10 放一起,这是一个单独的文件;

2)在里面输入下面的内容;

/* by TeliuTe */

body {

background-color: #ccffff

font-size:1.2em

span {

color:#800000

.myblue {

color:blue

3)第一行 /* ... */ 是注释,注明作者版权用途等,根据自己的需要,

下面的内容跟内部样式表相同,各个标签和它的样式,保存一下文件;

4)回到 lx10.html 文档中,在 head 区内加上下面一行外部引用标识;

5)然后在 body 区内,输入下面的内容;

1)点菜单“文件-新建”,新建一个空白文档,保存文件名为 style.css ,位置跟 lx10 放一起,这是一个单独的文件;

6)保存一下文件,回到自己文件夹中,打开 lx10 网页,看一下效果;

7)在多个网页具有相同样式时,使用外部样式表可以节省空间和减小网页大小;

本节学习了外部样式表的使用方法,你成功地完成了本教程,欢迎继续学习本站的其他课程!

本教程由86团学校TeliuTe制作 http://teliute.laxjyj.com

(计算机基础知识,电脑知识入门学习,请到http://电脑知识网)

CSS标签大全(一)

字体属性:(font)

大小 font-size: x-large(特大) xx-small(极小) 一般中文用不到,只要用数值就可以,单位:PX、PD

样式 font-style: oblique(偏斜体) italic(斜体) normal(正常)

行高 line-height: normal(正常) 单位:PX、PD、EM

粗细 font-weight: bold(粗体) lighter(细体) normal(正常)

变体 font-variant: small-caps(小型大写字母) normal(正常)

大小写 text-transform: capitalize(首字母大写) uppercase(大写) lowercase(小写) none(无)

修饰 text-decoration: underline(下划线) overline(上划线) line-through(删除线) blink(闪烁)

常用字体:(font-family)"Courier New", Courier, monospace, "Times New Roman", Times, serif, Arial, Helvetica, sans-serif, Verdana

背景属性:(background)

色彩background-color: #FFFFFF

图片background-image: url()

重复background-repeat: no-repeat

滚动background-attachment: fixed(固定) scroll(滚动)

位置background-position: left(水平) top(垂直)

简写方法 background:#000 url(..) repeat fixe辅助图片一律用背景处理d left top

区块属性: (Block)

字间距letter-spacing: normal数值

对刘text-align: justify(两端对齐) left(左对齐) right(右对齐) center(居中)

缩进text-indent: 数值px

垂直对齐vertical-align: baseline(基线) sub(下标) super(下标) toptext-topmiddlebottomtext-bottom

词间距word-spacing: normal数值

空格white-space: pre(保留) nowrap(不换行)

显示display:block(块) inline(内嵌) list-item(列表项) run-in(追加部分) compact(紧凑) marker(标记) tableinline-tabletable-raw-grouptable-header-grouptable-footer-grouptable-rawtable-column-grouptable-columntable-celltable-caption(表格标题)

方框属性:(Box)

width:height:float:clear:bothmargin:padding:顺序:上右下左

边框属性: (Border)

border-style: dotted(点线)dashed(虚线)solid(实线)double(双线)groove(槽线)ridge(脊状) inset(凹陷) outset

border-wid

th:边框宽度

border-color:#

简写方法border:width style color

列表属性: (List-style)

类型list-style-type: disc(圆点) circle(圆圈) square(方块) decimal(数字) lower-roman(小罗码数字) upper-romanlower-alphaupper-alpha

位置list-style-position: outside(外) inside

图像list-style-image: url(..)

定位属性: (Position)

Position: absoluterelativestatic

visibility: inheritvisiblehidden

overflow: visiblehiddenscrollauto

clip: rect(12px,auto,12px,auto) (裁切) css属性代码大全

一 CSS文字属性:

color : #999999/*文字颜色*/

font-family : 宋体,sans-serif/*文字字体*/

font-size : 9pt/*文字大小*/

font-style:itelic/*文字斜体*/

font-variant:small-caps/*小字体*/

letter-spacing : 1pt/*字间距离*/

line-height : 200%/*设置行高*/

font-weight:bold/*文字粗体*/

vertical-align:sub/*下标字*/

vertical-align:super/*上标字*/

text-decoration:line-through/*加删除线*/

text-decoration: overline/*加顶线*/

text-decoration:underline/*加下划线*/

text-decoration:none/*删除链接下划线*/

text-transform : capitalize/*首字大写*/

text-transform : uppercase/*英文大写*/

text-transform : lowercase/*英文小写*/

text-align:right/*文字右对齐*/

text-align:left/*文字左对齐*/

text-align:center/*文字居中对齐*/

text-align:justify/*文字分散对齐*/

vertical-align属性

vertical-align:top/*垂直向上对齐*/

vertical-align:bottom/*垂直向下对齐*/

vertical-align:middle/*垂直居中对齐*/

vertical-align:text-top/*文字垂直向上对齐*/

vertical-align:text-bottom/*文字垂直向下对齐*/

二、CSS边框空白

padding-top:10px/*上边框留空白*/

padding-right:10px/*右边框留空白*/

padding-bottom:10px/*下边框留空白*/

padding-left:10px/*左边框留空白*/

三、CSS符号属性:

list-style-type:none/*不编号*/

list-st

yle-type:decimal/*阿拉伯数字*/

list-style-type:lower-roman/*小写罗马数字*/

list-style-type:upper-roman/*大写罗马数字*/

list-style-type:lower-alpha/*小写英文字母*/

list-style-type:upper-alpha/*大写英文字母*/

list-style-type:disc/*实心圆形符号*/

list-style-type:circle/*空心圆形符号*/

list-style-type:square/*实心方形符号*/

list-style-image:url(/dot.gif)/*图片式符号*/

list-style-position: outside/*凸排*/

list-style-position:inside/*缩进*/

四、CSS背景样式:

background-color:#F5E2EC/*背景颜色*/

background:transparent/*透视背景*/

background-image : url(/image/bg.gif)/*背景图片*/

background-attachment : fixed/*浮水印固定背景*/

background-repeat : repeat/*重复排列-网页默认*/

background-repeat : no-repeat/*不重复排列*/

background-repeat : repeat-x/*在x轴重复排列*/

background-repeat : repeat-y/*在y轴重复排列*/

指定背景位置

background-position : 90% 90%/*背景图片x与y轴的位置*/

background-position : top/*向上对齐*/

background-position : buttom/*向下对齐*/

background-position : left/*向左对齐*/

background-position : right/*向右对齐*/

background-position : center/*居中对齐*/

五、CSS连接属性:

a /*所有超链接*/

a:link /*超链接文字格式*/

a:visited /*浏览过的链接文字格式*/

a:active /*按下链接的格式*/

a:hover /*鼠标转到链接*/

鼠标光标样式:

链接手指 CURSOR: hand

十字体 cursor:crosshair

箭头朝下 cursor:s-resize

十字箭头 cursor:move

箭头朝右 cursor:move

加一问号 cursor:help

箭头朝左 cursor:w-resize

箭头朝上 cursor:n-resize

箭头朝右上 cursor:ne-resize

箭头朝左上 cursor:nw-resize

文字I型 cursor:text

箭头斜右下 cursor:se-resize

箭头斜左下 cursor:sw-resize

漏斗 cursor:wait

光标图案(IE6) p {cursor:url("光标文件名.cur"),text}

六、CSS框线一览表:

border-top : 1px solid #6699cc/*上框线*/

border-bottom : 1px solid #6699cc

/*下框线*/

border-left : 1px solid #6699cc/*左框线*/

border-right : 1px solid #6699cc/*右框线*/

以上是建议书写方式,但也可以使用常规的方式 如下:

border-top-color : #369 /*设置上框线top颜色*/

border-top-width :1px /*设置上框线top宽度*/

border-top-style : solid/*设置上框线top样式*/

其他框线样式

solid /*实线框*/

dotted /*虚线框*/

double /*双线框*/

groove /*立体内凸框*/

ridge /*立体浮雕框*/

inset /*凹框*/

outset /*凸框*/

七、CSS表单运用:

文字方块

按钮

复选框

选择钮

多行文字方块

下拉式菜单 选项1选项2

八、CSS边界样式:

margin-top:10px/*上边界*/

margin-right:10px/*右边界值*/

margin-bottom:10px/*下边界值*/

margin-left:10px/*左边界值*/

CSS 属性: 字体样式(Font Style)

序号 中文说明 标记语法

1 字体样式 {font:font-style font-variant font-weight font-size font-family}

2 字体类型 {font-family:"字体1","字体2","字体3",...}

3 字体大小 {font-size:数值|inherit| medium| large| larger| x-large| xx-large| small| smaller| x-small| xx-small}

4 字体风格 {font-style:inherit|italic|normal|oblique}

5 字体粗细 {font-weight:100-900|bold|bolder|lighter|normal}

6 字体颜色 {color:数值}

7 阴影颜色 {text-shadow:16位色值}

8 字体行高 {line-height:数值|inherit|normal}

9 字 间 距 {letter-spacing:数值|inherit|normal}

10 单词间距 {word-spacing:数值|inherit|normal}

11 字体变形 {font-variant:inherit|normal|small-cps }

12 英文转换 {text-transform:inherit|none|capitalize|uppercase|lowercase}

13 字体变形 {font-size-adjust:inherit|none}

14 字体 {font-stretch:condensed|expanded|extra-condensed|extra-expanded|inherit|narrower|normal| semi-condensed|semi-expanded|ultra-condensed|ultra-expanded|wider}

文本样式(Text Style)

序号 中文说明 标记语法

1

行 间 距 {line-height:数值|inherit|normal}

2 文本修饰 {text-decoration:inherit|none|underline|overline|line-through|blink}

3 段首空格 {text-indent:数值|inherit}

4 水平对齐 {text-align:left|right|center|justify}

5 垂直对齐 {vertical-align:inherit|top|bottom|text-top|text-bottom|baseline|middle|sub|super}

6 书写方式 {writing-mode:lr-tb|tb-rl}

背景样式

序号 中文说明 标记语法

1 背景颜色 {background-color:数值}

2 背景图片 {background-image: url(URL)|none}

3 背景重复 {background-repeat:inherit|no-repeat|repeat|repeat-x|repeat-y}

4 背景固定 {background-attachment:fixed|scroll}

5 背景定位 {background-position:数值|top|bottom|left|right|center}

6 背影样式 {background:背景颜色|背景图象|背景重复|背景附件|背景位置}

框架样式(Box Style)

序号 中文说明 标记语法

1 边界留白 {margin:margin-top margin-right margin-bottom margin-left}

2 补 白 {padding:padding-top padding-right padding-bottom padding-left}

3 边框宽度 {border-width:border-top-width border-right-width border-bottom-width border-left-width}

宽度值: thin|medium|thick|数值

4 边框颜色 {border-color:数值 数值 数值 数值} 数值:分别代表top、right、bottom、left颜色值

5 边框风格 {border-style:none|hidden|inherit|dashed|solid|double|inset|outset|ridge|groove}

6 边 框 {border:border-width border-style color}

上 边 框 {border-top:border-top-width border-style color}

右 边 框 {border-right:border-right-width border-style color}

下 边 框 {border-bottom:border-bottom-width border-style color}

左 边 框 {border-left:border-left-width border-style color}

7 宽 度 {width:长度|百分比| auto}

8 高 度 {height:数值|auto}

9 漂 浮 {float:left|right|none}

10 清 除 {clear:none|left|right|both}

分类列表

序号 中文说明 标记语法

1 控制显示 {display:none

|block|inline|list-item}

2 控制空白 {white-space:normal|pre|nowarp}

3 符号列表 {list-style-type:disc|circle|square|decimal|lower-roman|upper-roman|lower-alpha|upper-alpha|none}

4 图形列表 {list-style-image:URL}

5 位置列表 {list-style-position:inside|outside}

6 目录列表 {list-style:目录样式类型|目录样式位置|url}

7 鼠标形状 {cursor:hand|crosshair|text|wait|move|help|e-resize|nw-resize|w-resize|s-resize|se-resize|sw-resize}

word-wrap是控制换行的。使用break-word时,是将强制换行。中文没有任何问题,英文语句也没问题。但是对于长串的英文,就不起作用。break-word是控制是否断词的。normal是默认情况,英文单词不被拆开。break-all,是断开单词。在单词到边界时,下个字母自动到下一行。主要解决了长串英文的问题。keep-all,是指Chinese, Japanese, and Korean不断词。即只用此时,不用word-wrap,中文就不会换行了。(英文语句正常。)ie下:使用word-wrap:break- word所有的都正常。ff下:如这2个都不用的话,中文不会出任何问题。英文语句也不会出问题。但是,长串英文会出问题。为了解决长串英文,一般用 word-wrap:break-wordword-break:break-all。但是,此方式会导致,普通的英文语句中的单词会被断开(ie下也是)。目前主要的问题存在于 长串英文 和 英文单词被断开。其实长串英文就是一个比较长的单词而已。即英文单词应不应该被断开那?那问题很明显了,显然不应该被断开了。对于长串英文,就是恶意的东西,自然不用去管了。但是,也要想些办法,不让它把容器撑大。用:overflow:autoie下,长串会自动折行。ff下,长串会被遮盖。所以,综上,最好的方式是word-wrap:break-wordoverflow:hidden而不是word-wrap:break-wordword-break:break-all。

CSS样式表代码布局基础教程—课程9:链接样式

九、链接样式

使用伪类可以设置链接的样式,比如改变颜色、去掉下划线等,下面我们来看一个练习;

1、文本编辑器

1)打开记事本或 gedit、leafpad 文本编辑器,gedit 在查看菜单里选择“HTML”;

2)点菜单“文件-打开”命令,打开自己文件夹里的lx7.html

3)再点菜单“文件-另存为”命令,保存文件名为 “lx9.html”

2、设置伪类

1)在 head 区内,输入内部样式表,设定各个 的锚标记样式,如下;

2)第一个 a 设定全局锚点的样式,用块显示、宽度是50像素、背景色是浅绿色,接下来是锚点 a 的成员:

link 是链接,设定页面中的链接样式,颜色蓝色,不带下划线,

visted 是访问过的链接,设定样式为栗色、不带下划线,

active 是按下鼠标时的链接,设定颜色为绿色、无下划线,

hover 是鼠标移过来悬停,设定颜色为红色、有下划线,背景色改成黄色,hover 放在其他几个成员的后面;

3)保存一下文件,回到自己的文件夹中,打开 lx9 网页,试着用鼠标点击、拖动链接,看一下效果;

本节学习了设置链接样式的基本方法,如果你成功地完成了练习,请继续学习下一课内容;

CSS样式表代码布局基础教程—课程8:内部样式表(一)

八、内部样式表

内部样式表放在网页的...区内,集中在一起方便管理,下面我们来看一个练习;

1、文本编辑器

1)打开记事本或 gedit、leafpad 文本编辑器,gedit 在查看菜单里选择“HTML”;

2)点菜单“文件-保存”命令,以“lx8.html”为文件名,类型所有文件,编码 UTF-8,保存到自己的文件夹;

3)按照基础02课的方法,输入、和的内容;

2、内部样式表

1)对系统标签使用样式,这会影响所有的这种标签,在 head 区输入下面的代码;

2)第一行是样式表开始,最后是样式表结束, 是注释标签,

首先是对 body 标签设置样式,这样凡是在 body 区里的内容,都会使用这个样式,设置背景色和文字大小

然后对 span 标签设置样式,设置内容的颜色,以后凡是用到 span 的地方,都使用这个颜色;

3)接着在 body 区里输入下面的内容;

1)对系统标签使用样式,这会影响所有的这种标签,在 head 区输入下面的代码;

4)保存一下文件,回到自己的文件夹里,打开 lx8 网页,看一下效果;

5)自定义样式选择符,除了系统的标签外,也可以自己定义需要的样式标记,在 head 的.样式表里加入下面的代码;

.myblue {

color:blue

前面的点,表示这是一个通用的样式,可以重复使用,如果是 #号,表示是一个标识符,是专用唯一的 id,myblue 是自定义的样式名称;

6)在 body 区里加入下面的代码,加在上一行的前面,再加上

标签分成两段;

7)这儿使用的是 span,里面的 class 套用的是 myblue 样式,替换了前面设的样式,

保存一下文件,到浏览器中看看效果;

本节学习了使用内部样式表的基本方法,如果你成功地完成了练习,请继续学习下一课内容;

CSS样式表代码布局基础教程—课程7:ul列表(一)

七、ul 列表

对于排列有序的条目,可以使用列表来实现,下面我们来看一个练习;

1、文本编辑器

1)打开记事本或 gedit、leafpad 文本编辑器,gedit 在查看菜单里选择“HTML”;

2)点菜单“文件-保存”命令,以“lx8.html”为文件名,类型所有文件,编码 UTF-8,保存到自己的文件夹;

3)按照基础02课的方法,输入、和的内容;

2、使用列表(计算机基础知识,电脑知识入门学习,请到http://电脑知识网)

1)在后面接着输入下面的代码;

第一课

第二课

第三课

2)前面的

建立一个列表,里面的各个

是列表项,各个列表项排列对齐缩进,前面有一个圆点列表符号,

保存一下文件,到自己文件夹里,打开 lx7 网页,看看列表的效果,这儿加了 超级链接;

3)如果要去掉前面的圆点,可以在 ul 的样式里设定,前面的缩进也可以设定内边距为 0,输入下面的代码;

第一课

第二课

第三课

4)保存一下,再到浏览器里看一下,三个列表都排到了左边对齐;

5)如果要排列成横向水平的菜单样式,可以在每个列表项里加上 float 属性,防止重叠再设定一个宽度,代码如下;

6)保存一下,再到浏览器里看一下,三个列表项都水平排列了;

本节学习了列表的基本使用方法,如果你成功地完成了练习,请继续学习下一课内容;

CSS样式表代码布局基础教程—课程6:div布局(一)

六、div 布局

默认 div 占据一行,第二个 div 到下一行去,怎样用 div 进行分栏布局,我们来看一个练习;

1、文本编辑器

1)打开记事本或 gedit、leafpad 文本编辑器,gedit 在查看菜单里选择“HTML”;

2)点菜单“文件-打开”命令,打开上次的 lx5 网页,再点“文件-另存为”,以“lx6.html”为文件名,保存到自己的文件夹;

3)按照两列并排来进行布局;

2、定位布局

1)在下面加一个

标签,作为主框架,在标签里加入下面的样式;

2)前面的 id 是这个 div 的标识符,用来标记这个 div 容器,

在里面的样式里设置了颜色、边框、内边距,

设定了固定宽度 604,高度 202,这个可以计算出来,根据下面两列的宽度再加上内边距;

3)修改里面的古诗的 div 样式,加上背景色、去掉内外边距,最后加上一个左浮动 float:left

4)在这个后面,再加上另一个 div,样式相同,里面输入另一首古诗 ;

5)这儿的 float:left让这个 div 框,跟上一个框并排左对齐,而不是到下一行去,

最后再加一个标签,结束最外面的大框架;

6)保存一下文件,回到自己文件夹里,打开 lx6 网页看看效果;

本节学习了使用 div 布局的基本方法,如果你成功地完成了练习,请继续学习下一课内容;