Skip to content

位置

设置图片位置:center、top、bottom、left、right。

尺寸

cover、contain 或具体尺寸。

重复

控制重复行为。

位置

设置图片位置:center、top、bottom、left、right。

尺寸

cover、contain 或具体尺寸。

重复

控制重复行为。

位置

设置图片位置:center、top、bottom、left、right。

尺寸

cover、contain 或具体尺寸。

重复

控制重复行为。

位置

设置图片位置:center、top、bottom、left、right。

尺寸

cover、contain 或具体尺寸。

重复

控制重复行为。

位置

设置图片位置:center、top、bottom、left、right。

尺寸

cover、contain 或具体尺寸。

重复

控制重复行为。

位置

设置图片位置:center、top、bottom、left、right。

尺寸

cover、contain 或具体尺寸。

重复

控制重复行为。

位置

设置图片位置:center、top、bottom、left、right。

尺寸

cover、contain 或具体尺寸。

重复

控制重复行为。

位置

设置图片位置:center、top、bottom、left、right。

尺寸

cover、contain 或具体尺寸。

重复

控制重复行为。

图片位置与尺寸

主要关注点:控制背景图片的定位和缩放。

本页实际 Frontmatter 配置

yaml
---
layout: home
hero:
    background:
        type: image
        image:
            src: /images/hero-bg.jpg
            position: center
            size: cover
            repeat: no-repeat
---

API 配置项

说明
hero.background.image.position center, top, bottom, left, right 图片位置
hero.background.image.size cover, contain, auto, 或具体尺寸 图片尺寸
hero.background.image.repeat repeat, no-repeat, repeat-x, repeat-y 重复方式