Sei sulla pagina 1di 20

Chapter Three

MARKING UPTEXT
 Block level elements

1
Paragraphs
 Paragraphs are the most rudimentary elements of a text
document
 You indicate a paragraph with the p element
 Example <p>Serif typefaces have small slabs at the
ends of letter strokes. In general, serif fonts can make
large amounts of text easier to read.</p>
 Paragraphs may contain text, images and other inline
elements , but they may not contain other block
elements

2
Headings
 headings are used to provide logical hierarchy or outline
to a document
 There are actually six levels of headings in (X)HTML,
from h1 to h6
 You can use a style sheet to specify the appearance of
the heading levels. By default, they will be displayed in
bold text, starting in very large type for h1s with each
consecutive level in smaller text,

3
4
Long quotations
 If you have a long quotation, a testimonial, or a section of copy from
another source, particularly one that spans four lines or more, you
should mark it up as a blockquote element
 It is recommended that content within blockquotes be
contained in other elements, such as
 paragraphs
 headings
 or lists

5
Example
 <p>Renowned type designer, Matthew Carter, has this to say about his
profession:</p>
 <blockquote>
<p>Our alphabet hasn't changed in eons; there isn't much latitude in what a designer
can do with the individual letters.</p>
<p>Much like a piece of classical music, the score is written down – it’s not
something that is tampered with – and yet, each conductor interprets that score
differently. There is tension in the interpretation.</p>
 </blockquote>

6
7
 Early on, you learned that browsers ignore
white space such as line returns and character
spaces in the source document.
 If u want to use white space:- preformatted
text (pre) element.
 it displayed exactly as it is typed

8
Horizontal Rules
 If you want to add a divider between sections, you can insert a
horizontal rule (hr) element.
 insert a shaded horizontal line in its place by default
Addresses
 the address element that is used to provide contact information for the
author or maintainer of the document
 It is generally placed at the beginning or end of a document
example
<address>
Contributed by <a href="../authors/robbins/">Jennifer Robbins</a>, <a
href="http://www.oreilly.com/">O’Reilly Media</a>
</address>

9
Lists

There are three main types of lists in (X)HTML:

1. Unordered lists. Collections of items that appear in no particular order.


2. Ordered lists. Lists in which the sequence of the items is important.
3. Definition lists. Lists that consist of terms and definitions

10
Unordered lists
 By default, unordered lists display with a bullet before each list item,
but you can change that with a style sheet
 To identify an unordered list, mark it up as a ul element
 The opening <ul> tag goes before the first list item and the closing tag
</ul>
 each item in the list gets marked up as a list item (li) by enclosing it in
opening and closing li
<ul>
<li>Serif</li>
<li>Sans-serif</li>
<li>Script</li>
<li>Display</li>
<li>Dingbats</li>
</ul>
Nesting Lists
11
Ordered lists
 Ordered lists are for items that occur in a particular order
 they are defined with the ol element (for ordered list, naturally).
 Instead of bullets, the browser automatically inserts numbers before
ordered list items
Example
<ol>
<li>Gutenburg develops moveable type (1450s)</li>
<li>Linotype is introduced (1890s)</li>
<li>Photocomposition catches on (1950s)</li>
<li>Type goes digital (1980s)</li>
</ol>

12
 If you want a numbered list to start at a number other than “1,” you can
use the start attribute in the ol element to specify another starting
number
<ol start="17">
<li>Highlight the text with the text tool.</li>
<li>Select the Character tab.</li>
<li>Choose a typeface from the pop-up menu.</li>
</ol>

13
Definition lists
 Definition (or dictionary) lists are used for lists of terms
with their respective definition
 The whole list is marked up as a definition list (dl) element
 The content of a dl is some number of terms (indicated by
the dt element)
 definitions (indicated by the dd element).
<dl>
<dt>Linotype</dt>
<dd>Line-casting allowed type to be selected, used, then recirculated into the
machine automatically. This advance increased the speed of
typesetting and printing dramatically.</dd></dl>

14
Adding Line Breaks
 The inline line break element (br) :- add a line
break within the flow of text.
<p>
So much depends <br />upon <br /><br />a
red wheel <br />barrow
</p>

15
The Inline Text Element
 Most (X)HTML text elements are inline elements, which means they
just stay in the flow of text and do not cause line breaks

 two general categories of inline elements


 semantic elements
 presentational elements

16
 The semantic elements describe the meaning of the text;
for example, an acronym or emphasized text

 The presentational elements provide


descriptions of the element’s typesetting or
style, such as
 bold
 italic
 underlined

17
Semantic inline elements

18
 Adding emphasis to text
em or strong

 Abbreviations(abbr) and acronyms(acronym)


Both elements use the title attribute to provide the long version of the
shortened term
example
<acronym title="American Type Founders">ATF</acronym> <abbr title="Points">pts.</abbr>
The ins and del elements are used to mark up changes to the text and
indicate parts of a document that have been inserted or deleted
Example
Chief Executive Officer:<del title="retired">Peter Pan</del><ins>Pippi
Longstockings</ins>

19
Presentational inline elements

20

Potrebbero piacerti anche