Your Ad Here

Using Blockquote Tags to Control Left and Right Text Margins


One of the more difficult things to accomplish in HTML is controlling the distance between text and the
left and right text margins of a Web document. By default, the Web browser adjusts the left and right-hand
page margins (that is, the width of the Web page) such that the page fits within the width of the browser’s
application window. (The alternative would be to allow a portion of the Web page to extend “beneath”
the right-hand side of the application window and provide a horizontal scrollbar the visitor could use
to display content that falls outside the viewable area within the application window.)
Of course, Web authors understand that Web browsers will shift text content from one line to the
next as necessary. As such, developers create Web pages using a variety of text formatting/positioning
options such as CSS or placing text into the cells of an HTML table. Without specific formatting
instructions, the Web browser will place the first character of text right next to the left-hand margin
and will wrap (move down to the next line) only when the browser reaches the right-hand margin on
the Web page. Remember, the width of the browser application window on the visitor’s computer
determines the distance between the left and right-hand margins on a Web page. Moreover, the browser
wraps text to the next line when the browser encounters the right-hand side the application window.
A blockquote formats text by indenting, or increasing the margins on the right and left sides of the
blockquoted text. As such, using blockquotes to indent a portion of text document makes text stand
out and thereby helps to organize the content on the page.
For example, the following HTML defines a Web page with a title followed by
two paragraphs of blockquote style text, as shown in Figure 1-19:
<html>
<head>
<title>Example of the Blockquote tag</title>
</head>
<body>
<p>This is regular text</p>
<blockquote>The text in this paragraph is
blockquoted. Notice how the text indents
on the left side of the page, and wraps
when it encounters the right margin
</blockquote>
<p>This is more regular text; see what happens
when the regular text reaches a margin.</p>
<blockquote>The text in this paragraph
is blockquoted. Notice how the text
indents on the left side of the page,
and wraps when it encounters the right
margin
</blockquote>
</body>
</html>

0 comments:

Post a Comment

Popular Posts

Recent posts