English 中文(简体)
纽芬兰语
原标题:button image issue (css)
  • 时间:2012-05-06 04:38:40
  •  标签:
  • css

这是我曾经做过的一个薪pal。

下面的图像显示我们在互联网探索者中获得的东西以及我们在“空间”中获得的东西。

展示雕像的法典是:

.ppsprite {
background: url( /images/paypal_sprite.png )no-repeat scroll 0px 0px transparent;
width:200px;
height:100px;
position:absolute;
left:54px;
}
 .ppsprite:hover {
background: url( /images/paypal_sprite.png )no-repeat scroll 0px -100px transparent;
}

显示间谍法(html)

<input class="ppsprite" type="image" name="submit" alt="">

屏幕(因特网探测器和火ox)

“entergraph

The sprite works perfectly in all browsers, but you can see a shitty border in IE and a kind of missing image icon top left. In chrome and safari, pretty much same ( but shows alt text on top of sprite )

最佳回答

Add a src attribute to your input tag:

<input class="ppsprite" type="image" name="submit" alt="" src="images/blank.gif">

Just create a file called blank.gif You don t need to do anything with it, just make sure it s in the right directory.

问题回答

您的间谍活动不使用图像,这显然是should<>em>,显示一种断断裂的链接,因为它必须包含一种形象(通过<条码><>src-attrtibute),但你打算树立一个形象。 您可以将<代码>input改为a <>/code>(链接)或丁顿(type=“button”type=“submit”。 以后的工作应不改变作为<代码> 类型=“提交”的任何其它内容, 仍应提交表格,如<代码> 类型=“image”(不认为你需要知道此处的klick x/y-coordinations)。

边界只是因为一些浏览器缺省有边界,而只是设置了<条码>边界:0;<条码>。 (但如上所述,你只字不提这个案件的投入。)





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...