Simple web page coding in html
There are the following different examples implemented for creating the simple HTML pages using the different basic tags: Show Example 1: This example creates a simple page without any content, which helps in understanding how to use the Html, Head, and Body tag in the HTML page. In the following example, we have not specified the title of the web page in the Head tag, so it will display the name of Html file as its title. Test it NowOutput: Example 2: This example creates a page which helps in understanding how to give a title to a web page. Test it NowOutput: Example 3: This example creates a web page which helps in understanding how to make the text bold, italic, and underline. Test it NowOutput: Example 4: This example creates a web page which helps in understanding how to use the tag. Test it NowOutput: Example 5: This example creates a web page which helps in understanding how to define all header levels. In HTML, there are 6 header levels from h2 to h6. Test it NowOutput: Example 6: This example creates a web page which helps in understanding how to align the text in center, and how to break a line. Test it NowOutput: Example 7: The following example describe how to link one page to another. Test it NowOutput: HTML (HyperText Markup Language) is the code that is used to structure a web page and its content. For example, content could be structured within a set of paragraphs, a list of bulleted points, or using images and data tables. As the title suggests, this article will give you a basic
understanding of HTML and its functions. HTML is a markup language that defines the structure of your content. HTML consists of a series of
elements, which you use to enclose, or wrap, different parts of the content to make it appear a certain way, or act a certain way. The enclosing tags can make a word or image hyperlink to somewhere else, can italicize words, can make the font bigger or smaller, and so on. For example, take the following line
of content: If we wanted the line to stand by itself, we could specify that it is a paragraph by enclosing it in paragraph tags:
Anatomy of an HTML element
Let's explore this paragraph element a bit further.
The main parts of our element are as follows:
Elements can also have attributes that look like the following:
Attributes contain extra information about the element that you don't want to appear in the actual content. Here, An attribute should always have the following:
Note:
Simple attribute values that don't contain ASCII whitespace (or any of the characters Nesting elementsYou can put elements inside other elements too — this is called nesting. If we wanted to state that our cat is very grumpy, we could wrap the word "very" in a
You do however need to make sure that your elements are properly nested. In the example above, we opened the
The elements have to open and close correctly so that they are clearly inside or outside one another. If they overlap as shown above, then your web browser will try to make the best guess at what you were trying to say, which can lead to unexpected results. So don't do it! Empty elementsSome elements have no content and are called empty elements. Take the
The keywords for alt text are "descriptive text". The alt text you write should provide the reader with enough information to have a good idea of what the image conveys. In this example, our current text of "My test image" is no good at all. A much better alternative for our Firefox logo would be "The Firefox logo: a flaming fox surrounding the Earth." Try coming up with some better alt text for your image now. Marking up textThis section will cover some of the essential HTML elements you'll use for marking up the text. HeadingsHeading elements allow you to specify that certain parts of your content are headings — or subheadings. In the same way that a book has the main title, chapter titles, and subtitles, an HTML document can too. HTML contains 6 heading levels, - |