开发者

links looking like submit buttons

开发者 https://www.devze.com 2023-02-14 06:19 出处:网络
I want my html link to look like a real submit button. Any good codes with css? I have found some examples, but I want it to be more real开发者_如何学运维 than just a grey box.Make a button image in y

I want my html link to look like a real submit button. Any good codes with css? I have found some examples, but I want it to be more real开发者_如何学运维 than just a grey box.


Make a button image in your favourite image precessing tool and use these codes:

HTML

<a href="whatever/link.fil" class="link_button">&nbsp;</a>

CSS:

.link_button
{
    background-image: url(path/to/button_image.png);
    background-position: 0 0;
    background-repeat: no-repeat;
    display: block;
    width: 79px; /*your image width*/
    height: 35px: /*your image height*/
}

That should set up your link to look like a nicely styled button, that you created.

If you don't want to use an image, you can use normal CSS borders and baackground colors/gradients as well.

Regarding the &nbsp; this is so no text is shown on the image itself, another way to do this is with css: text-indet: -9999px; or you can use the text as part of the element like normal and just style the background :)


Do you mean you'd like to create links that look like buttons, but a bit nicer than the standard old grey box?

There are tons of tutorials out there for this: just search "css buttons". A good one is this: http://www.oscaralexander.com/tutorials/how-to-make-sexy-buttons-with-css.html


If your widget toolkit's theme does some snazzy theming (most do), you most likely won't be able to reproduce the button's look. Even if you could, it would only emulate your computer's theme.

Of course, if you don't mind your button not being consistent with normal buttons, there are many tutorials that allow you to create nice CSS buttons.

If you could consider actually using a button rather than a link, that'd probably be even better.

0

精彩评论

暂无评论...
验证码 换一张
取 消