SORU
6 Kasım 2008, PERŞEMBE


Nasıl iki <div>s üst üste yapmak istiyorsunuz?

İki salak biraz böyle bakmak istiyorum:

    |               |
 ---|    LOGO       |------------------------
|   |_______________|  LINKS                |
|             CONTENT                       |

Düzgünce bunları üst üste yapmanın en zarif etkileyicisi/yolu nedir? Logo sabit bir yükseklik ve genişlik olacak ve sayfanın üst kenarı dokunmadan olacak.

CEVAP
6 Kasım 2008, PERŞEMBE


Çok seviyorum (CSS ve HTML) yaklaşabilirim:

html,
body {
  margin: 0px;
}
#logo {
  position: absolute; // Reposition logo from the natural layout
  left: 75px;
  top: 0px;
  width: 300px;
  height: 200px;
  z-index: 2;
}
#content {
  margin-top: 100px; // Provide buffer for logo
}
#links {
  height: 75px;
  margin-left: 400px; // Flush links (with a 25px "padding") right of logo
}
<div id="logo">
  <img src="http://www.skrenta.com/images/stackoverflow.jpg" />
</div>
<div id="content">
  
  <div id="links">dssdfsdfsdfsdf</div>
</div>

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

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Elly Awesome

    Elly Awesome

    15 ŞUBAT 2010
  • kalabrandmusic

    kalabrandmus

    25 Kasım 2009
  • UKF

    UKF

    2 Aralık 2009