跪拜 Guibai
← Back to the summary

The 6-Cell Prompt That Makes AI Build a Whole Website You Can Double-Click Open

Core conclusion: When a beginner uses AI to build a company website, the failure point is never the code, but three things not made clear: what sections the page has, what counts as good-looking, and what form the deliverable takes. If you just say "help me make a company website", AI can only follow a template; write the requirements as a 6-cell checklist (who sees it / what sections / what style / what size / how to deliver / how to accept), then have it first search online for reference sites, then write code, and finally deliver uniformly as "single file + relative paths + zero external links", so it opens with a double-click. This article gives a copy-ready prompt, a full runnable 13.6 KB code sample, and 5 troubleshooting paths for when double-clicking fails to open on the desktop.

📦 Supporting resource: Single-file website template that opens with a double-click (with line-by-line comments)

Table of Contents

1. One-sentence conclusion

Look at this picture first 🏠: you hire a construction crew to renovate, and only say "my apartment is 90 square meters, you figure it out" — they can only follow their own familiar model room, and after they finish you say "it looks too much like a rental." A website is the same: AI doesn't fail to write HTML (HyperText Markup Language) — you didn't give it a floor plan, a material list, and acceptance standards.

Three judgments, remember them and you'll avoid 90% of the detours:

This is the same rule I explained in 12 advanced UI interaction effects and corresponding AI prompts: AI only recognizes concrete, verifiable specifications. If you say "add an animation" it gives the most ordinary scaling; if you say "on release first bounce to 1.05 then fall back to 1.0" it follows.

2. A website actually only needs 6 sections

Don't let AI improvise; give it the section list directly. A small company, a studio, or a product — the homepage always has these 6 sections:

# Section What to write in one sentence What happens if missing
1 Navigation bar (nav) logo + 3–4 anchors + one primary button Visitors don't know what else they can scroll down to see
2 Hero one main heading + one subtitle + two buttons + a visual Can't tell what you do within three seconds
3 Services or products 3 cards, each with one sentence Visitors can only guess what you offer
4 Proof 3 numbers, client logos, or one testimonial All self-praise, no credibility
5 Contact entry email, phone, or form; only one primary button on the whole page People who want to ask can't find an exit
6 Footer copyright + contact info + year Page looks unfinished

Why 6 sections? Because the beginner's most common mistake is "want to put everything in" — four paragraphs of intro, nine team members, ten news items. Visitors only make one judgment: can this company solve my problem. 6 sections answer it just right; any more is interference.

A metaphor 🍱: a website is like a bento box, not a buffet. Rice, main dish, two sides, a soup slot — filling it is enough; if you force twelve compartments, each only gets one bite.

3. How to make it: four steps to get it opening

Step 1: Create a folder, don't write code. Right-click on desktop → New Folder, name it website, path with no Chinese, not in system directories. Everything from now on lives in one box, switching computers or sending to others won't lose images.

Step 2: Ask for structure first, not code. Send the six-cell checklist from Section 4, and add at the end: "Only output the section outline and copy for each block first; write code after I confirm." If the structure is wrong, tweaking styles is wasted effort.

Step 3: Generate in segments. Asking for 600 lines at once will lose context in the second half: two nav variants, three corner radii. Split into "skeleton → hero → mobile", each segment runnable and previewable on its own.

Step 4: Save, double-click, three-point acceptance. Only check whether there's a horizontal scrollbar, whether the hero has one primary button, whether it collapses properly at mobile width. If all three pass, it's ready to show people.

4. What the prompt should write: the six-cell checklist

Company info is just cell 0. What really determines the quality of the result is the next six cells:

① Who sees it (Who). "A B2B (business-facing) service page for local restaurant owners" and "a club recruitment page for students" have completely different structures. Write the visitor's identity, their current question, and the action you want them to take.

② What sections (Sections). Directly copy the 6 sections from Section 2, each with one real sentence of copy. Give copy first, then ask for code — AI arranges layout based on copy length, which is far more accurate than it inventing placeholder text.

③ What style (Style). Three adjectives + one reference site + one primary color + one forbidden item. For example: "clean, restrained, slightly tech; refer to stripe.com's information density; primary color #4f7cff; no purple gradient balls, no glowing borders." Adjectives give direction, forbidden items stop losses.

④ What size (Responsive). Write fixed breakpoints: "Design desktop at 1440px, content area max 1120px centered; collapse to single column below 900px; hide nav on mobile." Without breakpoints, AI defaults to not doing mobile.

⑤ How to deliver (Deliverable). The cell beginners most often forget and the most fatal: "Only one index.html, CSS and JS all inline, no external CDN, external fonts, external images; visual elements drawn with CSS gradients or inline SVG." A single file means it can be double-clicked open, sent via WeChat, or dropped on any server.

⑥ How to accept (Acceptance). Write it countable: "Whole site 1 primary color + 1 secondary color; font scale no more than 4 levels; section spacing 88px; no horizontal scrollbar at any width; at most 1 primary button per screen." Rules that can be counted are the ones AI actually executes.

4.1 How to write style words so they aren't wasted

"Grand" "premium" "textured" are the three most commonly written and most useless words. Translate them into executable parameters:

What you want Don't write Write instead
Grand Make the page grand Content area 1120px centered, section spacing 88–96px, heading size 40–56px
Premium Make it premium Use only 1 accent color, rest black/gray/white; no shadow-on-shadow; uniform 12px border radius
Breathable More whitespace Heading-to-body spacing 18px, card padding 26px, any two sections at least 80px apart
Modern Modern style Sans-serif font, heading weight 700, body 400, gradients only on 1 button

5. A complete copy-ready prompt

Copy the whole block below and replace the bracketed content:

You are a senior front-end engineer and UI designer. Please create a homepage for [Company Name].

【Company Info】
- Business: [One sentence saying what you sell]
- Customers: [Who will look at this page]
- Desired visitor action: [Leave email / Call / Add WeChat]
- Available assets: [Only company name and phone / Have logo and 3 product images]

【Page Structure】Strictly follow these 6 sections, order cannot be added or removed:
1. Navigation: logo + 3 anchors (Services/Cases/Contact) + 1 primary button
2. Hero: main headline (≤18 chars) + subtitle (≤40 chars) + primary/secondary buttons + a visual area
3. Services: 3 cards, each with number, title, one-sentence description ≤30 chars
4. Proof: 3 numeric metrics
5. Contact: a centered block with only 1 primary button
6. Footer: copyright + contact info + auto year

【Style】
Clean, restrained, slightly tech. Primary color #4f7cff, secondary color #7c5cff, rest black/gray/white.
Forbidden: purple glowing balls, overlapping shadows, more than 2 fonts, more than 4 font-size levels.

【Size】
Desktop designed at 1440px, content area max 1120px centered, 24px left/right padding.
Below 900px everything collapses to single column, nav menu hidden.
No horizontal scrollbar at any width.

【Deliverable】
Output only one index.html. All CSS and JS inline in the file.
No external CDN, external fonts, external images, or external icon libraries;
visual areas implemented with CSS gradients or inline SVG.

【Process】First only output the section outline and copy for each block, after I confirm output the full code; after code output, self-check item by item against【Acceptance】.

【Acceptance】
1. Whole site uses only 1 primary color + 1 secondary color
2. Font scale no more than 4 levels
3. Section vertical spacing 88px
4. No horizontal scroll at desktop or mobile width
5. At most 1 primary button per section

Note the last part "structure first, code later, then self-check." These three steps are the most valuable part of the whole prompt, because they turn a one-time gambling-style generation into three checkable deliveries.

6. Three-step method to have AI learn UI online

You don't understand UI, that's fine, but you need to make AI learn. Here's a key cognition: when AI browses the web, it mostly reads page source code and text descriptions, not "aesthetic judgment." So don't ask it "which looks good," make it output specifications that can be written into code.

Step 1: Give it search targets, not the word "good-looking." Search terms should include industry and page type, not vague "nice websites." Design community experience: searching onboarding only yields generic landing pages; searching banking app onboarding brings up KYC (Know Your Customer), compliance notices, and similar real structures. For a company site, searching "law firm homepage" is far more useful than "corporate website template."

Step 2: Have it output a deduplicated breakdown table, not a design proposal. Prompt:

Search online for 3 [industry] homepage examples (prioritize awwwards.com, dribbble.com, siteinspire.com),
then only output a breakdown table: hero columns / headline size / body line-height / section spacing / color count / whether there's a large image / whether there's animation.
Don't give design advice, and don't write code.

Step 3: Pick a row, and have it translate that row into CSS specifications before writing code. For example, you chose "hero two columns, headline 48–56px, 2 colors, no large image" — these three numbers are the answers to the "Style" and "Size" cells in Section 5. Then when you have it write code, the result has a basis.

Two pitfalls to warn about:

Fallback: if the AI tool has no web access, paste 2 website links you like, and have it break down the structure before writing. "Break down first, then write" is an order of magnitude more stable than "write directly."

AI research references for UI:

7. Complete runnable code

The following is a complete runnable version (comments and some hover details trimmed; visuals match the full version in the resource at the top). Copy → Notepad → Save As index.html (encoding UTF-8) → double-click, and you'll see the whole page.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>云图设计 | 让品牌被看见</title>
<style>
  :root{--ink:#0b1020;--body:#4a5468;--line:#e6eaf2;--bg:#f6f8fc;--brand:#4f7cff;--brand2:#7c5cff}  /* 6 个色值即整套皮肤 */
  *{box-sizing:border-box;margin:0;padding:0}                                                       /* 统一盒模型,宽度含内边距 */
  body{font-family:-apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;color:var(--ink);line-height:1.65}
  a{color:inherit;text-decoration:none}                                                              /* 链接继承颜色、去下划线 */
  .wrap{max-width:1120px;margin:0 auto;padding:0 24px}                                               /* 全站共用内容容器 */
  header{position:sticky;top:0;background:rgba(255,255,255,.85);backdrop-filter:blur(12px);border-bottom:1px solid var(--line)}
  .nav{display:flex;align-items:center;justify-content:space-between;height:68px}
  .logo{display:flex;align-items:center;gap:10px;font-weight:700}
  .logo i{width:26px;height:26px;border-radius:8px;background:linear-gradient(135deg,var(--brand),var(--brand2))}
  nav ul{display:flex;gap:28px;list-style:none;font-size:15px;color:var(--body)}
  .btn{display:inline-flex;align-items:center;height:46px;padding:0 24px;border-radius:10px;font-size:15px;font-weight:600}
  .btn-main{background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff}
  .btn-line{border:1px solid var(--line)}
  .hero{padding:84px 0 96px}
  .hero .wrap{display:grid;grid-template-columns:1.05fr .95fr;gap:56px;align-items:center}           /* 首屏两栏 */
  .tag{display:inline-block;padding:6px 14px;border-radius:999px;background:rgba(79,124,255,.1);color:var(--brand);font-size:13px;font-weight:600}
  h1{font-size:clamp(34px,4.6vw,56px);line-height:1.15;letter-spacing:-1px;margin:20px 0 18px}        /* clamp:字号随屏幕自适应 */
  h1 em{font-style:normal;background:linear-gradient(120deg,var(--brand),var(--brand2));-webkit-background-clip:text;background-clip:text;color:transparent}
  .hero p{font-size:17px;color:var(--body);max-width:460px}
  .actions{display:flex;gap:12px;margin-top:30px}
  .visual{position:relative;height:340px;border-radius:24px;background:linear-gradient(150deg,#dfe8ff,#efe6ff 60%,#fff);overflow:hidden}
  .glass{position:absolute;left:34px;right:34px;top:48px;padding:20px;border-radius:16px;background:rgba(255,255,255,.75);border:1px solid #fff;box-shadow:0 18px 40px rgba(30,50,120,.14)}
  .bar{height:8px;border-radius:4px;background:#e8ecf7;margin:9px 0}                                  /* 占位条:代替真实截图 */
  .bar.s{width:62%}
  .section{padding:88px 0}
  .alt{background:var(--bg)}                                                                          /* 交替底色,区块自带分隔 */
  .head{max-width:620px;margin-bottom:44px}
  h2{font-size:clamp(26px,3vw,34px);letter-spacing:-.6px;margin-bottom:12px}
  .head p{color:var(--body)}
  .grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:22px}                                   /* 三卡等宽 */
  .card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:26px}
  .num{font-size:13px;font-weight:700;color:var(--brand);letter-spacing:1px}
  .card h3{font-size:19px;margin:14px 0 8px}
  .card p{font-size:14.5px;color:var(--body)}
  .stats{background:var(--ink);color:#fff;padding:56px 0}                                              /* 深色横带:放证明 */
  .stats .wrap{display:grid;grid-template-columns:repeat(3,1fr);gap:24px;text-align:center}
  .stats b{display:block;font-size:clamp(28px,3.4vw,40px);letter-spacing:-1px}
  .stats span{font-size:14px;color:rgba(255,255,255,.62)}
  .cta-box{margin:88px auto;max-width:1120px;border-radius:24px;padding:60px 32px;text-align:center;background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff}
  .cta-box p{color:rgba(255,255,255,.86);margin:12px 0 26px}
  .cta-box .btn{background:#fff;color:var(--brand)}                                                    /* 渐变底上用反色按钮 */
  footer{padding:40px 0;border-top:1px solid var(--line);font-size:14px;color:var(--body)}
  footer .wrap{display:flex;justify-content:space-between;flex-wrap:wrap;gap:12px}
  @media(max-width:900px){                                                                             /* 手机断点:全部塌单列 */
    .hero .wrap,.grid3,.stats .wrap{grid-template-columns:1fr}
    nav ul{display:none}
    .hero{padding:48px 0 64px}
    .visual{height:280px}
    .section{padding:60px 0}
    .cta-box{margin:56px 20px}
  }
</style>
</head>
<body>
<header><div class="wrap nav">
  <a class="logo" href="#top"><i></i>云图设计</a>
  <nav><ul><li><a href="#service">服务</a></li><li><a href="#proof">案例</a></li><li><a href="#contact">联系</a></li></ul></nav>
  <a class="btn btn-main" href="#contact">预约咨询</a>
</div></header>

<section class="hero" id="top"><div class="wrap">
  <div>
    <span class="tag">品牌视觉 · 官网设计</span>
    <h1>让中小品牌的<em>第一眼</em>,就有专业感</h1>
    <p>把一款产品、一家门店、一个工作室,做成一张能自己说话的网页。</p>
    <div class="actions"><a class="btn btn-main" href="#contact">免费看方案</a><a class="btn btn-line" href="#service">看看怎么做的</a></div>
  </div>
  <div class="visual"><div class="glass"><b>首页结构预览</b><div class="bar"></div><div class="bar s"></div><div class="bar s"></div></div></div>
</div></section>

<section class="section alt" id="service"><div class="wrap">
  <div class="head"><h2>三件事,做到位就够了</h2><p>不堆功能,不加花活:首屏、结构、入口,三块把话说清楚。</p></div>
  <div class="grid3">
    <div class="card"><div class="num">01</div><h3>首屏定调</h3><p>一句主标题、一句副标题、一个按钮,三秒说清你是做什么的。</p></div>
    <div class="card"><div class="num">02</div><h3>结构讲清</h3><p>服务、案例、价格按顺序排,访客自己往下读,不用猜。</p></div>
    <div class="card"><div class="num">03</div><h3>入口收口</h3><p>每个区块后面留一个联系入口,想咨询的人随时能找到你。</p></div>
  </div>
</div></section>

<section class="stats" id="proof"><div class="wrap">
  <div><b>120+</b><span>已交付的官网</span></div>
  <div><b>7 天</b><span>从需求到上线</span></div>
  <div><b>98%</b><span>客户复购或转介绍</span></div>
</div></section>

<section id="contact"><div class="cta-box">
  <h2>先把你的想法说给我们听</h2>
  <p>留个邮箱,48 小时内给你一页结构草案,不收费。</p>
  <a class="btn" href="mailto:[email protected]">[email protected]</a>
</div></section>

<footer><div class="wrap">
  <span>© <span id="year">2026</span> 云图设计 · 保留所有权利</span>
  <span>[email protected] · 周一至周五 10:00–19:00</span>
</div></footer>

<script>
  const header = document.querySelector('header');                                  // 取导航条
  addEventListener('scroll', () => {                                                // 监听页面滚动
    header.style.background = scrollY > 8 ? 'rgba(255,255,255,.95)' : 'rgba(255,255,255,.85)';  // 滚动后底色变实
  });
  document.getElementById('year').textContent = new Date().getFullYear();            // 页脚年份自动更新
</script>
</body>
</html>

These are the numbers measured from this code (you can re-check): 13.6 KB, 6 semantic sections, 0 external requests (no CDN, no external images, no external fonts), console 0 errors; at 1440px and 390px widths scrollWidth equals clientWidth, meaning no horizontal scrollbars. The visual's circles, gradient cards, and placeholder bars are all drawn with CSS, so it displays fully even offline.

8. How to double-click open on the desktop

① Show file extensions first. Windows hides known extensions by default, and this is the #1 reason for "I saved it as html but it became txt." Open any folder → top "View" → check "File name extensions" (Win11: "View → Show → File name extensions").

② Create a new folder website. Recommended to put it on the desktop. All images go in an images subfolder inside this folder; the whole folder is a website.

③ Save with Notepad. Paste code into Notepad → File → Save As → file name fill index.html (quotes are safer) → Save as type select "All Files" → Encoding select UTF-8 → Save. The file name must be index.html, because the browser looks for it by default when opening a folder.

④ Double-click. After the icon changes to a browser icon, double-click to open in the default browser. To change the browser: right-click → Open With → choose Chrome or Edge → check "Always use this app."

⑤ If it won't open or is a blank screen, only check these 5 items. This table covers almost all cases:

Symptom Cause Solution
File name shows index.html.txt System hides extensions, you typed it twice Turn on "File name extensions" first, then rename to index.html
Double-click opens with Notepad .html default program was set to Notepad Right-click → Open With → Chrome/Edge → Always use
Page is all blank File is empty, or encoding selection wrong causing garbled Chinese Open file to confirm code exists; when saving select UTF-8
Layout all messed up, like plain text style tag not closed, or copy was truncated Check that </style> and </html> are at the end of file
Images all broken AI gave C:\... absolute path or https:// external link Put images in images/, change path to images/a.jpg
Console reports CORS error Code uses fetch() to read local files Have AI write data directly as JS array, remove fetch

The last item deserves separate mention: local double-click runs under the file:// protocol, and browsers, for security reasons, don't allow it to use fetch() to read files in the same directory; the console reports CORS request not HTTP (see MDN's explanation). For beginners the simplest handling is: don't let AI use fetch; write data that needs to be shown directly into a JS array.

⑥ To send to someone else. Right-click the website folder → Send To → Compressed (zipped) folder, send the zip. After unpacking, they double-click the same index.html. This works only because of the "single file + zero external links" requirement from Section 4 cell ⑤.

References for local opening and CORS:

9. Symptom → cause → solution table

Symptom Cause Solution
AI-generated page looks like a template from ten years ago Prompt only has company intro, no structure or style Add the six-cell checklist from Section 4; give sections and copy first
Page gets messier and messier, more and more colors Asking for the whole site at once, context lost in the second half Generate in three segments: skeleton → hero → mobile
Saying "make it more grand" produces no change Style words are not verifiable Replace with numbers: content area 1120px, spacing 88px, 1 primary color
Text on mobile squeezes into one column No breakpoints written, AI defaults to no responsive Add "collapse to single column below 900px" to prompt
Double-click opens blank screen Extension has an extra .txt layer Show extensions, rename to index.html
Images all lost on another computer Used absolute path or remote image links Put images in images/, write relative paths
Sending to someone else opens source code Receiver has no default browser association Have them right-click → Open With → choose browser

Three most common pitfalls, none technical:

  1. Asking it to write the entire site in one go. With 800 lines of output, in the second half it starts improvising: two nav variants, three button corner radii. Segment generation gives each segment a checkable boundary.
  2. Only saying "reference XX website" without boundaries. Result copies copy and colors too, looking like a knockoff. The right phrasing is "only reference layout structure and information density; copy, colors, and icons all redone from scratch."
  3. Using remote image links AI provides. Those https://images.unsplash.com/... links break or the recipient is offline, and the page immediately becomes a mess of broken images. Avoid images when possible; gradients, color blocks, and inline SVG are enough for a homepage.

10. Pre-release acceptance checklist

Copy these 6 items to AI, have it answer "yes / no" item by item, and you only check the results:

If you have brand copy and product images, go with "hero two columns + full-screen visual"; if you only have a company name and a phone number, compress the six sections to four and support the first screen with whitespace and font hierarchy. Whether a website looks good is never decided by how many assets you have; it's decided by whether the structure is clear.