JSFiddle Demo1
.fbIcon {
background: url(http://i.imgur.com/tLHwYNw.png) no-repeat;
height: 80px;
width: 80px;
float: left;
margin-right: 20px;
margin-top: 12px;
cursor: pointer;
display:inline-block;
}
.someClass {
width: 50%;
height: 90px;
background: #ff7043;
-webkit-border-radius: 50px;
-moz-border-radius: 50px;
border-radius: 50px;
float: right;
text-align: center;
cursor: pointer;
margin-top: 5px;
}
.someClass > h2 {
color: #ffffff;
margin: auto;
font-size: 24px;
vertical-align: middle;
line-height: 90px;
}
或
JSFiddle Demo2
.fbIcon {
width: 14%;
float: left;
margin-right: 2%;
margin-top: 12px;
cursor: pointer;
display: inline-block;
}
.someClass {
width: 50%;
height: 90px;
background: #ff7043;
-webkit-border-radius: 50px;
-moz-border-radius: 50px;
border-radius: 50px;
float: right;
text-align: center;
cursor: pointer;
margin-top: 5px;
}
.someClass > h2 {
color: #ffffff;
margin: auto;
font-size: 24px;
vertical-align: middle;
line-height: 90px;
}
那你試試? –
你想在用戶調整窗口大小時應用這些樣式,還是希望以某種寬度進行調整? – Alex
@alirezasafian現在我已經修復了圖標上的寬度和高度。我希望他們改變窗口大小。例如百分比寬度,但是當我這樣做不起作用 – gsiradze