在 CSS & 中添加 URL 链接Html 到按钮 [英] Add URL link in CSS & Html to button

查看:41
本文介绍了在 CSS & 中添加 URL 链接Html 到按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将 CSS 按钮更改为带有 URL 链接的按钮?我读过我还需要添加 HTML 代码吗?

How do I change a CSS button into a button with URL link? Ive read I need to also add HTML codes?

我能找到的按钮的唯一代码是这个:

The only code for the button I can find is this one:

 .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {
position: relative;
margin-bottom: 1px;
color: #FFF;
background-color: #2265B9;
background-repeat: repeat-x;
background-image: -khtml-gradient(linear, left top, left bottom, from(#FCEEC1), to(#EEDC94));
background-image: -moz-linear-gradient(top, #FCEEC1, #EEDC94);
background-image: -ms-linear-gradient(top, #FCEEC1, #EEDC94);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #FCEEC1), color-stop(100%, #EEDC94));
background-image: -webkit-linear-gradient(top, #069CFF, #0A6AB6);
background-image: -o-linear-gradient(top, #FCEEC1, #EEDC94);
background-image: linear-gradient(top, #FCEEC1, #EEDC94);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fceec1', endColorstr='#eedc94', GradientType=0);
border-color: #EEDC94 #EEDC94 #E4C652;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
border-width: 1px;
border-style: solid;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

我不确定这是一个正确的问题还是正确的代码.

Im not sure if this is a correct question or correct codes.

推荐答案

链接不是通过 CSS 添加的,而是通过 HTML 添加的:

Links aren't added through CSS, they're added through the HTML:

<a href="http://example.com">My Link</a>

如果您希望它以您提供的样式显示,只需给它一个 .ui-state-highlight 类:

If you want it to appear with the styling you've given, simply give it a .ui-state-highlight class:

<a href="http://example.com" class="ui-state-highlight">My Styled Link</a>

这篇关于在 CSS &amp; 中添加 URL 链接Html 到按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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