Lab Manual 5 Week 10
Lab Manual 5 Week 10
This lab manual is for use by students of the School of Informatics and Applied
Mathematics, Universiti Malaysia Terengganu (UMT) only. Not allowed to print and
distribute this manual without official permission of the author.
Please follow the step by step as described in the manual. Tick (√) each step has
been created and write the conclusion of each activity has been completed.
Conclusion of each activity must be written in a file named according to the following
format:
[nomatrik] _ [LabX]. docx. Replace the 'X' with your lab session. Examples of correct
file name is 'UK12345_Lab1.docx'.
Please prepare assignments with individual effort without any 'copy-paste' from
other parties.
Best of luck!
2
A. Conflicting Styles
Description: Each html element has its own default style. The style can be changed
with style attribute (style attribute). The clash of many style features for an html
element will cause a conflicting style.
Steps Done? (√)
Step1: Create an HTML file called conflict.html
Step2: Type HTML code with CSS as below:
Conclusion:
3
B. Linking to External Style Sheet
Objective: Perform CSS links and html files in an external editing style
Description: By performing an external editing style, the CSS and html files will be
isolated and allow the entire website to be changed with just one file. To use
external editing links, each page must include a reference to an external editing style
file within the <link> element.
Steps Done?
(√)
Step1: Create an HTML file called external.html
Step2: Type the HTML code as below:
Save the file and note the resulting output. How can such output
be produced? How is the CSS file called?
Conclusion:
4
Objective: Apply the position of elements in CSS and html files.
Description: The use of position in a CSS file is to set the state of the web layout in a page.
There are 4 types of positions that can be used, namely static, relative, fixed and absolute.
This position is usually used to build a menu for a website.
Static: is the default for element face position. This position will cause the element face to
be in its original place without changing the position of the element.
Relative: is a feature similar to static. Usually used to change the position of an element.
Must be accompanied by position features such as top: 10px ;.
Fixed: used to set an element position. Positions that use this feature will remain in the
same position even if the scroller's page is down or up.
Absolute: used to determine the position of an element. Usually used with relative features.
Steps Done? (√)
Step1: Create an HTML file called position.html.
<html>
<body>
<link rel=”stylesheet” type=”text/css” href=”position.css”>
5
Note the resulting output. Change the class .element
with position: absolute; What is the resulting output?
Why?
Step4: Type the HTML code as below and save it as
position2.html:
Step5: Copy CSS code like Step3 and change the class
.element position to fixed. Save the file as
position2.css. Note the resulting output. What is the
resulting output?
6
Conclusion:
Objektif: Mengaplikasikan elemen latar belakang di dalam fail CSS dan html.
Description: Apply the background.html with the background.css.
Steps Done?
(√)
Step1: Create an HTML5 file called background.html.
7
Step3: Type the CSS code as below. Save as background.css.
Step3: Save the file and click on the icon to view the output.
Conclusion:
Description: The dimensions of the elements allow the height and width of the
elements to be controlled. This element has a width of 100%.
8
Step3: Create a CSS file called dimensielemen.css.
Type the CSS code as below:
Conclusion
F. Kotak Model dan Aliran Teks (Box Model and Text Flow)
Penerangan: Semua elemen HTML boleh dianggap sebagai kotak. Dalam CSS,
istilah "kotak model" digunakan dalam reka bentuk dan susun atur.
Kotak model CSS asasnya adalah kotak yang mengandungi setiap elemen HTML. Ia
terdiri daripada: margin, sempadan, padding, dan kandungan.
Description: All HTML elements can be considered as boxes. In CSS, the term
"model box" is used in design and layout.
9
A CSS model box is basically a box that contains every HTML element. It consists of:
margins, borders, padding, and content.
Steps Done?
(√)
Step1: Create an HTML file called the model.html box
Step2: Type the HTML5 code as below:
Conclusion:
10
CSS dikenali sebagai Cascading Style Sheets (CSS).
CSS menentukan bagaimana untuk memaparkan elemen-elemenHTML dengan
lebih baik dan tersusun dan seterusnya dalam menyelesaikan masalah.
Dengan menggunakan CSS, rupa dan susun atur laman web boleh ditukar dengan
hanya mengedit satu fail sahaja.
CSS mempunyai 2 bahagian yang utama iaitu “selector” dan “declaration”.
“Selector” ialah merupakan elemen HTML yang hendak digayakan.
Setiap “declaration” mempunyai “property” dan “value”. “Property” merupakan gaya
atribut yang hendak ditukar dan ada “value” bagi setiap “property”.
Description:
• CSS is known as Cascading Style Sheets (CSS).
• CSS determines how to display HTML elements better and organized and so on in
troubleshooting.
• Using CSS, the look and layout of the website can be changed by just editing one
file.
• CSS has 2 main parts, namely "selector" and "declaration".
• "Selector" is an HTML element to be styled.
Each "declaration" has "property" and "value". "Property" is an attribute style to be
changed and there is a "value" for each "property".
Steps Done?
(√)
Step1: Create an HTML file called dropdown.html.
Step2: Type the HTML code as below:
<head>
<lin krel=”stylesheet” type=”text/css” href=”dropdown.css” />
11
Step3: Save the file and create a CSS file called
dropdown.css.
Step4: Type the CSS code as below:
12
Conclusion:
13
Description: Examples of property values bayanagn texts:
horizontal shadow
• 2px [vertical offset] = indicates the value of the vertical shadow position
• # 000000 [color] = indicates the color value for a shadow. In assigning values to
box-shadow colors, you can use color values HEX, RGB, RGBA, HSL, HSLA or Color
Name.
14
Langkah: Save the file and click on the icon to view the
output.
Conclusion:
Description: Border-radius can be used to change any element within the desired
round angle. You can change the angle according to the desired shape by using the
following method according to different round angles.
15
• the second value for the upper-right corner
• the third value for the bottom-right corner
• the fourth value for the bottom-left corner
Steps Done?
(√)
Step1: Create an HTML file called round_number.html
Step2: Type the HTML code as below:
16
Conclusion
:
J. Warna (Colour)
Description:
Color in CSS can be used in various ways by using: Color hexadecimal
Color RGB
Color RGBA
Color HSL
Color HSLA
Nama color
17
Step3: Create a CSS file named color.css. Type the
code as below:
Step4: Save the file and click on the icon to view the
output.
18
Step3: Create a CSS file named boxShadows.css. Type
the code as below:
Step4: Save the file and click on the icon to view the
output.
Conclusion:
19
L. Imej latar belakang yang berbilang (Multiple Background
Images)
20
M. Sempadan imej (Images Borders)
Step4: Simpan fail dan klik pada ikon untuk melihat output.
21
Conclusion:
22