html网页设计中加横线,HTML:让网页超链接拥有多姿多彩的下划线(2)-网页设计,HTML/CSS...

编程知识 更新时间:2023-04-04 21:33:29

二、实例欣赏

假设有两个下划线图形diagonal.gif(波纹线)、flower.gif(花朵)前者的高、宽是3、9,后者的高、宽是11、15。下面是一个设置两种下划线的完整实例:

自定义链接下划线示例

网页源代码如下:注:diagonal.gif 和 flower.gif已经先拷贝到网页所在的同一目录下。

网页源代码如下:注:diagonal.gif 和 flower.gif已经先拷贝到网页所在的同一目录下。

〈html〉

〈head〉

〈title〉ex〈/title〉

〈style type=”text/css”〉

a#example1a {

text-decoration: none;

background: url(diagonal.gif) repeat-x 100% 100%;

white-space: nowrap;

padding-bottom: 2px;

}

a#example1b {

text-decoration: none;

white-space: nowrap;

padding-bottom: 2px;

}

a#example1b:hover {

background: url(diagonal.gif) repeat-x 100% 100%;

}

a#example2a {

text-decoration: none;

background: url(flower.gif) repeat-x 100% 100%;

white-space: nowrap;

padding-bottom: 10px;

}

a#example2b {

text-decoration: none;

white-space: nowrap;

padding-bottom: 10px;

}

a#example2b:hover {

background: url(flower.gif) repeat-x 100% 100%;

}

–〉

〈/style〉

〈/head〉

〈body〉

〈p〉实例:〈/p〉

〈p〉 〈a href=”#” id=”example1a”〉波纹线静态下划线〈/a〉,

〈a href=”#” id=”example1b”〉鼠标停留时出现的波纹线〈/a〉。〈/p〉

〈p〉 〈a href=”#” id=”example2a”〉花朵静态下划线〈/a〉,

〈a href=”#” id=”example2b”〉鼠标停留时出现的花朵下划线〈/a〉。〈/p〉

〈/body〉

〈/html〉

更多推荐

html网页设计中加横线,HTML:让网页超链接拥有多姿多彩的下划线(2)-网页设计,HTML/CSS...

本文发布于:2023-04-04 21:33:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/4aa5da1072ca31c30b840c30c14a8d7b.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:网页设计   横线   下划线   多姿多彩   中加

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 43597文章数
  • 14阅读数
  • 0评论数