如何使按钮和场地的角落略微圆?

时间:2013-12-23 08:55:10

标签: html css

我有一个我想要实现的模型。

enter image description here

我有一些差不多好的东西,但按钮的角落和田地的角落不够圆:

enter image description here

是否可以应用样机中的小圆角?到目前为止,我得到了一个小提琴。

http://jsfiddle.net/niklasro/d4D8z/

body {
    font-family:'Raleway', sans-serif;
}
#element1 {display:inline-block;margin-left:10px; }

.textInput{padding-left:5px}

#header {
    width: 100%;
    position: fixed;
    height: 45px;
    border-bottom: solid 2px #0072c9;
    background-color: #FFFFFF;
    z-index: 30;display:inline-block;
}
#header-title {
    left: 250px;
    font-size: 22px;
    bottom: 7px;
    color: #0072c9;
    font-weight: 400;
    position: absolute;
}
.title {
    font-weight: normal;
    font-size: 23px;
    color: rgb(0, 114, 198);
    line-height: 1.429;
    z-index: 70;
}
#navigation-bar {
    width: 230px;
    height: 100%;
    box-shadow: 0 0 8px 6px rgba(0, 0, 0, 0.2);
    z-index: 20;
    position: absolute;
}
#navigation-content {
    width: 100%;
    height: auto;
    position: absolute;
    top: 47px;
}
.navigation-button {
    position: relative;
    width: 100%;
    height: 80px;
    margin: 15px 0px;
}
.navigation-header {
    position: absolute;
    top: 15px;
    left: 10px;
    color: #0072c9;
    font-size: 25px;
}
.navigation-desc {
    position: absolute;
    bottom: 15px;
    left: 10px;
    font-size: 12px;
    color: #0072c9;
}

.login form {
    width: 445px;
    overflow: hidden;
}

.login label {
    padding: 2px;
    display: block;
    line-height: 22px;
    background: #ebebeb;
    font-size: 13px;
    margin-top: 10px;
    overflow: hidden;
}

.login label span {
    display: inline-block;
    padding-left: 10px;
}

.login label input {
    display: inline-block;
    width: 270px;
    height: 20px;
    float: right;
    border: none;
    outline: none;
}
.login .buttons {
    margin-top: 7px;
    float: right;
}

.login .buttons button {
    display: inline-block;
    height: 33px;
    line-height:30px;
    background: rgb(0, 114, 198);
    color: white;
    font-size: 17px;
    border: none;
}
#upload-file {
    display:none;
}

#upload{
    display:none;
}
#logga {
    border-top: solid 2px #0072c9;
}
#logout {
    border-top: solid 2px #0072c9;
}
#navigation-content a:hover div.navigation-button {
    background:lightgrey;
}
#navigation-content a:hover div.navigation-button:before {
    content:' ';
    display:block;
    position:absolute;
    right:-20px;
    top:15px;
    height:30px;
    width:30px;
    background:white;
    -webkit-transform-origin: 5px 25px;
    -webkit-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    -o-transform: rotate(45deg);
    transform: rotate(45deg);
}
table{  width:100%;
    border-collapse:collapse;
    text-align:center;
    border:1px solid #00F;
    font-size:12px;}
th{background:#EEE;width:auto; text-align:center; padding:5px 0;border:1px solid #00F;}
td{width:auto; text-align:center; padding:5px 0;border:1px solid #00F;}
tr:nth-child(even) {background: #EEE;}

5 个答案:

答案 0 :(得分:1)

border-radius提供给您的标签和按钮:

.login label {
     border-radius: 3px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
}

.login .buttons button {
     border-radius: 3px;
     -moz-border-radius: 3px;
     -webkit-border-radius: 3px;
}

Updated Fiddle

答案 1 :(得分:1)

border-radius用于圆角。

写:

.login label{border-radius:5px;}
.login .buttons button{border-radius:3px;}

Updated fiddle here.

More information here.

答案 2 :(得分:0)

使用 border-radius css属性

border-radius: 2px;

请参阅:http://www.w3schools.com/cssref/css3_pr_border-radius.asp

答案 3 :(得分:0)

使用border-radius属性获取圆角。

.login label input {
    border-radius: 15px;
}

同样可以应用于类.login标签。

答案 4 :(得分:0)

.login .buttons button { border-radius: 5px 5px 5px 5px;
-moz-border-radius: 5px 5px 5px 5px;
}
.login label {border-radius: 5px 5px 5px 5px;
-moz-border-radius: 5px 5px 5px 5px;
}

试试这个。