搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

A Linked html div tag which is used for a logo, is showing linked accross the page I have set the width & height according to the png image.

  • 4 个回答
  • 2 人有此问题
  • 1 次查看
  • 最后回复者为 aym_1

more options

Hi, I'm recently having a issue, with a linked div tag. The div tag is used for a logo when user clicks it goes back to home/index page, but problem is that in firefox, when I hover on the logo the whole width of the div showing linked across the page, works fine in IE 8. I have set the width & height according to the png image. Can anybody please help? This is frist time, no idea, & i'm using ff 19.0.

<style type="text/css">
*{margin:0px;
padding:0px;}
	#logo {
	background-image: url(logo.png);
	background-repeat: no-repeat;
	width: 272px;
	height: 60px;
}	
</style>
<body>
<a href="#"><div id="logo"> </div></a>

</body>
</html>
Hi, I'm recently having a issue, with a linked div tag. The div tag is used for a logo when user clicks it goes back to home/index page, but problem is that in firefox, when I hover on the logo the whole width of the div showing linked across the page, works fine in IE 8. I have set the width & height according to the png image. Can anybody please help? This is frist time, no idea, & i'm using ff 19.0. <pre><nowiki><style type="text/css"> *{margin:0px; padding:0px;} #logo { background-image: url(logo.png); background-repeat: no-repeat; width: 272px; height: 60px; } </style> <body> <a href="#"><div id="logo"> </div></a> </body> </html></nowiki></pre>

由cor-el于修改

所有回复 (4)

more options

Hi there,

Do you have a page with the original source up somewhere online? The code you pasted looks garbled/broken so I can't even begin to help here -- even though html coding is outside of our domain of expertise here at Mozilla Support.

Cheers, David

more options

Hi, Sorry about the code didn't work before..I have created a simple div inside it I used text insted of png file. Here is a link http://pastehtml.com/view/cu508zafv.html only the box meant to be a link, but when I hover in ff the emty page is also linked. Its quite strange..didn't happen before. I hope there is a solution, maybe its my pc.. Thank you for your time in helping me.

more options

Try to use an inline element like SPAN instead of DIV.

more options

Hi, thanks for ur suggestion, yah it worked with a span tag linked, however the width & height didn't work as it is inline element, so I searched for some info, & have set it as display:inline-block, but dig tag is still displaying the page horizontally linked, its like theirs is a 'hidden' div/container expanded, its strange why its linked accross, for now I will use this method. Here is links to the code/example https://gist.github.com/anonymous/5070780 http://pastehtml.com/view/cu8hk2lab.html Thank you again!