Web Development with Java



Download 1,94 Mb.
Pdf ko'rish
bet10/82
Sana14.07.2022
Hajmi1,94 Mb.
#797363
1   ...   6   7   8   9   10   11   12   13   ...   82
Bog'liq
Web Development With Java

Singletons 
have a limited amount of text associated with them or they have no 
text at all. Singletons only have one tag. Table 1.1 gives two examples of singleton 
tags.
Paired tags 
are designed to contain many words and other tags. These tags have 
an opening and a closing tag. The text that they control is placed between the 
opening and closing tags. The closing tag is the same as the opening tag, except 
the tag name is preceded by a forward slash 
/
. Table 1.2 gives four examples of 
paired tags.
1.2.2 Basic Tags for a Web Page
We are very sophisticated listeners. We can understand many different accents. We 
can understand when words are slurred together. However, if we were to write out 
the phonetic transcription of our statements, they would be unreadable. There is 
a correct way to write our language, but a sophisticated listener can detect and 
correct many errors in pronunciation.
For instance, most English speakers would understand me if I asked the 
question
Jeet yet?
In print, it is incomprehensible. A proper response might be
No, joo?
Or,
Yeah, I already ate.
As we become more profi cient in a language, we are able to understand it, even 
when people do not enunciate clearly.
In the same way, all markup languages have a format that must be followed in 
order to be correct. Some language interpreters are more sophisticated than others 
Table 1.2
Examples of paired tags.
Tag Explanation
bold
The enclosed text is rendered in a thicker font.
underlined
The enclosed text is rendered with an underline.
italicised
The enclosed text is rendered in an italic font.
paragraph
The enclosed text will have at least one empty line preceding it.
Table 1.1
Examples of singletons.
Tag Explanation
Insert a line break into the document.

Insert a form element into the document. This is a tag that has additional attributes, 
which will be explained below.


6
Web Development with Java
and can detect and correct mistakes in the written format. For example, a para-
graph tag in HTML is a paired tag and most browsers will render paragraphs 
correctly, even if the closing paragraph tag is missing. The reason is that paragraph 
tags cannot be nested one inside the other, so when a browser encounters a new 
tag before seeing the closing 
for the current paragraph, the browser 
inserts a closing 
and then begins the new paragraph. However, if an XML 
interpreter were used to read the same HTML fi le with the missing 
tag, the 
interpreter would report an error instead of continuing to parse the fi le. It is better 
to code all the tags that are defi ned for a well-formed HTML document, than to 
rely on browsers to fi ll in the missing details.
Standard Tags
The HTML specifi cation defi nes a group of standard tags that control the structure 
of the HTML document. These tags will contain plain text and other tags.
html code
The 
html 
tags enclose all the other tags and text in the document.
browser command tags
The 
head 
tags enclose tags that inform the browser about how to display the 
entire page. These control how the page appears in the browser, but do not 
contain any content for the page. This paired tag belongs within the paired 

tags.
body tags
section within the paired 

tags.
3. The 
DOCTYPE
and 
meta
tags are required if the page is to be validated by W3C 
for correct HTML syntax. Go to http://www.w3.org to access the HTML validator.
There is no excuse for a web page to contain errors. With the use of the validation 
tool at http://www.w3.org, all HTML pages should be validated to ensure that they 
contain all the basic tags.
Layout versus Style
There are two different types of information that are contained in each HTML 
page: layout and style. The basic layout is covered in this chapter; advanced layout 
and style are covered in Chapter Six. Style information contains things like the 
colours and font for the page. The recommended way to handle style and layout 
is to place all the layout tags in the HTML page and to place all the style informa-
tion in a separate fi le, called a style sheet. For the interested student, the HTML 
and style information from Chapter Six can be read at any time.
There are different DOCTYPE statements that can be used for HTML pages: 
strict and transitional. The strict one is the recommended one, since it enforces 
the rule that all style information be contained in a separate fi le. All pages for this 
book will use the strict DOCTYPE for HTML pages.


8
Web Development with Java
Word Wrap and White Space
Most of us are used to typing text in a word processor and letting the program deter-
mine where the line breaks belong. This is know as 
word wrap
. The only time that 
we are required to hit the enter key is when we want to start a new paragraph.
Browsers will use word wrap to display text, even if the enter key is pressed. 
Browsers will treat a new line character, a tab character and multiple spaces as 
a single space. In order to insert a new line, tab or multiple spaces in an HTML 
page, markup must be used: if it is not plain text, then it must be placed 
in markup.
Browsers take word wrap one step further. Browsers will compress all consecu-
tive white space characters into a single space character. The common white space 
characters are the space, the tab and the new line character. If there are fi ve spaces 
at the start of a line, they will be compressed into one space.
The following listing contains a web page that has a poem.
<

Download 1,94 Mb.

Do'stlaringiz bilan baham:
1   ...   6   7   8   9   10   11   12   13   ...   82




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish