tags Flashcards
HTML headings
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
paragraphs
defined by <p> tag
i.e
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
links
HTML links are defined with the <a> tag.
i.e
<a>This is a link</a></a>
images
defined by <img></img> tag
<img></img>
empty elements
HTML elements with no content are called empty elements.
<br></br> is an empty element without a closing tag (the <br></br> tag defines a line break).
Tip: In XHTML, all elements must be closed. Adding a slash inside the start tag, like <br></br>, is the proper way of closing empty elements in XHTML (and XML).
HTML attributes
-HTML elements can have attributes
-Attributes provide additional information about an element
-Attributes are always specified in the start tag
-Attributes come in name/value pairs like: name=”value”
HTML links are defined with the <a> tag. The link address is specified in the href attribute:
<a>This is a link</a></a>
HTML lines
The <hr /> tag creates a horizontal line in an HTML page.
The hr element can be used to separate content: <p>This is a paragraph</p> <hr /> <p>This is a paragraph</p> <hr /> <p>This is a paragraph</p>
HTML Comments
Comments can be inserted into the HTML code to make it more readable and understandable. Comments are ignored by the browser and are not displayed.
Comments are written like this:
<!–This comment will not be displayed–>
<p>This is a regular paragraph</p>
HTML Tip - How to View HTML Source
Have you ever seen a Web page and wondered “Hey! How did they do that?”
To find out, right-click in the page and select “View Source” (IE) or “View Page Source” (Firefox), or similar for other browsers. This will open a window containing the HTML code of the page.
HTML lines
The <hr /> tag creates a horizontal line in an HTML page.
The hr element can be used to separate content: <p>This is a paragraph</p> <hr /> <p>This is a paragraph</p> <hr /> <p>This is a paragraph</p>
HTML Comments
Comments can be inserted into the HTML code to make it more readable and understandable. Comments are ignored by the browser and are not displayed.
Comments are written like this:
<!–This comment will not be displayed–>
<p>This is a regular paragraph</p>
How to View HTML Source
Have you ever seen a Web page and wondered “Hey! How did they do that?”
To find out, right-click in the page and select “View Source” (IE) or “View Page Source” (Firefox), or similar for other browsers. This will open a window containing the HTML code of the page.
heading
defined by tag
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
heading
defined by tag
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
line breaks
Use the <br></br> tag if you want a line break (a new line) without starting a new paragraph:
<p>This is<br></br>a para<br></br>graph with line breaks</p>