ບວກວ່າ: ທີ່ຈະຕິດຕັ້ງຂໍ້ມູນໃນພາບ
ບັນາດວັນທີ່ຈະບັນາດວ່າ: ທີ່ຈະຕິດຕັ້ງຂໍ້ມູນໃນພາບ
ຂໍ້ມູນພາບ

Bottom Left
Top Left
Top Right
Bottom Right
Centered
ບວກວ່າ: ທີ່ຈະຕິດຕັ້ງຂໍ້ມູນໃນພາບ
ບາງສິ່ງທີ່ຕ້ອງເຮັດ - ການເພີ່ມ HTML:
<div class="container"> <img src="img_snow_wide.jpg" alt="Snow" style="width:100%;"> <div class="bottom-left">Bottom Left</div> <div class="top-left">Top Left</div> <div class="top-right">Top Right</div> <div class="bottom-right">Bottom Right</div> <div class="centered">Centered</div> </div>
ບາງສິ່ງທີ່ຕ້ອງເຮັດ - ການເພີ່ມ CSS:
/* ສະນານທີ່ບັນຈຸພາບຮູບແລະຂໍ້ມູນ */ .container { position: relative; text-align: center; color: white; } /* ຂໍ້ມູນທີ່ຕິດຕັ້ງທີ່ສຸດທາງທີ່ສັງ */ .bottom-left { position: absolute; bottom: 8px; left: 16px; } /* ຂໍ້ມູນທີ່ຕິດຕັ້ງທີ່ສຸດທາງທີ່ສັງ */ .top-left { position: absolute; top: 8px; left: 16px; } /* ຂໍ້ມູນທີ່ຕິດຕັ້ງທີ່ສຸດທາງທີ່ສັງ */ .top-right { position: absolute; top: 8px; right: 16px; } /* ຂໍ້ມູນທີ່ຕິດຕັ້ງທີ່ສຸດທາງດ້ານຍິວ */ .bottom-right { position: absolute; bottom: 8px; right: 16px; } /* ການກຳນົດຂອງຂໍ້ມູນຕິດຕັ້ງ */ .centered { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
ບົດສະຫລຸບຂອງຂໍ້ມູນ
教程:CSS 图像
教程:CSS 定位