Pictures display

Mar 21, 2024
astro feature
2   Minutes
224   Words
<img src="/images/spinner.gif" data-src="/avatar.png" style="width:200px;">
![](https://astro-yi.obs.cn-east-3.myhuaweicloud.com/avatar.png)

default

Show Local Pictures

![](/avatar.png)

default

Customize Local Images

Use html, setstyle="width: 200px;"

<img src="/images/spinner.gif" data-src="/avatar.png" style="width:200px;">

One row, two columns.

<div class="image-cols-2">
<img src="https://astro-yi.obs.cn-east-3.myhuaweicloud.com/pexels-photo-8536415.jpeg">
<img src="/images/spinner.gif" data-src="https://astro-yi.obs.cn-east-3.myhuaweicloud.com/pexels-kyle-miller-20582700.jpg">
</div>

For lazy loading: we need to enter /images/spinner.gif in src, and the real address of the image in data-stc. If you don’t want to use this feature, just enter the image’s real address in src.

One row, three columns

<div class="image-cols-3">
<img src="/images/spinner.gif" data-src="https://astro-yi.obs.cn-east-3.myhuaweicloud.com/pexels-photo-8536415.jpeg">
<img src="/images/spinner.gif" data-src="https://astro-yi.obs.cn-east-3.myhuaweicloud.com/pexels-kyle-miller-20582700.jpg">
<img src="/images/spinner.gif" data-src="https://astro-yi.obs.cn-east-3.myhuaweicloud.com/pexels-photo-20523844.jpeg">
</div>

One row, four columns

<div class="image-cols-4">
<img src="/images/spinner.gif" data-src="https://astro-yi.obs.cn-east-3.myhuaweicloud.com/pexels-photo-8536415.jpeg">
<img src="/images/spinner.gif" data-src="https://astro-yi.obs.cn-east-3.myhuaweicloud.com/pexels-kyle-miller-20582700.jpg">
<img src="/images/spinner.gif" data-src="https://astro-yi.obs.cn-east-3.myhuaweicloud.com/pexels-photo-20523844.jpeg">
<img src="/images/spinner.gif" data-src="https://astro-yi.obs.cn-east-3.myhuaweicloud.com/pexels-photo-8536415.jpeg">
</div>

Actually, it’s all right.

You can actually display it however you want, you just need to know a little bit about TailwindCss.

<div class="image-cols-2">
<img src="/images/spinner.gif" data-src="https://astro-yi.obs.cn-east-3.myhuaweicloud.com/pexels-photo-8536415.jpeg">
<img class="row-span-2" src="/images/spinner.gif" data-src="https://astro-yi.obs.cn-east-3.myhuaweicloud.com/pexels-jeffer-berrire-9027257.jpg">
<img src="/images/spinner.gif" data-src="https://astro-yi.obs.cn-east-3.myhuaweicloud.com/pexels-kyle-miller-20582700.jpg">
</div>

Remember

The theme provides three simple style classes that you can use directly.

  • One row and two columns: class="image-cols-2".
  • one row and three columns: class="image-cols-3".
  • one row and four columns: class="image-cols-4".

If you want a more complex display, check out TailwindCss.

Article title Pictures display
Article author Anand Raja
Release time Mar 21, 2024
Copyright 2025
RSS Feed
Sitemap