Resim ile yazı aynı hizaya nasıl alınır?

Antares

Megapat
Katılım
6 Ağustos 2016
Mesajlar
685
Makaleler
1
Çözümler
1
Daha fazla  
Cinsiyet
Erkek
Merhaba, resim ile yazıyı aynı hizaya nasıl alabilirim?

1623518880291.png


1623518916690.png
 
Hangi yazıyı? Üstteki yazıyı diyorsanız text-align: center yapın. Ek olarak width: 100% yapın.
 
Bir div oluşturun, divin genişliğini resim genişliği ile aynı yapın. Yazdığınız yazılar div içerisinde alt alta sıralanır.
Örneğin:


HTML:
<!DOCTYPE html>
<html>
<head>
    <title>a</title>
</head>
<style type="text/css">
    .benimdivim {
        width: 300px;
        text-align: center;
        display:block;
        float:left;
        margin:5px;
    }
</style>
<body>

<div class="benimdivim">
<img src="https://via.placeholder.com/300x300">
  <h2>Bu Başlığımız</h2>
  <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. </p>
</div>

<div class="benimdivim">
<img src="https://via.placeholder.com/300x300">
  <h2>Bu Başlığımız</h2>
  <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. </p>
</div>
</body>
</html>

Görüntü:
1623521892576.png
 
Son düzenleme:
Bir div oluşturun, divin genişliğini resim genişliği ile aynı yapın. Yazdığınız yazılar div içerisinde alt alta sıralanır.
Örneğin:


HTML:
<!DOCTYPE html>
<html>
<head>
    <title>a</title>
</head>
<style type="text/css">
    .benimdivim {
        width: 300px;
        text-align: center;
        display:block;
        float:left;
        margin:5px;
    }
</style>
<body>

<div class="benimdivim">
<img src="https://via.placeholder.com/300x300">
  <h2>Bu Başlığımız</h2>
  <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. </p>
</div>

<div class="benimdivim">
<img src="https://via.placeholder.com/300x300">
  <h2>Bu Başlığımız</h2>
  <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. </p>
</div>
</body>
</html>

Görüntü:
Eki Görüntüle 1065983
Hocam dediğinizi yaptım ama istediğim gibi olmadı ve sayfayı küçülttüğümde responsive olması lazım müsait iseniz dosyayı atsam bakabilir misiniz?
 
Uyarı! Bu konu 5 yıl önce açıldı.
Muhtemelen daha fazla tartışma gerekli değildir ki bu durumda yeni bir konu başlatmayı öneririz. Eğer yine de cevabınızın gerekli olduğunu düşünüyorsanız buna rağmen cevap verebilirsiniz.

Technopat Haberler

Yeni konular

Geri
Yukarı