CSS里给空DIV加点击链接怎么实现

html-css09

CSS里给空DIV加点击链接怎么实现,第1张

1、Web标准—结构、样式和行为,对应的分别是HTML、CSS、JS。

2、CSS只是负责样式,而超链接是结构实现的或者通过行为来实现。所以无法通过CSS给div添加超链接。

3、可以通过js行为给div绑定 实现,跳转到相应的链接。可以通过window.open(URL,name,features,replace)方法,详细参考:http://www.w3school.com.cn/jsref/met_win_open.asp

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/htmlcharset=utf-8" />

<title>liuxing test</title>

<style type="text/css">

.divbgpic{

background-image:url('jquery/jquery-ui-1.9.1.custom/jquery-ui-1.9.1.custom/css/base/images/ui-icons_cd0a0a_256x240.png')

width:500px

height:500px

}

</style>

<script type="text/javascript"

src="jquery/jquery1.7.1/jquery-1.7.1.min.js"></script>

</head>

<body>

<div class="divbgpic"></div>

</body>

</html>

background-image:url('jquery/jquery-ui-1.9.1.custom/jquery-ui-1.9.1.custom/css/base/images/ui-icons_cd0a0a_256x240.png')这样子

div之间的空隙,如何通过css来调节a .(如图)12334下面的是白色背景,我加应该是这样设置 {border:none; padding:0; margin:0} //div 没有