Internet and Web
– Organizing text refers to the proper placement of all the
HTML elements and their content in a Web page.
– If the content of a page is not separated by any line or
paragraph breaks, it becomes very tedious for the readers to
understand the given information.
– Consider an example of a news website in which news is
segregated under different categories and headlines, such as
weather reports, movie reviews, and sports updates.
– If all this news was to be displayed as a continuous running
text, i.e. without any line or paragraph breaks, it will be very
difficult for readers to locate and understand the desired
information.
– To overcome this problem, we can arrange text in different
ways, such as paragraphs, lines, and tables.
P
The texts are displayed in paragraphs.
Pre
Instructs the browser that the enclosed text is a formatted text and
should not be formatted again.By default, HTML disregards the
space and tabs to display a formatting free text. In such cases, we
can preserve the intended formatting using Pre element.
DIV
Used to divide a Web page into different divisions or sections. The
DIV element basically works as a containerfor other HTML
elements. Using the DIV element, you can group the HTML
elements in sections and apply Cascading Style Sheet (CSS) on
them. The DIV element is a block level element and cannot be used
inside the P element.
SPAN
Used to change the style of the text enclosed within the element using the
style attribute. The SPAN element provides additional formatting
capabilities to HTML elements and is used with style sheets to set
presentational attributes that define the style of the content.
TABLE
Arranges text in a tabular format. It is used along with the TH, TR, and TD
elements. The TH element defines the header of a table column. The TR
element specifies the content of the table rows and the TD element
specifies the content of a table cell. We can set the width and height of the
table columns and rows using the style attribute. Using the style attribute,
we can also define the borders for the table, font style for the table content,
and the font size for the table. We can also specify the table caption, which
indicates the content of the table, by using the CAPTION element.
List
Displays the information in form of lists. The OL element is used to display
the list of information in an order of sequence; whereas, you need to use
the UL element to display the information in an unordered list.
Exploring hyperlinks
– A hyperlink interconnects the current web page
with the other web pages available on the
Internet using <a> element
– This <a> element uses the href (hypertext
reference) attribute to specify the target
resource of document
– <a> element uses two attributes: target and id</a></a></a>
The target attribute
This attribute is used to specify a window where we
want to open a document when a hyperlink is clicked
The id attribute
– Used to create a fragment identifier which specifies
a particular location within a document
– We can navigate different locations within a
document using id
– It takes a string as a value and it should be unique in
the same document
Exploring the URL
A URL refers to a unique address which identifies
each Web page on WWW
A URL consists of three parts:
The general URL syntax is as follows:
scheme://host.domain:port/path/file_name?query_stri
ng#anchor
Scheme: file
Access point: Refers to a file on the local PC
Scheme: http
Access point: Refers to a file on the WWW server
Scheme: mailto
Access point: Refers to an electronic mail address
b
Added visual attention, such as keywords (bold)
br
Line break
em
Emphasized text
i
Italics
strong
Content of strong importance
sub
Subscript
sup
Superscript
u
Underlined