liveBook · Manning

Prompt

As explained in Build a Website with ChatGPT

A prompt is a natural-language instruction or request supplied to an artificial-intelligence model to guide its response.

A prompt is the request you type to tell an AI system what you want it to create. For web work, it can ask for page code, writing ideas, titles, design suggestions, or revisions. A prompt may be one sentence or several paragraphs, but clear requests usually produce more useful results. section 1.4.1 section 1.5

Treat a prompt like a compact project brief. State the job first, then name the content, structure, files, and appearance you need. For example, ask separately for HTML and CSS, identify image filenames, specify headings and page sections, and give colors, fonts, sizes, links, and layout limits when they matter. Specific details help turn an idea into code you can save and test. section 4.2.6 section 4.5

Build a practical web-page prompt in this order:

  • Say what you want to build and, if needed, say that you need the code generated for you. section 5.2.3
  • List the page content: headers, sections, text, images, navigation, links, and footer details. section 6.2.3
  • Request styling in a separate CSS file, including colors, fonts, text sizes, and a maximum content width. section 7.3.2
  • Copy the generated HTML and CSS into the requested files, then keep related files in the same folder. section 4.2.6

A small first prompt

“Write web page code to display ‘Hello World!’ in a large font.” The response can include HTML that creates the requested page. Generated code can vary between runs while still producing a similar result, so judge the page by what it does rather than expecting identical code. section 1.4.2

Write web page code to display “Hello World!” in a large font.

Use this short request as a copyable starting point for seeing the prompt-to-code workflow. section 1.4.2

Prompting is iterative. After receiving code, ask whether it matches what you wanted and test whether it works. If the page is far off, rewrite the prompt and try again; if it is close, request targeted adjustments in the same chat session. Good prompts improve results, but even a good request can occasionally produce unusable or strange output. section 1.4.6 section 1.4.1

Prompts also support creative work beyond page code. Assigning a role can focus an idea request, such as asking an expert on a topic for beginner post ideas or asking a writing coach for ways to introduce that topic. Use the suggestions as a starting point, then add your own details. section 7.2.1 section 7.2.2

How Build a Website with ChatGPT covers it

How deep it goes
Explains prompt construction, generated HTML/CSS handling, testing, and iterative revision without model internals.
Examples
Uses Hello World!, a book club page, an online journal, an information site, and bread-baking writing ideas.
What it assumes
Assumes no web-development coding knowledge while teaching requests that ask ChatGPT to supply the code.
What you can do after
Apply it via ChatGPT to request, refine, test, and save code for simple web pages.
How it connects
Connects prompts with ChatGPT, HTML, CSS, web hosting, navigation, and content creation.

Also explained in

Compare how 50 books explain prompt →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Website with ChatGPT. The section links point to the parts of the book it draws on.