登录 | 注册 | FAQ
Anonymous

adding different rollovers with css

+ 发表回复

2 篇帖子 分页: 1 / 1


adding different rollovers with css

rswebs » 周二 12月 21, 2010 4:22 pm

i wanted to also ask how to add different rollovers for each box.

i want the left nav menu to go bold with a rollover and the body section to not bold but to change to different color. i have seen other websites that do this i wanted to know how to do it.

thanks
头像

rswebs

  • 帖子: 77
  • 注册: 周三 11月 24, 2010 6:47 am
--
Thanks Rafael - www.htmltutorialtopics.com

Re: adding different rollovers with css

lacroixz » 周二 12月 21, 2010 6:45 pm

Hello rswebs.

Use 'ids' for this.

Example:

CSS:
代码: 全选
a#example {
font-weight:normal
}

a#example:hover {
font-weight:bold
}

a#color1 {
color:red;
}

a#color1:hover {
color:green;
}


a#color2 {
color:red;
}

a#color2:hover {
color:blue;
}





HTML:
代码: 全选
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title> - Adding different rollovers with css </title>
<link rel="stylesheet" type="text/css" href="style.css" />
<style type="text/css"></style>
</head>
<body>

<ul>
<li><a  id="color1" href="#">Red to green.</a>
<li><a  id="color2" href="#">Red to blue.</a>
<li><a id="example" href="#">Normal to bold.</a>
</ul>


</body>
</html>




That will give:
http://mauricet.ma.funpic.org/rollover/test.html



Goodluck!
头像

lacroixz

  • 帖子: 74
  • 注册: 周三 10月 27, 2010 9:26 pm


+ 发表回复

分页: 1 / 1