# Size in Creght | Creght Visual Documentation

> Quick Start: Use Fixed for precise control over width/height. Use Percentage or Fill (fr) for responsive layouts.…

[![Creght](https://ugc.talizen.com/_assets/site/2061660904709165056/1780797461299__creght_logo.png)Help Center](/en/help.md)

[Changelog](/en/blogs.md)

[AI](/en/docs/ai/quick-create-first-website.md) [Visual](/en/docs/get-start.md)

Basic

- [Get to Know Creght in 2 Minutes](/en/docs/get-start.md)
- [How to Register for Creght](/en/docs/signup.md)
- [Creating a Project in Creght](/en/docs/create-site.md)
- [Templates](/en/docs/tpls.md)

Design

- [Using the Editor](/en/docs/editor.md)
- [Basic Operations](/en/docs/operating.md)
- [Layouts in Creght](/en/docs/layout.md)
- [Position in Creght](/en/docs/position.md)
- [Size in Creght](/en/docs/size.md)
- [Breakpoints in Creght](/en/docs/breakpoint.md)
- [Overlays](/en/docs/popover.md)
- [Components in Creght](/en/docs/components.md)
- [Adding Third-Party Fonts](/en/docs/tp-font.md)
- [Duplicate and Deep Copy](/en/docs/deep-copy.md)

CMS

- [CMS (Content Management System)](/en/docs/cms.md)
- [Importing WeChat Official Account Articles into CMS](/en/docs/wxmp.md)

Site Setting

- [Page Settings](/en/docs/page-setting.md)
- [How to Upgrade a Plan](/en/docs/manage-plan.md)
- [SEO Settings](/en/docs/seo-setting.md)
- [Small Files (Site Verification)](/en/docs/verification-file.md)
- [Adding a Custom Domain in Creght](/en/docs/custom-domain.md)
- [How to Complete ICP Filing](/en/docs/beian.md)
- [Server Nodes](/en/docs/website-node.md)
- [How to Switch Sites](/en/docs/pxrp79jqtnyq.md)
- [Localization](/en/docs/localization.md)

AI

- [About Creght AI](/en/docs/creght-ai.md)

Tool

- [Convert Figma Designs into Live Websites](/en/docs/figma-to-creght.md)
- [3 Guidelines for Responsive Figma Layouts](/en/docs/figma-autolayout.md)
- [Covert Figma to live website](/en/docs/response-site.md)
- [Figma to Responsive Website: Interactions](/en/docs/figma03.md)
- [Compressing Video with FFmpeg](/en/docs/ffmpeg.md)
- [How to Add Clarity to Your Website](/en/docs/clarity.md)
- [Creating a Button Hover Effect](/en/docs/button.md)
- [How to Build a Reusable Collapsible FAQ Panel](/en/docs/collapse.md)
- [Responsive Navigation Tutorial](/en/docs/nav.md)

Design/

# Size in Creght

**Quick Start:**

- Use **Fixed** for precise control over width/height.
- Use **Percentage** or **Fill (fr)** for responsive layouts.
- Use **Auto** for content-driven sizing (like text).
- Use **Viewport** for full/partial screen sections.
- Enable **Aspect Ratio** to maintain element proportions during resizing.

Select an element, then go to the **Size** panel in the right-hand settings sidebar to adjust its dimensions.

![image.png](https://fsb.huglight.cn/87837258ec653927a8b62181f29e9828/image.png)

Width can be set as: **Fixed, Percentage, Fill, or Auto**.

Height has the same options, with an additional type: **Viewport**.

## Size Types

### Fixed

A fixed size assigns an exact value to the element.

For example, setting the width to `120px` means the element will always remain `120px` wide across all devices.

![image.png](https://fsb.huglight.cn/bf14da4b0bd4c7bb2f632abe0f017715/image.png)

### Percentage

Percentage size is based on the parent container’s size.

For example, setting the width to `50%` makes the element half the width of its parent.

![image.png](https://fsb.huglight.cn/faacb0b65ecbd1abfaddad3356d6a5d2/image.png)

### Fill (1fr)

When the parent uses **Auto Layout**, setting a child element’s width to **Fill (1fr)** makes it take up the remaining available space.

In the example below, the right element is fixed at `360px`. The left blue block is set to `1fr`, filling the rest of the parent container.

!\[image.png\]

If multiple elements are set to **Fill (1fr)**, the remaining space is divided equally.![image.png](https://fsb.huglight.cn/47602a3ea85ff2440959e03220287ea0/image.png)

If one element is set to **2fr**, it will take up twice as much space as the others.

![image.png](https://fsb.huglight.cn/079dce59bba46d031a6444908c0be240/image.png)

### Auto

Auto size makes the element wrap its content.

For example, a text element will automatically adjust its width or height based on the text length.

![image.png](https://fsb.huglight.cn/7ef0724fe4ac1e9a68b04c8d1a641a14/image.png)

### Viewport

Viewport size is based on the visible area of the browser window.

- `100vh` = full viewport height
- `50vh` = half viewport height

![image.png](https://fsb.huglight.cn/50a44580ab11a78e752438060fb0fb6b/image.png)

### Aspect Ratio

Enabling the **lock icon** between width and height activates a fixed aspect ratio.

When enabled, the element’s proportions remain constant during resizing (e.g., when the browser width changes).

This is commonly used to display images without distortion.

⚠️ Note: Creght only supports height scaling according to width changes.

![image.png](https://fsb.huglight.cn/088f846950f04f52d24fe82f089ce0bd/image.png)

## Size Type Comparison

| Type | Definition | Common Use Case |
| --- | --- | --- |
| **Fixed** | Assigns an exact pixel value. The element size stays the same on all devices. | Buttons, icons, or elements requiring a precise size. |
| **Percentage** | Sets size as a percentage of the parent container. | Responsive layouts, making elements scale with their container. |
| **Fill (fr)** | Distributes remaining space within an auto layout. Multiple elements can share space proportionally (e.g., `1fr`, `2fr`). | Flexible grid layouts, equal or proportional columns. |
| **Auto** | Wraps the element around its content. | Text blocks or components that should adapt to content length. |
| **Viewport** | Uses the browser’s visible area ( `vh` for height). | Full-screen sections, hero banners, or elements that scale with the viewport. |
| **Aspect Ratio** | Maintains proportional width and height when resizing. | Images or videos that must keep their original proportions. |

On this page

- [Size Types](#size-types)
- [Fixed](#fixed)
- [Percentage](#percentage)
- [Fill (1fr)](#fill-1fr)
- [Auto](#auto)
- [Viewport](#viewport)
- [Aspect Ratio](#aspect-ratio)
- [Size Type Comparison](#size-type-comparison)

![Creght](https://ugc.talizen.com/_assets/site/2061660904709165056/1780797461299__creght_logo.png)

This website is built with [Creght](/en.md)

![User Community](https://ugc.talizen.com/_assets/site/2061660904709165056/1781070374701__help_qr.webp)

User Community

## Links

- [Pricing](/en/price.md)
- [Solutions](/en/solution.md)
- [Customers](/en/customers.md)
- [Help Center](/en/help.md)
- [Contact Us](/en/contact.md)
- [Blog](/en/blogs.md)
- [Refund Policy](/en/tuikuan.md)

## Resources

- [All Resources](/en/resources.md)
- [Templates](/en/templates.md)
- [Components](https://creghtlib.site.creght.com)
- [Animations](/en/effects.md)
- [Figma to Creght](/en/figma2creght.md)
- [API for AI](/en/api.md)

## Comparisons

- [vs Shianxianle](/en/creght-vs-sxl.md)
- [vs Fanke](/en/creght-vs-fkw.md)
- [自己写代码 vs Creght](/en/compare/self-coding.md)
- [外包 vs 自己做](/en/compare/outsourcing.md)

## Terms

- [Terms of Service](/en/legal/terms.md)
- [Privacy Policy](/en/legal/privacy.md)
- [Acceptable Use Policy](/en/legal/acceptable-use.md)

## Social Media

- [Xiaohongshu](https://www.xiaohongshu.com/user/profile/5a38606811be10715f4895b6)
- [Bilibili](https://space.bilibili.com/513308095)

[蜀ICP备2023038192号-2](https://beian.miit.gov.cn)
