gpt4 book ai didi

javascript - 使用 css 自定义按钮

转载 作者:行者123 更新时间:2023-11-30 16:21:30 25 4
gpt4 key购买 nike

我有一个按钮并测试了here工作中。但是在我的代码中,我尝试了一些修改但没有任何效果。如下图所示,可以看出按钮没有正常显示。

我的完整代码如下所示,不确定哪里出了问题?可能是什么问题,在 JSFiddle 上测试有效,但在我的 webpage 上不起作用?

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">

<style type="text/css">
#background {background: url(main_background.jpg);}


<!-- Top menu css -->
hr {
border:none;
border-top:1px solid #CCCCCC;
height:1px;
margin-bottom:25px;
}

#maintopmenucontainer{
height:24px;
background:#000;
display:block;
padding:45px 0 0 15px;
}

#maintopmenu{
position:relative;
display:block;
height:24px;
font-size:11px;
font-weight:bold;
font-family:Arial,Verdana,Helvitica,sans-serif;
}

#maintopmenu ul{
margin:0px;
padding:0;
list-style-type:none;
width:auto;
}

#maintopmenu ul li{
display:block;
float:left;
margin:0 1px 0 0;
}

#maintopmenu ul li a{
display:block;
float:left;
color:#fff;
text-decoration:none;
padding:5px 20px 0 20px;
height:19px;
background:transparent url(maintopmenu_bg-OFF.gif) no-repeat top left;
}

#maintopmenu ul li a:hover{
color:#fff;
background:transparent url(maintopmenu_bg-OVER.gif) no-repeat top right;
}

#maintopmenu ul li a.current,#foxmenu ul li a.current:hover{
color:#000;
background:#fff;
}
<!-- Top menu css -->

<!-- Drop Down Menu -->
fieldset {
border: 0;
}
label {
display: block;
margin: 30px 0 0 0;

}
select {
width: 150px;

}
.overflow {
height: 200px;
}
<!-- Drop Down Menu -->

.button {
position: absolute;
border-top: 1px solid #96d1f8;
background: #65a9d7;
background: -webkit-gradient(linear, left top, left bottom, from(#3e779d),
to(#65a9d7) );
padding: 5px 10px;
border-radius: 4px;
box-shadow: rgba(0, 0, 0, 1) 0 1px 0;
text-shadow: rgba(0, 0, 0, .4) 0 1px 0;
color: white;
font-size: 19px;
font-weight: bold;
font-family: Segoe;
text-decoration: none;
vertical-align: middle;
display: block;
width: 200px;
text-align: center;
}

</style>
</head>

<body>

<hr />
<div id="maintopmenucontainer">
<div id="maintopmenu">
<ul>
<li><a href="#Landed" class="current"><span>Landed</span></a></li>
<li><a href="#Landed"><span>Apartment</span></a></li>
<li><a href="#Condominium"><span>Condominium</span></a></li>
<li><a href="#Commecial"><span>Commecial</span></a></li>
<li><a href="#Farm"><span>Farm</span></a></li>

</ul>
</div>
</div>


<div id="background">
<form name="Landed" id="Landed" method="post" >

<br /><br /><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<select name="divstate" id="divstate" >
<optgroup label="Divisions" selected="selected">
<option>Yangon</option>
<option>2</option>
<option>3</option>
</optgroup>
<optgroup label="States">
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
</optgroup>
</select>
&nbsp;&nbsp;&nbsp;
<select name="township" id="township" >
<option>Yangon</option>
<option>2</option>
<option>3</option>
<option>4</option>
</optgroup>
</select>
&nbsp;&nbsp;&nbsp;
<input maxlength="100" type="text" name="min_price" id="min_price" placeholder="Minimum price"/>

&nbsp;&nbsp;&nbsp;
<input maxlength="100" type="text" name="max_price" id="max_price" placeholder="Maximum price"/>

&nbsp;&nbsp;&nbsp;
<a class="button" onclick="searchButtonAction()" id="search" href="#"><span>Search</span></a>
<br /><br /><br />
</form>
</div>

</body>

<script>
$(document).ready(function() {
$('.menu').dropit();
});
$('#max_price-error').css('display', 'block');
$('#max_price-error').html('Please enter to rent or to sell');
</script>
</html>

enter image description here

最佳答案

background: -webkit-gradient(linear, left top, left bottom, from(#3e779d),
to(#65a9d7) );
background: linear-gradient(#3e779d, #65a9d7 );

你只有 -webkit- 渐变。添加普通的。

关于javascript - 使用 css 自定义按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34673217/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com