2017-10-16 22 views
-6

我想做div的佈局,裏面有3個字幕可以放入相同的大小!Label dint爲此工作! Please sugegst

我採用了棱角分明的Materialise - [![在這裏輸入的形象描述] [1]普通HTML/CSS也爲我的作品

我已經試過

<div> 
<label> Label 1 </label> 
<label> Label 2 </label> 
<label> Label 3 </label> 
</div> 

我重視[1]圖像正是我需要的!

有什麼建議嗎?我應該在內部使用相同的3格嗎?或跨度/標籤?

+0

http://idownvotedbecau.se/nomcve/ – Swellar

+0

的div標籤,跨度,p和許多其它標籤做工精細的佈局。唯一的是你應該正確地設計它。並且使用有意義的元素將會提高您的代碼質量。 –

回答

1

這是你需要的。

.tabs label { 
 
    padding: 10px 20px; 
 
    border-left: 1px solid #ccc; 
 
    border-right: 0; 
 
    float: left; 
 
} 
 
label.selected { 
 
    background: #ccc; 
 
} 
 
.tabs label:first-child { 
 
    border-left: 0; 
 
} 
 

 
.tabs { 
 
    margin: 10px; 
 
    display: inline-block; 
 
    border: 1px solid #ccc; 
 
    border-radius: 20px; 
 
    overflow:hidden; 
 
}
<div class="tabs"> 
 
<label class="selected"> Label 1 </label> 
 
<label> Label 2 </label> 
 
<label> Label 3 </label> 
 
</div>

+0

非常感謝你Awsme桑迪!它的工作完全適合我:) – CodeWithCoffee

+0

@CodeWithCoffee謝謝,請不要忘記標記它有幫助:) –

+0

悅悅!剛剛更新爲接受 – CodeWithCoffee