How to Build Websites with Claude AI (Using Artifacts)
Introduction
Claude AI from Anthropic has become a go-to tool for building websites thanks to its Artifacts feature, which renders HTML, CSS, and JavaScript in a live preview right inside the conversation. You describe what you want, Claude writes the code, and you see the result instantly without leaving your browser.
This approach to web development is fast, visual, and surprisingly capable. In this guide, we cover the full workflow for building a functional website with Claude, from crafting your first prompt to iterating on the design to getting your finished site hosted and live.
š Host your project free ā Deploy your AI-built site instantly on Linkyhost
Why Use Claude for Web Development?
Claude brings several advantages to the website-building process that set it apart from other AI tools:
- Live preview with Artifacts lets you see rendered output immediately, catching layout and styling issues in real time
- Long context window means Claude can hold your entire website's code in memory during a conversation, making multi-page projects feasible
- Strong reasoning capabilities help Claude understand design intent and translate vague descriptions into well-structured code
- Iterative refinement is natural since you can keep asking for changes in the same conversation and Claude remembers all prior context
The Artifacts feature is the real differentiator. When Claude generates HTML code, it renders in a side panel where you can interact with it, test links, fill out forms, and verify responsive behavior. This immediate feedback loop speeds up development dramatically.
Step 1: Plan Your Website Structure
Before prompting Claude, spend a few minutes outlining what you need. Having a clear plan produces much better results than improvising.
Write down:
- The purpose of your site (portfolio, landing page, business site, blog)
- How many pages you need
- What sections each page should contain
- Any specific design preferences (color scheme, style, layout)
- Whether you need interactive features (forms, animations, navigation)
This preparation pays off because more specific prompts generate better code on the first try, reducing the number of revision cycles needed.
Step 2: Generate Your First Page
Open Claude and start with your main page. Here is an example prompt structure that consistently produces solid results:
Build me a single-page portfolio website with the following specs:
Structure:
- Fixed navigation bar with links to each section
- Hero section with my name, title, and a brief tagline
- About section with a photo placeholder and bio text
- Projects section with 4 project cards in a responsive grid
- Skills section with progress bars or tags
- Contact section with a working contact form layout
- Footer with social links
Design:
- Modern, minimal aesthetic
- Dark background (#0f172a) with light text
- Accent color: #6366f1 (indigo)
- Use Inter or system fonts
- Smooth scroll between sections
- Subtle hover animations on buttons and cards
Technical:
- Single HTML file with embedded CSS and JavaScript
- Fully responsive (mobile, tablet, desktop)
- Semantic HTML5 elements
- CSS Grid and Flexbox for layouts
Claude will generate the complete code and render it as an Artifact. Review the preview carefully before moving on.
Step 3: Iterate on the Design
Rarely does the first version match exactly what you have in mind, and that is expected. The strength of working with Claude is how quickly you can iterate.
Use follow-up prompts to refine specific aspects:
Adjusting layout:
Move the skills section above the projects section.
Make the project cards 3 columns on desktop instead of 4.
Refining typography:
Increase the hero heading to 4rem. Add a gradient text effect
using the accent color transitioning to #a78bfa. Make paragraph
text 1.1rem with 1.7 line height.
Adding animations:
Add a fade-in-up animation for each section as the user
scrolls down. Use Intersection Observer, not scroll event
listeners. Stagger the animation for project cards so they
appear one after another.
Improving mobile experience:
On mobile, make the navigation a full-screen overlay menu.
Stack the about section photo above the text. Make project
cards single column with larger touch targets.
Each prompt builds on the previous version. Claude maintains the full context of your conversation, so you do not need to repeat earlier instructions.
Step 4: Build Additional Pages
If your site needs multiple pages, generate each one in a separate prompt while referencing the design established in your first page:
Create a blog listing page that matches the design of my
portfolio (same colors, fonts, navigation). Include:
- Page header with "Blog" title
- Grid of blog post cards with title, date, excerpt, and
read more link
- Sidebar with categories and recent posts
- Same footer as the main page
When working with multiple files, keep a mental map of your file structure. A typical Claude-built site might include:
my-website/
āāā index.html
āāā blog.html
āāā contact.html
āāā css/
ā āāā styles.css
āāā js/
āāā main.js
For multi-page sites, it is usually better to ask Claude to generate a shared CSS file separately, then reference it from each HTML page. This keeps your styling consistent and makes updates easier.
Step 5: Extract and Organize Your Code
Once you are happy with the result, you need to get the code out of Claude and into files on your computer.
For each Artifact, click the copy button to grab the code. Then:
- Create a project folder on your computer
- Save HTML files at the root level
- Create
css/andjs/subfolders for stylesheets and scripts - If Claude generated everything in a single HTML file, you can either keep it that way or ask Claude to split it:
Split this single-file website into separate files:
- index.html (HTML structure only, with link/script tags)
- css/styles.css (all CSS)
- js/main.js (all JavaScript)
Show me all three files.
Step 6: Test Locally
Before deploying, open your HTML files in a browser to verify everything works:
- Check all navigation links
- Test the responsive design by resizing your browser window
- Verify form layouts (even if they do not submit anywhere yet)
- Test all animations and interactive elements
- Check for console errors in your browser's developer tools
Fix any issues by going back to Claude with specific descriptions of what is broken.
Step 7: Deploy to Linkyhost
With your files ready, deploying is straightforward. Linkyhost lets you host static websites for free:
- Visit Linkyhost and create an account or sign in
- Upload your website files (drag and drop works for folders)
- Get your live URL instantly
Your site is now accessible to anyone with the link. For detailed upload instructions, see our guide on how to host an HTML file.
If you are building an AI-generated site for the first time, our dedicated walkthrough on hosting AI-generated websites covers additional tips specific to AI-built projects.
Advanced Techniques
Using Claude for CSS-Only Redesigns
If you have an existing website that needs a visual refresh, paste your HTML into Claude and ask for a CSS redesign:
Here is my current HTML. Write new CSS that gives it a
modern, professional look. Keep the HTML structure unchanged.
Use a blue and white color scheme with rounded corners,
subtle shadows, and smooth transitions.
This is a fast way to modernize an old site without restructuring the markup.
Generating SVG Graphics
Claude can create custom SVG icons and illustrations for your site:
Create an SVG icon set for my portfolio: a code bracket icon,
a paintbrush icon, a rocket icon, and an envelope icon. Use
a consistent 24x24 viewBox with 2px stroke width. Output as
inline SVG elements I can paste into my HTML.
Building Interactive Components
Claude handles JavaScript-driven components well. You can request:
- Image carousels and lightboxes
- Accordion FAQ sections
- Tab interfaces
- Modal dialogs
- Form validation with error messages
- Dark/light theme toggles
Each component is generated with the HTML, CSS, and JavaScript together, making it easy to integrate into your site.
Common Mistakes to Avoid
Trying to build too much in one prompt. Complex multi-page sites work better when you build one page at a time and iterate. Massive initial prompts tend to produce generic results.
Not specifying responsive behavior. Always mention mobile and tablet layouts in your prompts. If you leave this out, Claude may generate a desktop-only design.
Ignoring accessibility. Ask Claude to include proper ARIA labels, alt text, keyboard navigation, and sufficient color contrast. Add this as a requirement in your initial prompt rather than trying to retrofit it later.
Skipping the testing step. The Artifact preview is helpful but does not catch everything. Always test the exported files in an actual browser before deploying.
Frequently Asked Questions
Is Claude AI free for building websites?
Claude offers a free tier with limited usage. For building a typical website, you may need several conversations worth of messages. The Pro plan provides higher limits and access to the most capable models, which is worthwhile if you plan to build multiple sites.
Can Claude build multi-page websites?
Yes, though you need to generate each page in the conversation and manually create the file structure. Claude can produce consistent designs across pages when you reference the established styling. For complex multi-page sites, consider using a framework like the ones described in our vibe coding guide.
How do I add images to a Claude-generated website?
Claude generates placeholder elements for images. After exporting the code, replace the placeholder src attributes with paths to your actual image files. You can also ask Claude to use placeholder services like placehold.co during development so the layout looks realistic.
Can I use Claude to build a website with a framework like React?
Claude can generate React, Vue, and other framework code. However, the Artifacts preview only renders vanilla HTML/CSS/JS. For framework-based projects, you will need to copy the generated components into a local development environment to test and build them.
What is the best way to handle forms on a Claude-built site?
Claude generates the form HTML and client-side validation, but you need a backend service to actually receive submissions. Options include Formspree, Netlify Forms, or a simple email service integration. Ask Claude to integrate with one of these in your prompt.
How do I make a Claude-generated site SEO-friendly?
Include SEO requirements in your prompt: proper heading hierarchy, meta description, Open Graph tags, semantic HTML, and alt text for images. After generating the site, you can further optimize using the techniques in our SEO for static websites guide.
Conclusion
Claude AI with Artifacts provides one of the most accessible paths from idea to finished website. The live preview, strong code generation, and natural iterative workflow make it possible to build professional-looking sites without deep technical expertise.
The key is working in focused steps: plan your structure, generate the foundation, iterate on details, test thoroughly, and deploy. With Linkyhost's free hosting, the final step takes seconds.
For more on getting AI-generated sites online, explore our guide to hosting AI-generated websites on Linkyhost.