Works on this device
HTML Element Generator
Choose what you want to make and type the values. The page writes clean HTML code that you can copy into your own page. Every character you type is made safe, and nothing is sent to a server.
Choose and type the values
Check these values
Your values are worked out in this browser. They are not sent to a server.
Your HTML will show here
Type the values, or choose Try an example.
Your HTML
How it was worked out
How to use the generator
- Choose what you want to make: text with a tag, a link, an image, a button, a list, a form, or moving text.
- Type the values, or choose Try an example to see how it works. The code shows as you type.
- Open More options for a class name, an id and the less common settings.
- Choose Copy text or Download file, and put the code into your page.
What each choice makes
- Text with a tag: a paragraph, a heading, a quote or a
preblock, with a tag inside it such asstrong(bold),em(italic),mark(highlight),sup,sub,codeorabbr. Colour, size, alignment and font are written as astyleattribute. - Link: an
aelement to a web page or file, an email address, a phone number, a place in the same page, or a WhatsApp chat. It can open in a new tab. - Image: an
imgelement with alt text, width and height, and if you want lazy loading, a caption (figure), a link around it, or a second file format (picture). - Button: a
buttonelement of the type button, submit or reset, or a link to a page. - List: a bullet list, a numbered list with sub-items, a list of terms with their descriptions, or a drop-down list with its label.
- Form: fields with their labels. Text, email, password, phone, number, date, text area, drop-down list, radio buttons, tick box and file. Required fields, the shortest text and the autocomplete value are written as attributes.
- Moving or blinking text: HTML and CSS that do what the old
marqueeandblinktags did, with a way to stop the movement.
Worked examples
- Bold text: the text
Order by Fridaywith the block Paragraph and the tag Important, shown bold gives<p><strong>Order by Friday</strong></p>. - Link: the address
www.example.com/prices, the wordsSee our pricesand Open in a new tab give<a href="https://www.example.com/prices" target="_blank" rel="noopener noreferrer">See our prices</a>. The page addshttps://, because without it a browser would look for a file of your own site. - Image: the address
https://www.example.com/img/tulips.jpg, the alt textRed tulips in a garden, width 800 and height 600 give<img src="https://www.example.com/img/tulips.jpg" alt="Red tulips in a garden" width="800" height="600" style="max-width: 100%; height: auto">. - Special characters: the text
Fish & chips < 5 eurosbecomesFish & chips < 5 euros, so a browser shows the text as you typed it.
Blink and marquee today
The blink tag is not part of HTML, and current browsers show its text without blinking. The marquee tag is marked in the HTML Standard as a tag that pages must not use any more, even though many browsers still move its text.
This page makes the two effects with CSS. Moving text gets a tick box that pauses it, because text that moves for more than five seconds must have a way to stop it. Blinking text blinks at most a few times, never more than three times in a second, and then stays on. Both stand still for people who ask their device for less motion.
Good habits that the page follows
- Every picture gets alt text, or an empty
alt=""when you say that it is only decoration. - Every form field gets a label that is tied to it. A group of radio buttons gets a
fieldsetwith alegend. - A link that opens a new tab gets
rel="noopener noreferrer". - A button always gets its type, and what goes to another page is written as a link, not as a button.
- The old tags
fontandcenterare not written. Their work is done by astyleattribute.
Limits you should know
- The page writes code. It does not show a picture of the result, and it does not load your image or open your link. Test the code in your own page.
- An address may start with
https://orhttp://, or be an address inside your own site. Addresses that start withjavascript:ordata:are refused. - The form is HTML only. The browser does the simple checks, but the program that gets the form must check every value again. This page does not make that program and no script.
- One element at a time. For a styled button, a navigation bar, a card or an image slider with its CSS, use the UI Component Generator. For a table, use the HTML Table Generator.
- Meta tags for search engines and social cards, and links with campaign (UTM) values, are not made here.
- Audio, video and embedded frames are not made here.