首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

在html表单中,我有什么选择丑陋的提交按钮?

在HTML表单中,如果您想要一个简洁且优雅的提交按钮,可以使用CSS样式来定制按钮的外观。以下是一个简单的示例:

代码语言:html
复制
<!DOCTYPE html>
<html>
<head><style>
.button {
  display: inline-block;
  padding: 10px 20px;
  font-size: 20px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  outline: none;
  color: white;
  background-color: blue;
  border: none;
  border-radius: 15px;
  box-shadow: 0 9px #999;
}

.button:hover {background-color: darkblue}

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

<h2>Custom Submit Button</h2>

<form action="/submit">
 <input type="text" name="input_text" placeholder="Enter text here...">
  <br><br>
 <button class="button" type="submit">Submit</button>
</form> 

</body>
</html>

在这个示例中,我们使用了CSS样式来定义一个名为“button”的类,并将其应用于表单中的提交按钮。这个按钮具有蓝色背景、白色文本、圆角边框和阴影效果。当鼠标悬停在按钮上时,背景颜色会变为深蓝色。当用户点击按钮时,按钮会向下移动一点并显示一个稍微暗一些的阴影效果。

您可以根据自己的需求修改这些样式,以便按钮更好地适应您的网站主题。

页面内容是否对你有帮助?
有帮助
没帮助

相关·内容

领券