HTML <p> Tag

Example A paragraph is marked up as follows: <p>This is some text in a paragraph.</p> Try it Yourself » More “Try it Yourself” examples below. Definition and Usage The <p> tag defines a paragraph. Browsers automatically add some space (margin) before and after each <p> element. The margins can be modified with CSS (with the […]

HTML DOM Superscript Object

Superscript Object The Superscript object represents an HTML <sup> element. Access a Superscript Object You can access a <sup> element by using getElementById(): Example var x = document.getElementById(“mySup”); Try it Yourself » Create a Superscript Object You can create a <sup> element by using the document.createElement() method: Example var x = document.createElement(“SUP”); Try it Yourself » Standard […]

HTML Paragraphs

The HTML <p> element defines a paragraph: Example <p>This is a paragraph.</p> <p>This is another paragraph.</p> Try it Yourself » Note: Browsers automatically add some white space (a margin) before and after a paragraph. HTML Display You cannot be sure how HTML will be displayed. Large or small screens, and resized windows will create different results. With HTML, you […]