CSS 图片库

CSS អាចប្រើសំរាប់កសាងកម្មវិធីរូបភាព。

黃色郁金香
黃色郁金香
紅色郁金香
紅色郁金香
花草樹樹
花草樹樹
花草樹樹
花草樹樹

កម្មវិធីរូបភាព

រូបភាពបណ្ដាញនេះគឺត្រូវបានកសាងឡើងដោយ CSS:

ឧទាហរណ៍

<html>
<head>
<style>
div.gallery {
  margin: 5px;
  border: 1px solid #ccc;
  float: left;
  width: 180px;
}
div.gallery:hover {
  border: 1px solid #777;
}
div.gallery img {
  width: 100%;
  height: auto;
}
div.desc {
  padding: 15px;
  text-align: center;
}
</style>
</head>
<body>
<div class="gallery">
  <a target="_blank" href="/i/photo/tulip-yellow.jpg">
    <img src="/i/photo/tulip-yellow.jpg" alt="Cinque Terre" width="600" height="400">
  </a>
  <div class="desc">Magdagdag ng paglalarawan ng imahe dito</div>
</div>
<div class="gallery">
  <a target="_blank" href="img_forest.jpg">
    <img src="img_forest.jpg" alt="Forest" width="600" height="400">
  </a>
  <div class="desc">Magdagdag ng paglalarawan ng imahe dito</div>
</div>
<div class="gallery">
  <a target="_blank" href="img_lights.jpg">
    <img src="img_lights.jpg" alt="Northern Lights" width="600" height="400">
  </a>
  <div class="desc">Magdagdag ng paglalarawan ng imahe dito</div>
</div>
<div class="gallery">
  <a target="_blank" href="img_mountains.jpg">
    <img src="img_mountains.jpg" alt="Mountains" width="600" height="400">
  </a>
  <div class="desc">Magdagdag ng paglalarawan ng imahe dito</div>
</div>
</body>
</html>

Try it yourself

More examples

Responsive image gallery
Kung paano gumawa ng responsive image gallery gamit ang CSS media query, na maganda sa desktop, tablet at smartphone.