2014-04-06 20 views
5

CSS3 columns kullanıyorum ancak farklı arka planları çift/tek sütunlara ayarlamak için her bir sütunu tek tek kontrol etmek istiyorum.CSS3 sütunlarının nth-child'si

sonucun bu resimde gösterilir istiyorum:

Wanted result

html içeriği:

<div id="content"> 
    content body text content body text content body text 
    content body text content body text content body text content body text 
    content body text content body text content body text content body text 
    content body text content body text content body text content body text 
    content body text content body text content body text content body text 
    content body text content body text content body text content body text 
    content body text content body text content body text content body text 
</div> 

Css: Bir şey kullanmak istiyorum

#content { 
    column-gap:25px; 
    column-count:3; 
} 

benzeri:

column:nth-child(even) 
{ 
    background:#0000ff; 
} 

CSS3 :nth-child özelliğini kullanabilir miyim? veya herhangi bir bireysel sütunun seçicisini almak için herhangi bir javascript çözümü kullanabilir miyim?

Lütfen önerdiğiniz çözümleri verin.

şey böyle ..

+1

sanmıyorum bu. – Scimonster

cevap

2

şekillendirme için mutlak konumlu arka plan blokları ekleyin şimdiden teşekkürler: Yapacak bir yolu var

#bg1 { 
    position: absolute; 
    width:30%; 
    height:100%; 
    background-color:green; 
    z-index:-1; 
} 

Fiddle

+0

WebKit'ten diğer oluşturma motorlarının CSS3 sütunlarını desteklediğini biliyor muydunuz? – FelipeAls

+0

@FelipeAls, öneklerle birlikte (Fmo için -moz-) –

+0

http://www.w3schools.com/css/css3_multiple_columns.asp –