Custom Style

The new CaoLiao QR Code dynamic QR code editor supports the "Custom Style" component. You can paste webpage content, design drafts, or static HTML generated by AI to quickly create a better-looking scan page.

Custom Style is suitable for display-based scenarios such as product introductions, event promotions, store information, and equipment instructions. After pasting the content, preview the actual result first. If the style looks off, you can adjust the code in "Code Mode".

What Content Can Be Pasted​

Custom Style mainly supports static HTML content. It is suitable for displaying text, images, tables, cards, buttons, and other page elements.

SourceSuitable Content
Webpage contentImage-text introductions, parameter tables, description blocks, event information
HTML exported from design draftsHeader areas, image-text cards, information modules, process steps
AI-generated resultsMobile static HTML pages, card layouts, button styles
Code you write yourselfHTML tags such as div, p, span, img, a, and table
Content from other editorsImage-text layouts, tables, simple buttons, dividers, and similar content

The following content is generally suitable for pasting:

  • Headings, body text, lists, and dividers
  • Images, image-text cards, and information cards
  • Tables, parameter descriptions, and process steps
  • Button styles and link entries
  • Basic styles such as background color, border radius, borders, shadows, font size, and spacing

Tip: We recommend pasting display-focused content. Full webpage source code usually contains scripts, external styles, and complex interactions, so it may not be fully preserved after pasting.

If you want to quickly make a scan page look better, you can first follow the content display dynamic QR code tutorial to complete the basic content, then add Custom Style with the steps below.

1. Prepare Display Content​

Prepare the content you want to display, such as a product introduction, event description, or store information. If the content already exists in a webpage, design draft, or AI-generated result, copy the corresponding static HTML.

2. Add the Custom Style Component​

Add the "Custom Style" component in the dynamic QR code editor, then paste the prepared HTML into the component.

3. Preview the Mobile Display​

After pasting, switch to preview and check the mobile display. If the style looks off, adjust it in "Code Mode".

4. Save the QR Code Content​

After confirming that text, images, buttons, and links all display correctly, save the QR code content.

This workflow does not require you to build a webpage from scratch. In most cases, as long as the content is static display HTML, you can paste it first and then fine-tune it based on the preview.

Preview After Pasting​

After adding Custom Style, preview the scan page first. The desktop editing area and the mobile scan page use different display environments, so previewing helps you find style issues early.

Check these items first:

  1. Whether all text is displayed completely
  2. Whether images load correctly
  3. Whether the page width fits the mobile screen
  4. Whether tables are too wide
  5. Whether buttons and links are easy to tap
  6. Whether the background and text colors are clear enough
  7. Whether there is obvious misalignment or blank space

If the preview looks correct, you can continue editing other content. If the style looks off, adjust it in "Code Mode".

Adjust Styles in Code Mode​

After pasting custom HTML, the component toolbar provides "Code Mode". In this mode, you can directly modify the HTML and style code.

Code Mode is suitable for adjusting:

  • Text size, color, and weight
  • Spacing between modules and inner padding
  • Background color, borders, and border radius
  • Incompatible or unnecessary styles
  • Complex layouts that need to become more stable single-column mobile layouts
  • Image URLs
  • Button links

For example, you can set the content area to fit the mobile screen:

<div style="width:100%;box-sizing:border-box;">
  Content area
</div>

Images should use a maximum width to avoid exceeding the screen:

<img src="Image URL" style="display:block;max-width:100%;height:auto;" />

If you no longer want to keep the HTML styles, you can use "Convert to Text" to turn the content into plain text and continue editing.

Let AI Generate Styles from a Screenshot​

If you are not familiar with HTML, you can send a reference screenshot to AI and ask it to generate HTML that can be pasted directly into Custom Style. This works well for restoring visual styles such as product introduction cards, event posters, store information blocks, pricing cards, and button groups.

To make the generated result more suitable for WeChat Mini Program and scan page rendering, include these requirements in your prompt:

Generate a directly renderable HTML snippet based on the screenshot I provide. It will be used in WeChat Mini Program webview, Skyline, and rich-text scenarios.

Requirements:
1. Only restore the core component in the screenshot. Do not generate the page background, navigation bar, bottom bar, or surrounding page environment.
2. The outermost component should use width:100%, fill the parent container directly, and not set max-width or horizontal margin.
3. Use inline-style for all styles. Do not use style tags, class, id, external CSS, or JavaScript.
4. Use only basic tags such as div, span, and img. Do not use svg, emoji, or pseudo-elements.
5. Prefer flex for layout. Do not use grid, and avoid position:absolute unless necessary.
6. Set box-sizing:border-box on all containers to avoid width overflow.
7. Adapt to both PC and mobile widths. Keep mobile layout compact and avoid oversized fonts, spacing, and padding.
8. Set min-width:0 on text areas inside horizontal flex containers to avoid breaking the layout.
9. Use img tags for images, and set display:block;width:100%.
10. Do not use calc, vw, vh, clamp, media queries, animation, filters, or other compatibility-unstable CSS.
11. Output only the final HTML code. Do not explain it, and do not wrap it in a Markdown code block.
12. Compress the HTML into one line so I can copy it at once.

After AI generates the code, paste it into the Custom Style component and preview it first. If the result is not ideal, ask AI to adjust it, for example:

  • Make the overall font size smaller for mobile screens
  • Reduce horizontal padding to avoid line breaks
  • Change the table into card-style display
  • Remove complex animation and interaction, and keep only static styles
  • Change a multi-column layout into a more stable single-column mobile layout

Tip: Preview AI-generated HTML first, then fine-tune it in "Code Mode". This helps you quickly get a style close to the screenshot while keeping the scan page stable in WeChat Mini Program.

Usage Tips​

To make Custom Style more stable, follow these principles:

  • Prefer simple HTML tags such as div, p, span, img, a, and table
  • Put styles directly on the current element instead of relying on external CSS
  • Use a single-column mobile layout, and avoid overly wide layouts
  • Use publicly accessible image URLs
  • If a table has too much content, consider changing it into grouped cards
  • Do not include complex scripts, animations, or webpage interactions
  • Preview after pasting, then fine-tune the result in Code Mode

If you only need to display a product description, event introduction, or store information, simple HTML with inline styles is usually enough. Do not add complex effects, pop-ups, carousels, and similar features just to reproduce a webpage effect.

FAQs​

1. What Content May Be Unsupported or Incomplete?​

The following content may not be fully preserved:

TypePossible Issue
JavaScript scriptsThey will not run, so interactive effects will not work
External CSS filesThey may not load; inline styles are recommended
Complex animationsThey may not display, or may differ from the webpage effect
Floating, sticky, pop-up, and similar interactionsThey may not work like they do on webpages in WeChat Mini Program
Pseudo-class stylesEffects such as hover and active may not be obvious
Complex layoutsDeep nesting, absolute positioning, and overly wide elements may cause misalignment
Third-party componentsCarousels, maps, form controls, and other components that depend on JavaScript are usually not suitable for direct pasting

If the content only displays text, images, tables, and buttons, it is usually easier to get a stable result. If the content depends on scripts or complex interactions, change it into a static display format first.

2. Why Might Styles Be Partially Lost?​

The same HTML may look different in a desktop browser and in WeChat Mini Program.

Scan pages need to adapt to different phones, systems, and Mini Program rendering environments. To make sure the page opens normally and the content remains readable, the editor may apply compatibility handling to parts of the HTML and styles. This can simplify complex styles.

Common differences include:

  • Fonts and spacing may differ slightly from the original webpage
  • Shadows, gradients, and border radius effects may become weaker
  • Complex layouts may become single-column layouts that are easier to read on mobile
  • Some incompatible tags or attributes may be ignored
  • External styles may not be fully applied

This usually does not mean the content is lost. It is done to make the page display more stably in WeChat Mini Program. The main goal of a QR code page is to let scanners view the content smoothly.

3. What Should I Do If the Style Does Not Look Right?​

You can adjust the HTML and inline styles in "Code Mode". Common fixes include:

  • Remove complex styles
  • Change multi-column layouts into single-column layouts
  • Add max-width:100%;height:auto; to images
  • Change overly wide tables into cards
  • Adjust font size, color, and spacing

If it is still hard to adjust, copy the current code to AI and ask it to rewrite the content as static HTML that is more suitable for mobile display.

4. Can I Directly Copy Full Webpage Source Code?​

We do not recommend copying full webpage source code directly.

Full webpages usually contain page frames, navigation bars, bottom bars, scripts, external CSS, analytics code, and other content. Putting these into a QR code page may cause style confusion or display issues.

It is better to copy a specific content module from the webpage, such as a product introduction area, event description area, pricing card, or image-text description card. These modules are easier to display stably on scan pages.

5. Should Custom Style Replace All Standard Components?​

No.

Custom Style is more suitable for display-based content layout. If you need to upload images, videos, or files, or add forms, contact info, redirect links, and other features, use the standard components in the dynamic QR code editor first. Standard components are more compatible and easier to maintain.

Custom Style can be used as a supplement for more personalized visual display.

Summary​

Custom Style helps you quickly place webpage content, design draft layouts, or AI-generated HTML into a QR code page, making the scan page more layered and polished.

When using it, paste static HTML first and preview the mobile display. If the style looks off, adjust it in "Code Mode". To keep Mini Program rendering stable, complex webpage effects may be simplified, so static HTML and inline styles are recommended.