SORU
16 NİSAN 2011, CUMARTESİ


Nasıl üst üste bir div hizalamak için ama ınline-block kendi davranışlarını tutmak?

Bakın: http://jsfiddle.net/b2BpB/1/

S: Nasıl ana div tepesine box1 ve box3 align yapabilir misin ? diye boxContainer

#boxContainerContainer {
    background: #fdd;
    text-align: center;
}

#boxContainer {
    display:inline-block;
    border:thick dotted #060;
    margin: 0px auto 10px auto;
    text-align: left;
}

#box1 {
    width: 50px;
    height: 50px;
    background: #999;
    display: inline-block;
}

#box2 {
    width: 50px;
    height: 100px;
    background: #999;
    display: inline-block;
}

#box3 {
    width: 50px;
    height: 50px;
    background: #999;
    display: inline-block;

Çok takdir yardım edin

Bildirim: bir cevap daha öncehttp://stackoverflow.com/users/20578/paul-d-waite kendisine çatallı Bu soru: Getting a CSS element to automatically resize to content width, and at the same time be centered

CEVAP
16 NİSAN 2011, CUMARTESİ


vertical-align CSS özelliği deneyin.

#box1 {
    width: 50px;
    height: 50px;
    background: #999;
    display: inline-block;
    vertical-align: top; /* here */
}

#box3 de uygulayın.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • CaliforniaMetin

    CaliforniaMe

    3 ŞUBAT 2013
  • CommonArtisan

    CommonArtisa

    7 Temmuz 2012
  • Theodore Leaf

    Theodore Lea

    29 AĞUSTOS 2006