How do you do text in html?
Lesson 3: Text Elements in HTML/en/basic-html/create-a-webpage/content/ Adding text elements in HTMLThis lesson is part of a series on computer programming. You can go to Intro to Programming if you'd like to start at the beginning. Some of the most common HTML elements that make up a webpage are text elements. All the text you read on this website, for example, whether it's the titles at the top of the page, the section headers, or this very text, is made from HTML text elements. The paragraph elementThe most basic way of adding text to a web page is the paragraph element. If you've been following along with this tutorial, you've seen this element before, but it's worth repeating, because the paragraph element is one of the most common HTML elements used on most of the websites you visit every day.
By default, every browser puts a bit of space above and below paragraph elements when they display them, which keeps each paragraph independent from the ones around it, just like the paragraphs you'd see printed in a book or magazine. The heading elementsLike the paragraph element, heading elements are also used to display text on the screen. They're generally used to create section headings.
For example, you might use a heading element to display the title of an essay you're writing, or the name of a chapter in a book. The actual text of the essay or chapter, on the other hand, would use paragraph elements. Heading elements come in six default levels, They also come with some default browser styling, which reinforces that order of importance: the
Text formatting elementsText formatting elements are used to change the way text looks in certain predefined ways. For instance, here are a few common text formatting elements:
These elements are usually found nested inside of other text elements, such as the paragraph or heading elements, because they are usually only meant to apply to part of the text. For example:
That HTML would be displayed like this: Try this!Try experimenting with each of the elements covered in this lesson in the input below. You can enter whatever you want, but if you need some ideas on what to enter, try using the elements below as an example.
Enter your HTML elements in the input here: Do it yourself!Open the index.html file of your GCF Programming Tutorials project in your text editor, and let's add some text elements. For the best understanding, be sure to actually type this code in, rather than copying and pasting it.
Once you've done all of this, your complete code should look like this:
Double-click your index.html file to load it in the browser, and you should see this. Your webpage is starting to look a little more like an actual webpage! /en/basic-html/lists-in-html/content/ How do you start a text in HTML?All HTML documents must start with a document type declaration: . The HTML document itself begins with and ends with . The visible part of the HTML document is between and .
What is the HTML tag for text?The p tag. This tag defines a paragraph of text. It's a block element. Inside it, we can add any inline element we like, like span or a .
|