2016-11-09 18 views
-2

Bar with 3 colors red,yellow,green等給出如下

+1

我建議你首先閱讀'html'的基本介紹。那麼,如果你有一個_specific_問題,你需要幫助,_then_是時候回來問問題。 – arkascha

+0

你不能,因爲你還需要CSS。 – Justinas

+0

當你說「只有html」是可接受的內嵌css'

'?如果沒有,我不認爲這是可能的,因爲你所追求的是字面上的整個CSS點。 –

回答

0

您需要HTML CSS &的組合如何只使用HTML和CSS顯示吧。 下面的代碼可以幫助你:

<style type="text/css"> 
.box { float:left;width:150px;box-shadow:3px 3px 2px #666767;height:30px; } 
.red { background-color:#ff0000; } 
.yellow { background-color:#ffff00; } 
.green { background-color:#00ff00; } 
</style> 

<div class="box red"></div> 
<div class="box yellow"></div> 
<div class="box green"></div> 

你可以在這裏看到小提琴:fiddle

+0

如何通過從其他api中獲取值來設置css的width:值?誰可以幫我這個事? –

0

這是初級水平的問題,在這裏我們代碼的HTML & CSS

.barCont{box-shadow:3px 3px 2px #333;width:240px;float:left;} 
 
.barCont span{display:inline-block;float:left; min-height:15px} 
 
.bar1{background:red; width:80px;} 
 
.bar2{background:yellow; width:80px;} 
 
.bar3{background:green;width:80px;}
<div class="barCont"> 
 
    <span class="bar1"></span> 
 
    <span class="bar2"></span> 
 
    <span class="bar3"></span> 
 
</div>

組合

預覽位於https://jsfiddle.net/itsselvam/9Lvz44bx/