我正在学习CSS。如何用CSS设计输入和提交按钮的样式?
我正在尝试创建这样的东西,但我不知道该怎么做
Name
Email
Message
发布于 2013-06-11 18:50:43
http://jsfiddle.net/vfUvZ/
这里是一个起点
CSS:
input[type=text] {
padding:5px;
border:2px solid #ccc;
-webkit-border-radius: 5px;
border-radius: 5px;
}
input[type=text]:focus {
border-color:#333;
}
input[type=submit] {
padding:5px 15px;
background:#ccc;
border:0 none;
cursor:pointer;
-webkit-border-radius: 5px;
border-radius: 5px;
}
发布于 2013-06-11 18:48:13
简单地设置提交按钮的样式,就像设置任何其他html元素的样式一样。您可以使用以下命令来确定不同类型的输入元素的目标
CSS属性选择器
举个例子,你可以这样写
input[type=text] {
/*your styles here.....*/
}
input[type=submit] {
/*your styles here.....*/
}
textarea{
/*your styles here.....*/
}
与其他选择器组合
input[type=text]:hover {
/*your styles here.....*/
}
input[type=submit] > p {
/*your styles here.....*/
}
....
这是一个有效的
示例
发布于 2013-06-11 18:46:41
HTML
CSS
#submit {
color: #fff;
font-size: 0;
width: 135px;
height: 60px;
border: none;
margin: 0;
padding: 0;
background: #0c0 url(image) 0 0 no-repeat;
}
https://stackoverflow.com/questions/17042201
复制相似问题