Getting started
- Beginner web design
- Web design software
HTML & CSS
- HTML beginner
- CSS beginner
- HTML advanced
Server & hosting
- Web hosting guide
HTML textText is kingNo matter how many fancy effects and animations websites may have, the primary driving force of the internet has and will always be text content. Therefore, one of the first things you should learn about HTML is how to properly structure and present textual information. ParagraphsThe most basic tool HTML offers is the paragraph element HTML paragraph:<p>Donec at enim. Nunc ac leo. Proin nec odio. In id odio sed neque varius rutrum. Sed tellus. Vestibulum enim lacus, cursus id, tempus nec, consequat ac, nibh. Nulla facilisi. Donec vestibulum ante. Nulla facilisi.</p>
<p>Nulla quam sem, pulvinar id, adipiscing feugiat, aliquet vitae, velit. Curabitur pretium sem vel massa consequat vehicula.</p> Output:Line breaksMaybe you've noticed the line break after Nulla quam sem, in the code of the second paragraph above and wondered why it doesn't look the same in the web page output. HTML ignores line breaks and two or more consecutive spaces. If you want to add a line break you have to tell HTML explicitly by using the line break tag
HTML line-break:<p>Nulla quam sem,<br />pulvinar id, adipiscing feugiat, aliquet vitae, velit. Curabitur pretium sem vel massa consequat vehicula.</p>
Output:Strong and emphasized textIf you wish to give extra weight to certain text parts you can use the strong tag HTML strong and emphasize:<p>this is <strong>strong</strong> text<br />
this is <em>emphasized</em> text</p> Display:Output:Because these tags are meant to give more importance to the enclosed text, they should only be used for that purpose and not just to give text a bold or italic appearance. You'll soon learn in the CSS beginner tutorial of a much better way for doing exactly this. Remember that HTML is meant to be used for structure and semantics while CSS is for changing the style and appearance of a document. |