Here’s a super-ultra-technical definition of a block of text: some chunk of content that wraps from one line to another inside an HTML element.
Your HTML page is a giant collection of blocks of text:
HTML recognizes several kinds of text blocks that you can use in your document, including (but not limited to)
Paragraphs are used more often in Web pages than any other kind of text block.
HTML browsers don’t recognize the hard returns that you enter when you create your page inside an editor. You must use a <p> element to tell the browser to separate the contained block of text as a paragraph.
To create a paragraph, follow these steps:
Here’s what it looks like:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”><html xmlns=”http://www.w3.org/1999/xhtml”><head><meta http-equiv=”Content-Type” content=”text/html; charset=ISO-8859-1” /><title>All About Blocks</title></head><body><p>This is a paragraph. It’s a very simple structure that you will use time and again in your Web pages.</p><p>This is another paragraph. What could be simpler to create?</p></body></html>
This HTML page includes two paragraphs, each marked with a separate <p> element. Most Web browsers add a line break and full line of white space after every paragraph on your page, as shown in Figure.
Figure : Web browsers delineate paragraphs with line breaks.
Some people don’t use the closing </p> tag when they create paragraphs. Although some browsers let you get away with this, leaving out the closing tag
You can control the formatting (color, style, size, and alignment) of your paragraph by using Cascading Style Sheets (CSS).
By default, the paragraph aligns to the left. You can use the align attribute with a value of center, right, or justify to override that default and control the alignment for any paragraph.
<p align=”center”>This paragraph is centered.</p><p align=”right”>This paragraph is right-justified.</p><p align=”justify”>This paragraph is double-justified.</p>
Figure shows how a Web browser aligns each paragraph according to the value of the align attribute.
The align attribute has been deprecated (rendered obsolete) in favor of using CSS.
Headings break a document into sections. This book uses headings and subheadings to divide every chapter into sections, and you can do the same with your Web page. Headings can
HTML includes six elements to help you define six different heading levels in your documents:
Follow heading order from highest to lowest as you use HTML heading levels. That is, don’t use a second-level heading until you’ve used a first-level heading, don’t use a third-level heading until you’ve used a second, and so on. If you want to change how headings appear in a browser.
Figure : Use the align attribute with a paragraph to specify the horizontal alignment.
To create a heading, follow these steps:
Every browser has a different way of displaying heading levels, and we cover that in the following two sections.
Most graphical browsers use a distinctive size and typeface for headings:
The following excerpt of HTML markup shows all six headings at work:<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”><html xmlns=”http://www.w3.org/1999/xhtml”><head><meta http-equiv=”Content-Type” content=”text/html; charset=ISO-8859-1” /><title>All About Blocks</title></head>
Figure shows this HTML page as rendered in a browser.
You can use CSS to format such heading aspects as color, size, line height, and alignment.
By default, most browsers use Times New Roman fonts for all headings. The font size decreases as heading level increases. (Default sizes for first- through sixth-level headings are, respectively, 24, 18, 14, 12, 10, and 8.) You can override any of this formatting by using CSS.
Figure : Web browsers display headings in decreasing size from level one to level six.
Text-only browsers use different heading conventions than graphical browsers because text-only browsers display all content using a single size and font.
HTML 4 Related Interview Questions
|XML Interview Questions||HTML 4 Interview Questions|
|HTML Interview Questions||HTML 5 Interview Questions|
|HTML DOM Interview Questions||Java Interview Questions|
|CSS Interview Questions||Java Abstraction Interview Questions|
|Dynamic HTML Interview Questions||XHTML Interview Questions|
Html 4 Tutorial
The Least You Need To Know About Html And The Web
Creating And Viewing A Web Page
Proper Planning Prevents Poor Page Performance
Creating (x)html Document Structure
Text And Lists
Linking To Online Resources
Finding And Using Images
Introducing Cascading Style Sheets
Using Cascading Style Sheets
Getting Creative With Colors And Fonts
Using Tables For Stunning Pages
Scripting Web Pages
Working With Forms
Fun With Client-side Scripts
The About Me Page
The Ebay Auction Page
A Company Site
A Product Catalog
Ten Cool Html Tools
Ten Html Do’s And Don’ts
Ten Ways To Exterminate Web Bugs
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.