用css的造型按钮

时间:2011-06-17 10:13:35

标签: html css vbscript asp-classic pagination

我将按钮看起来像超链接,所以我可以使用request.post而不是querystring。唯一的问题是,当选择某些字符时,它有点困难,因为文本框的区域是字母本身(例如字符i)。有没有办法解决这个问题,而无需更改超链接?我还提供了下面的样式按钮

<input type="submit" name="Page" value="#" style="background:transparent;border:0;display:inline;color:#00F;text-decoration:underline;padding:0px;cursor:pointer">
    <% for i = 97 to 122 %>     
         <input type="submit" name="Page" value="<%=CHR(i) %>" style="background:transparent;border:0;display:inline;color:#00F;text-decoration:underline;padding:0px;cursor:pointer;">&nbsp;
    <% next %>

3 个答案:

答案 0 :(得分:2)

尝试使用display:block;并设置宽度。

或者,您可以增加填充,设置为0px。

答案 1 :(得分:1)

以下是HTML + CSS的一些按钮样式(无需样式):

悬停:

<!DOCTYPE html>
<html>
<head>
<style>
.button {
  display: inline-block;
  border-radius: 4px;
  background-color: #f4511e;
  border: none;
  color: #FFFFFF;
  text-align: center;
  font-size: 28px;
  padding: 20px;
  width: 200px;
  transition: all 0.5s;
  cursor: pointer;
  margin: 5px;
}

.button span {
  cursor: pointer;
  display: inline-block;
  position: relative;
  transition: 0.5s;
}

.button span:after {
  content: '\00bb';
  position: absolute;
  opacity: 0;
  top: 0;
  right: -20px;
  transition: 0.5s;
}

.button:hover span {
  padding-right: 25px;
}

.button:hover span:after {
  opacity: 1;
  right: 0;
}
</style>
</head>
<body>

<h2>Animated Button</h2>

<button class="button" style="vertical-align:middle"><span>Hover </span></button>

</body>
</html>

点击:

<!DOCTYPE html>
<html>
<head>
<style>
.button {
  display: inline-block;
  padding: 15px 25px;
  font-size: 24px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  outline: none;
  color: #fff;
  background-color: #4CAF50;
  border: none;
  border-radius: 15px;
  box-shadow: 0 9px #999;
}

.button:hover {background-color: #3e8e41}

.button:active {
  background-color: #3e8e41;
  box-shadow: 0 5px #666;
  transform: translateY(4px);
}
</style>
</head>
<body>


<button class="button">Click Me</button>

</body>
</html>

淡入:

<!DOCTYPE html>
<html>
<head>
<style>
.button {
  display: inline-block;
  padding: 15px 25px;
  font-size: 24px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  outline: none;
  color: #fff;
  background-color: #4CAF50;
  border: none;
  border-radius: 15px;
  box-shadow: 0 9px #999;
}

.button:hover {background-color: #3e8e41}

.button:active {
  background-color: #3e8e41;
  box-shadow: 0 5px #666;
  transform: translateY(4px);
}
</style>
</head>
<body>


<button class="button">Click Me</button>

</body>
</html>

波纹:

<!DOCTYPE html>
<html>
<head>
<style>
.button {
    position: relative;
    background-color: #4CAF50;
    border: none;
    font-size: 28px;
    color: #FFFFFF;
    padding: 20px;
    width: 200px;
    text-align: center;
    -webkit-transition-duration: 0.4s; /* Safari */
    transition-duration: 0.4s;
    text-decoration: none;
    overflow: hidden;
    cursor: pointer;
}

.button:after {
    content: "";
    background: #f1f1f1;
    display: block;
    position: absolute;
    padding-top: 300%;
    padding-left: 350%;
    margin-left: -20px !important;
    margin-top: -120%;
    opacity: 0;
    transition: all 0.8s
}

.button:active:after {
    padding: 0;
    margin: 0;
    opacity: 1;
    transition: 0s
}
</style>
</head>
<body>


<button class="button">Click Me</button>

</body>
</html>

希望这会有所帮助。

答案 2 :(得分:0)

使用此:D

这是创建某些按钮的简便方法。运行代码段:

button {
  font-size: 150%;
  margin-right: 50px;
  margin-bottom: 50px;
  padding: 10px;
  border-radius: 10px;
  background-color: transparent;
  font-weight: lighter;
  transition: all 0.3s;
  box-shadow: silver 3px 3px 3px 0;
}

/*
    Button number "one"
*/

#one {
  color: #00d5ff;
  border: 1px solid #00d5ff;
}

#one:hover {
  color: white;
  background-color: #00d5ff;
}

/*
    Button number "two"
*/

#two {
  color: #b50000;
  border: 1px solid #b50000;
}

#two:hover {
  color: white;
  background-color: #b50000;
}

/*
    Button number "three"
*/

#three {
  color: #00ff2f;
  border: 1px solid #00ff2f;
}

#three:hover {
  color: white;
  background-color: #00ff2f;
}

/*
    Button number "four"
*/

#four {
  color: #2f00ff;
  border: 1px solid #2f00ff;
}

#four:hover {
  color: white;
  background-color: #2f00ff;
}

/*
    Button number "five"
*/

#five {
  color: #ff00bb;
  border: 1px solid #ff00bb;
}

#five:hover {
  color: white;
  background-color: #ff00bb;
}

/*
    Button number "six"
*/

#six {
  color: #ff0000;
  border: 1px solid #ff0000;
}

#six:hover {
  color: white;
  background-color: #ff0000;
}

/*
    Button number "seven"
*/

#seven {
  color: #ff8c00;
  border: 1px solid #ff8c00;
}

#seven:hover {
  color: white;
  background-color: #ff8c00;
}

/*
    Button number "eight"
*/

#eight {
  color: #ffee00;
  border: 1px solid #ffee00;
}

#eight:hover {
  color: white;
  background-color: #ffee00;
}

/*
    Button number "nine"
*/

#nine {
  color: #26ff00;
  border: 1px solid #26ff00;
}

#nine:hover {
  color: white;
  background-color: #26ff00;
}

/*
    Button number "ten"
*/

#ten {
  color: #00a2ff;
  border: 1px solid #00a2ff;
}

#ten:hover {
  color: white;
  background-color: #00a2ff;
}
<button id="one">1. Button</button>
<button id="two">2. Button</button>
<button id="three">3. Button</button>
<button id="four">4. Button</button>
<button id="five">5. Button</button>
<button id="six">6. Button</button>
<button id="seven">7.Button</button>
<button id="eight">8. Button</button>
<button id="nine">9. Button</button>
<button id="ten">10. Button</button>