14 Website Design - 17feb2022
14 Website Design - 17feb2022
17 February 2022
Notes
1. Websites usually consists of multiple webpages.
2. OL ICT we learn about creating static websites. Means the request (HTTP
request - Hyper Text Transfer Request) is client from the browser and
response (HTTP response) from the webserver.
3. Dynamic webpages may show different content to viewers depending on the time
and/or geographic location (country) based on how it was developed. PHP is
used widely here in Sri Lanka for dynamic webpages.
4. HTML stands for Hyper Text Markup Language. Modern computers store the file
with .html file extension and older operating systems uses .htm file
extension. We cannot declare variables in HTML so we don't refer it as a
programming language.
5. You can use Notepad, Notepad++ known as the simple text editors to create
HTML pages.
6. It's relatively easy to use free Microsoft visual studio code
https://code.visualstudio.com/Download to create static webpages.
7. Word processors can be used to create webpages. If you have an existing word
document you can convert to HTML by File -> SaveAs -> Webpage.
8. HTML consists of 2 major parts known as head and body. Head part consists of
meta data about the HTML document.
9. HTML consists of tags <tag> known as the starting tag </tag> known as the
ending tag so that the browser knows from where to where it should apply
that tag. Though generally there are in pairs but few exception include
<BR>- Line Break, <HR> - Horizontal Rule <IMG> - Image as once you applied
Line break
10. Some tags do have attributes and values. <tag attribute="value">. Attributes
gives additional information about the tags.
11. Tags are also known as elements.
12. HTML documents are created with elements.
13. Generally browsers ignores the HTML errors and try render as best as they
can.
14. If there are tags defined but not in the HTML stands then the browser
ignores them and try to render the text inbetween the opening and closing
tag. e.g. <abc>Text</abc> rendered in a browser as Text
15. In HTML comments can be written like <!-- HTML comments--> also you can
write the comment where ever you like.
16. HTML documents start with <HTML> also known as the roottag.
17. HTML ignores blank spaces. e.g.
<!--Whitespace.html-->
<p>This is& a text</p>
The above code displays in the tab as ictmcq.home.blog for older browsers
that don't have a tab will display in the browser window.
<!-- Saved as title1.html-->
<html>
<head>
<title><a href="http://ictmcq.home.blog">https://ictmcq.home.blog/</
a></title>
</head>
</html>
Ordinary tags cannot be applied to the head section so the browser cannot
render the anchor tags but displays as <a href="http://ictmcq.home.blog">
19. HTML documents should have one body although browsers will not complain if
you have multiple bodies.
<!-- Saved as body.html-->
<html>
<head>
<title>Body test with 2 body tags</title>
</head>
<body>
Test1
</body>
<body>
Test2
</body>
</html>
Here the values are given as RGB values in hexadecimal values from 0 to
FF.Since the R is given 255 while Green 0 and Blue 0 so it change the
background colour to Red
<!--Save as bgcolor1.html-->
<body bgcolor=#00ff00>
Above the green is given value of 255 while other colours 0 so it becomes
green.
<!--Save as bgcolor2.html-->
<body bgcolor=#0000ff>
Above the blue is given value of 255 while other colours 0 so it becomes
blue.
<!--Save as bgcolor3.html-->
<body bgcolor=#ffffff>
Above all the values are given its maximum value i.e. 255 so the background
appears white.
21. Heading is having six levels heading level 1 is the biggest one and heading
level 6 is the smallest one
<!--heading.html-->
<h1>Heading Level 1</h1>
<h2>Heading Level 2</h2>
<h3>Heading Level 3</h3>
<h4>Heading Level 4</h4>
<h5>Heading Level 5</h5>
<h6>Heading Level 6</h6>
<!--p1.html-->
This is the first paragraph. <p>This is the second paragraph.</p>This is the
third paragraph.
<!--font1.html-->
<font color="ff0000">Font color is Red</font><br>
<font color="00ff00">Font color is Green</font><br>
<font color="0000ff">Font color is Red</font>
In the above HTML code start="10" means the list start from 10.
<!--ol2.html-->
<ol type="1">
<li>Physics</li>
<li>Combined Mathematics</li>
<li>ICT</li>
</ol>
<!--ol3.html-->
<ol type="A">
<li>Physics</li>
<li>Combined Mathematics</li>
<li>ICT</li>
</ol>
<!--ol4.html-->
<ol type="a">
<li>Physics</li>
<li>Combined Mathematics</li>
<li>ICT</li>
Regunathan Umapathy BSc https://ictmcq.home.blog Page 6 of 26
</ol>
<!--ol5.html-->
<ol type="I">
<li>Physics</li>
<li>Combined Mathematics</li>
<li>ICT</li>
</ol>
<!--ol6.html-->
<ol type="i">
<li>Physics</li>
<li>Combined Mathematics</li>
<li>ICT</li>
</ol>
<!--ol7.html-->
<ol type="i" start="5">
<li>Physics</li>
<li>Combined Mathematics</li>
<li>ICT</li>
</ol>
<!--ol8.html-->
<ol type="a" start="3">
<li>Physics</li>
<li>Combined Mathematics</li>
<li>ICT</li>
Regunathan Umapathy BSc https://ictmcq.home.blog Page 7 of 26
</ol>
In the above HTML code type="a" and start="3" start from the English alphbet
3
<!--ol9.html-->
<ol>
<li>Physics</li>
<li>ICT
<ol>
<li>Grade 12</li>
<li>Grade 13</li>
</ol>
<li>Combined Mathematics</li>
</ol>
<!--ol10.html-->
<ol>
<li>Physics</li>
<li>ICT
<ol type="i">
<li>Grade 12</li>
<li>Grade 13</li>
<ol type="a">
<li>Database</li>
<li>Python</li>
<li>Webdevelopment</li>
</ol>
</ol>
<li>Combined Mathematics</li>
</ol>
<!--ol12.html-->
<p>This is a paragraph</p>
<ol>AL Otherstream Subjects
<li>Physics</li>
<li>ICT
<li>Combined Mathematics</li>
</ol>
<!--ul2.html-->
<ul>
<li>Physics</li>
<li>ICT
<ul>
<li>Grade 12</li>
<li>Grade 13</li>
</ul>
<li>Combined Mathematics</li>
</ul>
With the nested <ul> outer li displayed disc as usual and the internal ones
displayed as a circle.
<!--ul3.html-->
<ul>
<li>Physics</li>
<li>ICT
<ul>
<li>Grade 12</li>
<li>Grade 13</li>
<ul>
<li>Database</li>
<li>Python</li>
<li>Webdevelopment</li>
</ol>
</ol>
<li>Combined Mathematics</li>
</ol>
One <dt> may have multiple <dd> look at the below example
<!--dl2.html-->
<dl>
<dt>coffee</dt>
<dd>a beverage made from roasted, ground coffee beans</dd>
<dd>a cup of coffee</dd>
<dd>a social gathering at which coffee is consumed</dd>
<dd>a medium to dark brown colour</dd>
</dl>
<!--dl3.html-->
<dl>
<dt>soda</dt>
<dt>pop</dt>
<dt>fizzy drink</dt>
<dt>cola</dt>
<dd>a sweet, carbonated beverage</dd>
</dl>
<!--dl5.html-->
<dl>
<dt>Name1</dt>
<dd>Value that applies to Name1</dd>
<dt>Name2</dt>
<dt>Name3</dt>
<dd>Value that applies to both Name2 and Name3</dd>
<dt>Name4</dt>
<dd>One value that applies to Name4</dd>
<dd>Another value that applies to Name4</dd>
</dl>
28. <table> tag is used to create a table. <caption> tag is can also be used
inside the table tag will display the text on top of the table.
<!--table1.html-->
<table>
<td>First Cell</td>
</table>
<!--table2.html-->
<table border=1>
<td>First Cell</td>
</table>
In the above we can see the above in the same row, to bring the content to
the next row can use the <tr> - table row tag.
<!--table4.html-->
<table border=1>
<td>First row first cell</td>
<td>First row second cell</td>
<tr>
<td>Second row first cell</td>
<td>Second row second cell</td>
</tr>
</table>
<td> by default uses left alignment as we can see clearly in the above
example.
<!--table5.html-->
<table border=1>
<th>Name</th><th>COVID-19 Vaccine</th><th>Name of the vaccine</th>
<tr><td>Umapathy</td><td>Yes</td><td>Sinopharm</td></tr>
<tr><td>Abirami</td><td>Yes</td><td>Sinopharm</td></tr>
<tr><td>Morganan</td><td>No</td><td> </td></tr>
</table>
<!--table6.html-->
<table border=1>
<caption>COVID-19 Vaccine Status</caption>
<th>Name</th><th>COVID-19 Vaccine</th><th>Name of the vaccine</th>
<tr><td>Umapathy</td><td>Yes</td><td>Sinopharm</td></tr>
<tr><td>Abirami</td><td>Yes</td><td>Sinopharm</td></tr>
<tr><td>Morganan</td><td>No</td><td> </td></tr>
</table>
<caption> irrespective of the location inside the table shows the caption on
top of the table i.e. COVID-19 Vaccine Status is displayed on top of the
table.
<!--table7.html-->
<table border=1>
<th>Name</th><th>COVID-19 Vaccine</th><th>Name of the vaccine</th>
<tr><td>Umapathy</td><td>Yes</td><td>Sinopharm</td></tr>
<tr><td>Abirami</td><td>Yes</td><td>Sinopharm</td></tr>
<tr><td>Morganan</td><td>No</td><td> </td></tr>
<caption>COVID-19 Vaccine Status</caption>
</table>
<!--table7a.html-->
<caption>COVID-19 Vaccine Status</caption>
<table border=1>
<!--Table10.html-->
<table border="1">
<th>heading 1</th><th>Heading 2</th>
<tr><td>Data1</td><td>Data2</td></tr>
<tr><td colspan="2">colspan</td></tr>
</table>
<!--Table11.html-->
<table border="1">
<th>heading 1</th><th>Heading 2</th>
<tr><td>Data1</td><td>Data2</td></tr>
<tr><td colspan="2" align="center">colspan</td></tr>
</table>
29. Tags should be closed the same way as they open i.e.
<outertag><innertag>Incorrect Tag closing</outertag></innertag> is incorrect
and the correct one is <outertag><innertag>Correct Tag
closing</innertag></outertag>
30. HTML is not case sensitive i.e. it ignores the cases means will not
distinguish capital and small letters.
31. Tags and attributes for OL examination
a. <a> known as the anchor tag which is used like <a href="URL"> i.e.
anchor tag followed href known as the hyper reference, URL means the
Uniform Resource Locator where you can provide the value as an image
(JEPG), audio (MP3) or video (MP4)
b. <b> stands for Bold
c. <br> is used for line break. This tag does not have a close tag.
d. <dt> define term
e. <dd> defintion description
f. <em> emphasied text similar to italic use this when <i> is not given
g. <font face = "arial">It's a different font</font>
h. <hr> creates horizontal rule. Does not have a closing tag.
i. <i>italic</i>displays as italic
j. <img src="filename.jpeg"> Note that <img> tag does not have a closing
tag
k. <marquee>Marquee</Marquee> Marquee will run from right to left. Since
we have paper based exam this is quite unlikely to be an answer.
l. <p> stands for paragraph.
m. <s>Strike</s> will render in browser as strike
n. <strong>strong</strong> will display in a browser as strong similar to
bold text.
o. H<sub>2</sub>O will display in the browser as H₂O
p. 2<sup>10</sup> will display in the browser as 2¹⁰
q. <sup>2</sup>/<sub>5</sub> will display in the browser as ²/₅
r. <table border="1"> will display in the browser as a table with border.
Border syle varies by changing the values e.g. <table border="2">
s. <TR> stands for Table Row used to create a new row.
t. <TH> stands for Table Header used to create heading in Tables appears
as bold.
u. <TD> stands for Table Data used to create data inside the table
32. HTML attributes followed the HTML tags
a. Align attribute can be applied to multiple tags e.g. p - paragraph, h1
(and other heading levels) values can be "center", "left", "aligned"
and "justify">
33. ISP stands for Internet Service Providers
a. SLT - Sri Lanka Telecom and Mobitel
b. Hutch and Etisalat
c. Dialog and Airtel
d. Lankabell
34. Note in the OL examination for part 2 that you are expected to write only
the answers (without tag symbols) otherwise you will lose the marks as per
the previous marking schemes.
35. Unit wise questions can be done online via http://ictmcq.home.blog
5. What is the correct HTML code for setting the background colour as yellow?
OL2010MCQ36
1) <body background-'yellow'> 2)<background>yellow</background>
3)<body background="yellow"> 4) <body style="Background-color:yellow">
16. Which is the correct markup for a comment in an HTML document? AL2012MCQ13
1)<!Districts of Sri Lanka 2)<!--Districts of Sri Lanka -->
3)//Districts of Sri Lanka
4)<*Districts of Sri Lanka *> 5)<!Districts of Sri Lanka !>
18. Which of the following is used to create a link to another Webpage from an
HTML document? OL2013MCQ37
1)HREF 2)LINK 3)LI 4)TARGET
21. Which of the following tags is used to render a heading on an HTML page?
AL2013MCQ36
1)<h2> 2)<ol> 3)<ul> 4)<hr> 5)<td>
24. Consider the following statements regarding the world wide web
(www):OL2014MCQ35
A - Web pages are written in HTML.
B - www is a system of interlinked hypertext documents accessed through the
Internet.
C - A website consists of a collection of web pages.
Which of the above statements are correct?
1)A and B only 2)A and C only 3)B and C only 4)All A, B and C
29. Consider the following HTML statements for creating a table: OL2015MCQ21
<table border=1>
<tr><th>Name</th><th>Tel. Number</th></tr>
<tr><td>Gunarathna</td><td>0115557770</td></tr>
<tr><td rowspan="2">Somasundaram</td>0115557771</tr>
<tr><td>0115557772</td></tr>
</table>
Which of the following is the correct table created by the above statements?
30. Which of the following HTML tag combinations allows to add a row in table?
OL2015MCQ22?
1) <TR></TR> 2)<CR></CR> 3) <TH></TH> 4) <TD></TD>
40. Which of the following HTML tags can be used to make a numbered list in HTML
OL2017MCQ36
1)<ul> 2)<dl> 3)<ol> 4)<list>
41. Consider the following HTML code (One minor alteration with the below
code):AL2017MCQ13
<html>
<head>
<title>Country</title>
</head>
<body>
<p><!--<h1>Sri Lanka</h1>--></p>
</body>
</html>
Which of the followings correctly describe the display, when the above code
is rendered?
1)The text "Country" appears on the title bar and the text "Sri Lanka"
appears as a header.
2)The text "Sri Lanka" appears on the title bar and text "Country" appears
as a header.
3)The text "Country" appears on the title bar.
4)The text <!--<h1>Sri Lanka</h1>--> appears on the title bar.
5)The text "<!--<h1>Sri Lanka</h1>-->" appears in the body of the web page.
42. What is the correct HTML statement for inserting an image? OL2018MCQ32
1)<img src="image.gif" alt="MyImage"> 2)<img href="image.gif"
alt="MyImage">
3)<image src="image.gif" alt="MyImage"> 4)<img
alt="MyImage">image.gif</img>
43. Consider the following HTML code with labels ① - ③ and the expected
output. AL2018MCQ15
What is the correct order of tags for replacing the labels ①, ② and ③
1) dt, dl, dd 2)dl, dt, dd 3)dd, dt, dl 4)dt, dd, dl 5)dl, dd, dt
44. Consider the following HTML code for creating a table? AL2018MCQ16
<html>
<head><style>table, th, td{border:1px solid black}</style>
</head><body>
<table>
<tr><th>Name:</th><td>Kamal</td></tr>
<tr><th rowspan="2">Telephone</th><td>55577854</td></tr>
Regunathan Umapathy BSc https://ictmcq.home.blog Page 23 of 26
<tr><td>55577855</td></tr>
</table>
</body>
</html>
Which of the following is the output generated by the above code?
45. Which of the following is the correct HTML statement for inserting an image?
AL2018MCQ17
1)<img href="image.gif" alt="MyImage">
2<img alt="MyImage">image.gif</img>
3)<img src="image.gif" alt="MyImage">
4)<image src="image.gif" href="MyImage">
5)<img href="image.gif" src="MyImage">
47. Which of the following statements related to web pages development are
correct? OL2019MCQ30
A - The content shown in dynamic web pages may vary according to user inputs
or time.
B - Dynamic web pages are created only using HTML
C - Web authoring tools can be used to create web pages
1)A and B only 2)A and C only 3)B and C only 4)all A, B and C
48. Which of the following tags can be used for HTML character
formatting?OL2019MCQ31
1)<i><b><u><em> 2)<br><b><u><p>
3)<p><li><u><em> 4)<i><b><li><em>
49. Which of the following HTML code line is correct to create a hyperlink to
the words "Department of Examinations" using the URL:
http://www.doe.index.html ? AL2019MCQ10
1)<a href="Department of Examinations">http://www.doe.index.html</a>
2)<a href="http://www.doe.index.html">Department of Examinations</a>
3)<a href="http://www.doe.index.html" alt="Department of Examinations"></a>
4)<a src="Department of Examinations">http://www.doe.index.html</a>
5)<a src="http://www.doe.index.html">Department of Examinations</a>
51. Which of the following HTML tag pair can be used to make a numbered list
OL2020MCQ23
1)ul, li 2)dl, dd 3)nl, li 4)ol, li
52. Which of the following HTML tags and parameters can be used to create the
given table? OL2020MCQ26
53. Which of the following HTML tags are used to define a definition list?
AL2020MCQ42
1)<dl>, <dd>, <li> 2)<dl>, <dt>, <dd> 3)<dl>, <td>, <dd)
4)<dl>, <th>, <dd> 5)<dl>,<th>,<td>
55.
Answers
1. ISP - Internet Service Provider
2. <!
3. head and body
4. <br></br> as <br> stands for line break which doesn't have any closing tags.
5. <body background="yellow">
6. 〈a href="http://DOEweb.com"〉DOEweb</a〉
7. Inserts a line break
8. A only
9. 2nd answer
10. Statement C is incorrect as W3C though once responsible for the development
of HTML and now CSS but not for the internet.
11. 2nd answer - indentation will be there with nested UL or OL
12. Web site
13. Horizontal Rule
14. <!-- ...--> means comment
15. 3rd answer
16. <!--Districts of Sri Lanka -->
17. Statement B is incorrect as we cannot define variables in HTML so we only
refer it as a markup language and not as a programming language.
18. HREF
19. A - Homepage, B - Hyperlinks, C - Templates, D - Website, E - Authoring
Tools, F - Webbrowser, G - Markup tags
20. Statement A is incorrect as we can use notepad to create HTML pages. Answer
B, C and D only
21. Answer: <h2> - heading level 2
<ol> - ordered list, <ul> - unordered list, <hr> - horizontal rule, <td> -
table data
22. 1st answer
23. The <p> is used to render a blank line before and after the text.
Regunathan Umapathy BSc https://ictmcq.home.blog Page 25 of 26
24. All A, B and C
25. 3rd answer
26. Src
27. <a href="greeting/birthday/greeting.html">Greeting</a>
28. Compared to dt, dd is indended and browser will not show any discs infornt
of dt or dd so the 2nd answer.
29. 3rd answer
30. Answer: <TR></TR> - Stands for table row. We can eliminate <CR> easily as we
don't have such tag. <TH> - Table Header, <TD> - Table Data
31. Answer: <OL></OL> - Ordered List used to create numbered list.
<UL>, <DL>, <LI> are incorrect as it is used to create unordered list,
description list and list item respectively.
32. <ol>
33. a new tab or window
34. 1st answer
35. All A, B and C
36. Web browser
37. <dl>, <dt>, <dd> only
38. Alt
39. <a href="http://www.moe.gov.lk"> Ministry of Education</a>
40. <ol>
41. Answer: The text "Country" appears on the title bar.
Due to typo in the original exam paper all the answers were awarded marks.
42. <img src="image.gif" alt="MyImage">
43. dl, dt, dd
44. 1st answer
45. <img src="image.gif" alt="MyImage">
46. <ul><li>
47. A and C only
48. <i><b><u><em>
49. <a href="http://www.doe.index.html">Department of Examinations</a>
50. Incorrect ones HTML documents are created by using a web browser
51. ol, li
52. Table, th, td and tr with rowspan=2
<table border=2>
<th>Name</th><th>Tel.Number</th>
<tr><td rowspan="2">Premachandra</td><td>019-2220001</td></tr>
<tr><td>075-2233441</td></tr>
<tr><td rowspan="2">Sivaraj</td><td>018-6722117</td></tr>
<tr><td>076-4123789</td></tr>
</table>
53. <dl>, <dt>, <dd>
54. Browser displays the text with hyperlinks between <a> and </a> tags so it
will hyperlink as "Go to Part A". As per the marking scheme it's open
question.