用图像设计按钮样式? [英] Styling buttons with images?

查看:75
本文介绍了用图像设计按钮样式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使用图像来设置提交按钮的样式。我会使用CSS,但按钮太复杂的设计明智。我曾尝试将一个背景图像添加到按钮,但图像定位不准确。我也尝试过使用

< input type =imagesrc =myimage.png>

但是,这不是一个提交按钮,所以它不起作用。我查看并尝试了所有我认为可能的事情,但无法找到解决方案来使按钮提交表单。感谢。

解决方案

您对提交按钮有不同的可能性:

 < input type =image> 
< input type =submit>
<按钮>< /按钮> <! - 无需类型,因为submit是默认类型 - >

这些都是提交按钮。选择适合自己的一款。



现在您可以选择在按钮之间放置图片或使用背景图片并正确定位。



带背景图片的按钮示例:小提琴


Ive been trying to style a submit button using an image. I would use CSS but the button is too complex design wise. I have tried adding a background image to a button but the image was badly positioned. I have also tried using

<input type="image" src="myimage.png">

But alas this is not a submit button so It doesn't work. I have looked and tried everything I believe possible but can't find a solution to making the button submit the form. Thanks.

解决方案

You have different possibilities for a submit button:

<input type="image">
<input type="submit">
<button></button> <!-- no type needed, since submit is the default type -->

These are all submit buttons. Pick the one, which suits you best.

Now you can choose to put an image between the button or use background-images and position them properly.

Example for button with background-image: fiddle

这篇关于用图像设计按钮样式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆