Kode CSS max-height property

CSS max-height property berfungsi untuk menentukan tinggi maksimal sebuah obyek/elemen html. Tinggi maksimal yang dikehendaki ditentukan melalui sebuah nilai dalam bentuk:
  • px, em, pt, cm, ... etc (length)
  • % (persen) » : prosentase tinggi obyek/elemen diperhitungkan thd elemen/obyek lain yang ditempati.
  • inherit

Deklarasi max-height property

Beberapa contoh deklarasi max-height property:
min-height: 100px;
min-height: 20em;
min-height: 80%;
min-height: inherit;

Contoh max-height property dalam elemen html

<style type="text/css">
p{
    padding:10px;
    max-height: 100px;
    overflow: auto;
}
.post-body img{
    width: auto;
    border: none;
    padding: 8px;
    max-height: 200px;
    box-shadow: 4px 4px 4px #000;
    border-radius: 6px;
}
</style>

<p> Content here!</p>

<div class="post-body">
    <img src="image.jpg" alt="my image" />
</div>
Edit kode dalam box demo di bawah ini untuk mengetahui lebih jelas fungsi CSS max-height property. Anda dapat menambahkan beberapa CSS property lain untuk mendapatkan bentuk elemen sesuai dengan yang diharapkan
Please click the button to display. Continue with editing code and click to see the results!

1 komentar:

  1. Sunggu bermanfaat tutorial css nya..

    Saya juga punya tutorial css di blog kang, monggo di baca sekalian di koreksi sama akang, takutnya ada yg salah :)

    Cara memilih element atau selector tertentu

    http://www.wappersunda.com/cara-memilih-element-atau-selector-terte.xhtml

    BalasHapus

My ProfileC l o s e

FollowerC l o s e