超链接如何加下划线 css

html-css014

超链接如何加下划线 css,第1张

给需要添加下划线的超链接添加单独样式或者一个class,包含关键代码:text-decoration:underline。

实例演示如下:

1、设计一个HTMl页面,放入一些a标签超链接:

2、给a便签全部取消下划线:

3、此时的页面展示如下:

4、在样式中添加一个class,去掉下划线:

5、演示:给一些a便签添加第四步的class:

6、刷新页面,此时效果如下:

给其中一种定义个类,通过类选择器控制是否有下划线这一样式。

类选择器允许以一种独立于文档元素的方式来指定样式。

语法:

E.myclass { sRules }

说明:

以class属性包含myclass的E对象作为选择符。

下划线通过设置text-decoration属性来实现。

语法:

text-decoration:<' text-decoration-line '>|| <' text-decoration-style '>|| <' text-decoration-color '>

默认值:看每个独立属性

适用于:所有元素

继承性:无

动画性:看每个独立属性

计算值:看每个独立属性

相关属性:<' text-decoration-skip '>|| <' text-underline-position '>

取值:

<' text-decoration-line '>:

指定文本装饰的种类。相当于CSS2.1的 <' text-decoration '>属性,可取值:none | underline | overline | line-through | blink

<' text-decoration-style '>:

指定文本装饰的样式。

<' text-decoration-color '>:

指定文本装饰的颜色。

希望能帮到你 属性名称

字体属性(Font)

font-family

font-style

font-variant

font-weight

font-size

颜色和背景属性

Color

Background-color

Background-image

Background-repeat

Background-attachment

Background-position

文本属性

Word-spacing

Letter-spacing

Text-decoration

Vertical-align

Text-transform

Text-align

Text-indent

Line-height

边距属性

Margin-top

Margin-right

Margin-bottom

Margin-left

填充距属性

Padding-top

Padding-right

Padding-bottom

Padding-left

边框属性

Border-top-width

Border-right-width

Border-bottom-width

Border-left-width

Border-width

Border-color

Border-style

Border-top

Border-right

Border-bottom

Border-left

Width

Height

Float

Clear

分级属性

Display

White-space

List-style-type

List-style-image

List-style-position

List-style

鼠标(Cursor)属性属性含义

使用什么字体

字体是否斜体

是否用小体大写

字体的粗细

字体的大小

定义前景色

定义背景色

定义背景图案

重复方式

设置滚动

初始位置

单词之间的间距

字母之间的间距

文字的装饰样式

垂直方向的位置

文本转换

对齐方式

首行的缩进方式

文本的行高

顶端边距

右侧边距

底端边距

左侧边距

顶端填充距

右侧填充距

底端填充距

左侧填充距

顶端边框宽度

右侧边框宽度

底端边框宽度

左侧边框宽度

一次定义宽度

设置边框颜色

设置边框样式

一次定义顶端

一次定义右侧

一次定义底端

一次定义左侧

定义宽度属性

定义高度属性

文字环绕

哪一边环绕

定义是否显示

怎样处理空白

加项目编号

加图案

第二行起始位置

一次定义列表

自动

定位“十”字

默认指针

手形

移动

箭头朝右方

箭头朝右上方

箭头朝左上方

箭头朝上方

箭头朝右下方

箭头朝左下方

箭头朝下方

箭头朝左方

文本“I”形

等待

帮助

属性值

所有的字体

Normal、italic、oblique

Normal、small-caps

Normal、bold、bolder、lithter等

Absolute-size、relative-size、length、percentage等

颜色

颜色

路径

Repeat-x、repeat-y、no-repeat

Scroll、Fixed

Percentage、length、top、left、

right、bottom等

Normal <length>

同上

None|underline|overline|line-

through|blink

Baseline|sub|super|top|text-top|middle|bottom|text-bottom|

Capitalize|uppercase|

lowercase|none

Left|right|center|justify

<length>|<percentage>

Normal|<number>|<length>|

<percentage>

Length|percentage|auto

同上

同上

同上

Length|percentage

同上

同上

同上

Thin|medium|thick|length

同上

同上

同上

同上

Color

None|dotted|dash|solid等

Border-top-width|color等

同上

同上

同上

Length|percentage|auto

Length|auto

Left|right|none

Left|right|none|both

Block、inline、list-item、none

Normal、pre、nowrap

Disc、circle、square等

<url>|none

Inside、outside

<keyword>|<position>|<url>

Auto

Crosshair

Default

Hand

Move

e-resize

Ne-resize

Nw-resize

n-resize

Se-resize

Sw-resize

s-resize

w-resize

Text

Wait

Help