HTML sirf screen pe cheezein dikhane ke liye nahi hota ,ye content ko meaning dene ka kaam karta hai. AI jo tum cahol wo HTML generate kar sakta hai, lekin quality depend karti hai is baat pe ki tumne structure ko kitna achhe se describe kiya hai.
Har web page ek hi foundation se start hota hai:
(AI Prompt for ChatGPT/Claude/Gemini)
Create a semantic HTML5 page structure for a [type of page: landing page / blog post / portfolio / product page].
Include:
- DOCTYPE and html lang attribute
- Head: meta charset, viewport, title, meta description
- Body structure using semantic elements:
- header (site branding + navigation)
- main (primary content area)
- footer (copyright, links, contact)
- Landmark roles where appropriate
- Skip navigation link for accessibility
Do NOT include any CSS or JavaScript just clean, semantic HTML.
Is response ko ek Notes file mein save kar lo. Sabse high-leverage suggestion pick karo aur isi hafte us pe act karo ,sab kuch ek saath try mat karo.
Kyunki jab early prompts mein concerns mix ho jaate hain, toh code messy ban jaata hai. Jab AI HTML, CSS aur JavaScript ek saath generate karta hai, toh wo aksar HTML structure pe corners cut karta hai taaki styling fast ho jaye. HTML only request karne se AI proper semantics aur accessibility pe focus karne ke liye forced hota hai aur yahi foundation hai jis pe baaki sab kuch build hota hai.
Navigation
Navigation sabse complex HTML components mein se ek hai sahi tarike se banana:
(AI Prompt for ChatGPT/Claude/Gemini)
Create a semantic navigation component for a website with these pages:
- Home
- About
- Services (with dropdown: Consulting, Training, Support)
- Blog
- Contact
Requirements: - Use nav element with aria-label
- Use unordered list structure
- Dropdown must be keyboard-accessible (Enter to open, Escape to close, Arrow keys to navigate)
- Include aria-expanded and aria-haspopup for the dropdown trigger
- Mark the current page with aria-current=”page”
- Mobile-friendly structure (will add CSS later)
HTML only, no CSS or JavaScript yet.
Forms wahan hote hain jahan accessibility sabse zyada matter karti hai:
(AI Prompt for ChatGPT/Claude/Gemini)
Create an HTML form for [purpose: contact / registration / checkout / survey].
Fields:
- [field name] — [type: text/email/tel/select/textarea/checkbox/radio] — [required/optional]
- [field name] — [type] — [required/optional]
- [repeat for all fields]
Accessibility requirements:
- Every input has a label element linked via for/id
- Required fields marked with aria-required=”true” and visual indicator
- Error message containers with aria-describedby linking to each input
- Fieldset/legend for related groups (radio buttons, checkboxes)
- Submit button (not input type=”submit”)
- Form has an accessible name via aria-label or aria-labelledby
Include placeholder text only where it adds value (not as a label replacement).
Content Sections
Article aur Blog Post Structure
Create semantic HTML for a blog post page:
Content structure:
- Article title (h1)
- Author name and publish date (with time element)
- Featured image with descriptive alt text
- Article body with:
- 3-4 sections with h2 headings
- A blockquote
- An ordered list
- A code snippet (use pre + code elements)
- Tags/categories section
- Author bio box
- Related posts section (3 cards with title, excerpt, link)
Use article, section, aside, figure, figcaption, time elements appropriately.
Cards aur Listing Pages
(AI Prompt for ChatGPT/Claude/Gemini)
Create semantic HTML for a listing page showing [products / blog posts / team members / portfolio items]:
Page structure:
- Page heading (h1) with item count
- Filter/sort controls (using form elements)
- Grid of cards, each containing:
- Image with alt text
- Title (h3, linked)
- Brief description
- [metadata: price / date / role / tags]
- Call-to-action link or button
- Pagination (using nav element with aria-label=”Pagination”)
Use unordered list for the card grid (li for each card). Each card should be an article element.
HTML Verification Checklist
AI ke HTML generate karne ke baad, is checklist se guzro:
Review this HTML for quality and accessibility:
[paste your HTML]
Check for:
- Semantic elements used correctly (not div soup)
- Heading hierarchy (h1 → h2 → h3, no skipped levels)
- All images have meaningful alt text (not “image” or empty for decorative)
- Form inputs have associated labels
- Links have descriptive text (not “click here”)
- Language attribute on html element
- Meta viewport for responsive design
- No inline styles or scripts
- Valid HTML5 structure
List any issues found and provide corrected code.
Screen reader users headings ke level se navigate karte hain ;h1 se h2, phir h3, ekdum table of contents jaisa. Agar h1 se directly h3 pe jump karoge, toh ek gap ban jaata hai jo is navigation ko confuse kar deta hai. Heading hierarchy koi visual decoration nahi hai (wo CSS ka kaam hai) — ye document structure hai jis pe assistive technology rely karti hai.
