Avd CH 1
Avd CH 1
Course Title: Advanced Website Development Course Code: BAIS 4052; ECTS: 5
and Management
Chapter One
Overviews of HTML and CSS Fundamentals
JAFAR B.
2/24/2026
Obejctives
2
2/24/2026
HTML
3
2/24/2026
HTML
4
HTML Tags
HTML tags are element names surrounded by angle brackets:<tagname>
content goes here..</tanname>
HTML tags typically appear in pairs, consisting of a start tag and an end tag.
The end tag written like the start tag but includes a forward slash before the
tag name. Eg:- <TITLE>Introduction to HTML</TITLE>
2/24/2026
Markup…
5
Container Tag: A Container tag is one that activates an effect and that has a companion
Standalone Tag: A Standalone tag is one that does not have a companion tag.
2/24/2026
Markup…
6
2/24/2026
HTML Documents = Web Pages
7
HTML tags – special keywords enclosed in angle brackets (e.g., <p>, <h1>, <body>) that tell
the browser how to display content.
Plain text – the actual content (words, images, links) shown on the web page.
HTML Documents Are Also Called Web Pages
When an HTML file is opened in a browser, it becomes a web page.
Therefore, HTML documents and web pages refer to the same thing.
Purpose of a Web Browser
A web browser (such as Chrome, Firefox, or Edge) reads HTML documents and
displays them visually as web pages.
The browser does not show the HTML tags. Instead, it interprets the tags and uses them to
format and display the content properly.
2/24/2026
HTML Document Structure
8
The document describe the structure of an HTML document, which include three key
components: the HTML declaration, HEAD, and BODY tags.
<!DOCTYPE html>:-Declares that the document
is HTML5. It tells the browser which version of
HTML is used.
<html>:-The root element of the page. All HTML
content is inside this tag.
<head>:-Contains meta-information about the
page (not displayed directly on the webpage).
Examples:-<title>, <meta>, <link>
<body>:-Contains the visible content of the web page such as: Headings (<h1>–<h6>),
Paragraphs (<p>),Images (<img>) , Links (<a>),Tables, forms, etc.
2/24/2026
HTML Elements & Attributes
9
HTML Element
The <h1>element defines a large heading
The<p> element defines a paragraph
An HTML element usually consists of a start tag and end tag, with the content
inserted in between:<tagname>Content goes here...</tagname>
The HTML element is everything from the start tag to the end tag: <p>My first
paragraph.</p>
Empty elements do not have an end tag, such as the <br> element (which
indicates a line break).
2/24/2026
HTML Elements & Attributes
10
HTML Attributes provide additional information about HTML elements.
All HTML elements can have attributes
Attributes provide additional information about an element
Attributes are always specified in the start tag
Attributes usually come in name/value pairs like: name="value“
<p title=“My Web page “>This is a paragraph.</p>
<a href="[Link] is a link</a>
<img src="[Link]" width="104" height="142">
Heading Tags
Any document starts with a heading. You can use different sizes for your headings.
HTML also has six levels of headings, which use the elements h1, h2 , h3 , h4 , h5 , and
h6 .
While displaying any heading, browser adds one line before and one line after that
heading.
2/24/2026
Centring Content
11
You can use<center> tag to put any content in the centre of the page or any table cell.
<!DOCTYPE html> <html>
<head>
<title>Centring Content Example</title> </head>
<body><center><p>This text is not in the center.</p></center>
<center> <p>This text is in the center.</p> </center>
</body> </html>
Horizontal Lines
Horizontal lines serve to visually separate sections within a document.
The tag generates a horizontal line that extends from the current position to the right
margin.
For example, you may want to give a line between two paragraphs as in the given example
below:
<p>This is paragraph one and should be on top</p>
<hr />
<p>This is paragraph two and should be at bottom</p>
2/24/2026
Horizontal Lines
12
Again <hr/>tag is an example of the empty element, where you do not need opening and
closing tags, as there is nothing to go in between them.
The <hr/> element has a space between the characters hr and the forward slash.
Nonbreaking Spaces
In cases, where you do not want the client browser to break text, you should use a nonbreaking
space entity instead of a normal space.
2/24/2026
HTML Formatting Elements
13
HTML uses elements like <b> and <i> for formatting output, like bold or italic text.
2/24/2026
HTML Links
14
HTML links are defined with the <a> tag:<a href="url">link text</a> .
The source file (src), alternative text (alt), width, and height are provided as attributes.
Example:<img src="[Link]" alt="Smiley face" height="42" width="42">
2/24/2026
HTML Lists
15
HTML lists allow web developers to group a set of related items in lists.
Unordered HTML List
An unordered list starts with the <ul> tag. Each list item starts with the <li> tag.
The list items will be marked with bullets (small black circles) by default:
The <dl> tag defines the description list, the <dt> tag defines the term (name), and
the <dd> tag describes each term:
2/24/2026
Defining an HTML Table
16
<tr> stands for table rows. To add a row in a table <table row> tags are used.
Whereas <td> means table data and <th> means table head.
Syntax: <table>
<tr>
<td>row1col1</td>
<td>row2col2</td>
</tr></table>
2/24/2026
HTML Forms
17
HTML Forms are required, when you want to collect some data from the site visitor.
For example, during user registration you would like to collect information such as
A form will take input from the site visitor and then will post it to a back-end
There are various form elements available like text fields, text-area fields, drop-
The HTML <form> tag is used to create an HTML form and it has following syntax:
<form action = "Script URL" method = "GET|POST"> form elements like input, textarea etc.
</form>
2/24/2026
HTML Buttons
18
2/24/2026
HTML Form Attributes
19
<form action="/action_page.php">
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="Submit">
</form>
2/24/2026
HTML Form Attributes
20
Value Description
_blank The response is displayed in a new window or tab
_self The response is displayed in the current window
_parent The response is displayed in the parent frame
_top The response is displayed in the full body of the window
frame name The response is displayed in a named iframe
2/24/2026
HTML Form Attributes
21
The default value is _self which means that the response will open in the current
window.
Example:-Here, the submitted result will open in a new browser tab:
<form action="/action_page.php" target="_blank">
The Method Attribute
The method attribute specifies the HTTP method to be used when submitting the form
data.
The form-data can be sent as URL variables (with method="get") or as HTTP post
transaction (with method="post").
The default HTTP method when submitting form data is GET.
Example 1:-This example uses the GET method when submitting the form data:-
<form action="/action_page.php" method="get">
2/24/2026
The Method Attribute
22
Example 2:-This example uses the POST method when submitting the form data:
<form action="/action_page.php" method="post">
GET Method:
Appends the form data to the URL, in name/value pairs
NEVER use GET to send sensitive data! (the submitted form data is visible in the URL!)
The length of a URL is limited (2048 characters)
Useful for form submissions where a user wants to bookmark the result
GET is good for non-secure data, like query strings in Google
POST method :
Appends the form data inside the body of the HTTP request (the submitted form data
is not shown in the URL)
POST has no size limitations, and can be used to send large amounts of data.
The HTML <form> element can contain one or more of the following form
elements:<input>,<label>,<select>,<textarea>,<button>,<fieldset>,<legend>,<datali
st>,<output>,<option>,<optgroup>
The <input> Element
One of the most used form elements is the <input> element.
The <input> element can be displayed in several ways, depending on
the type attribute.
Example:<labelfor="fname">Firstname:</label><input type="text" id="fname" name="fna
me">
There are many types of input elements. Input elements are defined between the
form tags.
To use an input element, use an input tag and specify the type of the input.
Text fields, Radio buttons, Check boxes, Submit buttons,Password field,Button,
Hidden field, File input type, Reset buttons…
2/24/2026
Input Type Text
24
TEXT is the most common type of input field, it allows the user to type in a single line of
text.
There are some additional attributes that can control the maximum length of the field
(MAXLENGTH).
<input type="text"> defines a single-line text input field:
Used when you want the user to type letters, number, etc.
<form>
First name: <input type="text" name= "firstname"> <br/>
Last name: <input type="text" name="lastname"> </form>
Input Type Password
<input type="password"> defines a password field:
The characters in a password field are masked (shown as asterisks or circles).
Example:-
<form>
<label for="username">Username:</label><br>
<input type="text" id="username" name="username"><b>
<label for="pwd">Password:</label><br>
<input type="password" id="pwd" name="pwd">
</form>
2/24/2026
Input Type Submit
25
2/24/2026
Input type Checkboxes
26
Inputs of type CHECKBOX present user with an item that can be selected or deselected.
Each checkbox has a name and a value and can be initially selected/deselected.
Used when you want the user to select one or more options of a limited number of
choices.
<form> Mark all you Favorite Programming Language: <br />
<input type="checkbox" name="Language" value ="HTML"> HTML </input><br>
<input type="checkbox" name="Language" value="CSS"> CSS </input> <br>
<input type="checkbox" name="Language" value="JavaScript"> JavaScript</input><br>
<input type="checkbox" name="Language" value="Python"> Python</input> </form>
</form>
2/24/2026
Radio Buttons
27
Radio Button inputs are like checkboxes, except that the user must select only one
Used when you want the user to select one of a limited number of choices.
Pull-down/Drop-down list
The SELECT and OPTION tags can be used to create pull-down menus and scrolling lists of choices.
The SELECT tag must include a NAME attribute (this is the name of the form field sent by the
browser).
Between the <SELECT> tag and the corresponding end tag </SELECT> there can be number of
OPTION tags - one for each choice you want displayed.
The text that follows the OPTION tag is the text that will be displayed by the browser.
The value sent by the browser if a choice is selected can be specified with a VALUE attribute, if none is
specified the value sent will be the text that follows the OPTION tag.
2/24/2026
Cascading Style Sheets(CSS)
28
CSS, introduced with HTML 4, enhances the styling of HTML elements and
CSS is a language used to describe the style and display of HTML documents,
2/24/2026
CSS
29
2/24/2026
CSS Syntax and Selectors
30
The selector points to the HTML element you want to style.
The declaration block contains one or more declarations separated by
semicolons.
Each declaration includes a CSS property name and a value, separated by a
colon.
The property is the style attribute you want to change. Each property has a value.
selector { property: value }
A CSS declaration always ends with a semicolon, and declaration blocks are
CSS Selectors
CSS selectors are used to "find" (or select) HTML elements based on their
element name, id, class, attribute, and more.
Example:-You can select all <p> elements on a page like this (here, all <p>
elements will be center aligned, with a red text color):
p{
text-align: center;
color: red;
}
2/24/2026
The id Selector
32
2/24/2026
The CSS class Selector
33
The class selector in CSS targets HTML elements with a specific class attribute using a
`[Link] { text-align: center; color: red; }`, which affects only `` elements with the "center"
class.
Elements can have multiple classes, as demonstrated by ``, which applies styles from
2/24/2026
The CSS Universal Selector
34
The universal selector (*) selects all HTML elements on the page.
If you define style with universal selector, then it will apply on every element.
Example:-The CSS rule below will affect every HTML element on the page:
*{
text-align: center;
color: blue;}
Grouping Selectors
The grouping selector selects all the HTML elements with the same style definitions.
Look at the following CSS code (the h1, h2, and p elements have the same style definitions):
Example In this example we have grouped the selectors from the code above: h1, h2, p { text-align: center;
color: red; } Note: Grouping selectors can minimize code by separating each selector with a comma.
h1 { h2 { p{
text-align: center; text-align: center; text-align: center;
color: red; color: red; color: red;
} } }
2/24/2026
CSS Links
35
Link is one of the tags that need CSS to be applied. As you see on previous lesson,
html links are not attractive.
In order to make it user attractive, you have to apply CSS.
Links can be styled with any CSS property (e.g. color, font-family, background, etc.).
The four links states are:-
a:link - a normal and any link but not visited
While using the four states, a:hover must come after a:link and a:visited. And a:active
must come after a:hover.
2/24/2026
CSS Margin and padding
36
Padding property defines the space between an element's content and its
It does not accept negative values, and values can be specified in length,
percentage, or as "inherit" from the parent element, with percentage based on the
containing box..
2/24/2026
CSS Margin and padding
37
If it has two values, the first is for top and bottom and the second will be for right and left.
If it has one value, then all the four will take that value.
CSS Margin
The CSS margin properties are used to generate space around elements (outside the
border).
The margin does not have a background color, and is completely transparent.
It is possible to use negative values to overlap content.
2/24/2026
CSS Margin
38
The margin property allows you set all of the properties for the four margins (margin-top,
margin-right, margin-bottom and margin-left) in one declaration.
It works as the same fashion as padding does.
Note :Negative values are not allowed for padding but possible in the case of margin.
CSS Border
The border properties allow you to specify how the border of the box representing an
element should look.
There are three properties of a border you can change, border-color specifies the
color of a border, border-style specifies what kind of border to display (the values are
listed below) and border-width specifies the width of a border.
2/24/2026
CSS Border
39
Border style has to be set to see the value of others (colour and width). Some of values
of border-style are:
none: Defines no border
dotted: Defines a dotted border
dashed: Defines a dashed border
solid: Defines a solid border
double: Defines two borders.
The width is set in pixels, or by using one of the three pre-defined values: thin, medium,
or thick.
Use the "border-style" property to set the borders first.
The border-color is used to specify the color of border to be displayed.
Color can be assigned using hexadecimal, RGB or by its name. You can also set the
border color to "transparent".
2/24/2026
Border - Individual sides
40
2/24/2026
Border - Individual sides…
41
To shorten the code, it is also possible to specify all the individual border
properties in one property.
2/24/2026
Border radius
42
After setting border for the element, sometimes we may need to have non sharp
Four sides of the border are rounded with 20px. As the pixel increases the
roundness of the edges increases.
On the above example "border-bottom-left-radius" is set with 20px and the left
bottom side is rounded as you can see it. The same for "border-top-right-radius".
2/24/2026
CSS table
43
Table is one of the HTML elements that can improve using CSS.
There are lots of features that we can see. "border" property is used to specify table's border.
table { border: 1px solid black; }
The CSS code above gives border for outer table, not for each cell. Check the following code:
table td { border: 1px solid black; } table {
Here both table and td have border with 1px solid and black color, so that the
table will looks like as the output.
"border-collapse" property helps the table to have single border, if it was not
set or if its value is "separate" then the border looks like each cell has its own
rectangle border.
Other properties like "vertical-align", "text-align", "padding", "height", "width",
"color", "background-color" can also be used.
2/24/2026
CSS table
44
Having shadow to text, elements and boxes using CSS is possible through
CSS3.
There are two major shadow properties "text-shadow" and "box-shadow".
h1 { text-shadow: 3px 3px 2px blue;
Values for "text-shadow", the first 3px is for horizontal shadow, the next one is for vertical
shadow.
2px is called blur effect, how much should the color distribute as a shadow. And "blue" is
the color of the shadow.
CSS Box Shadow
CSS box-shadow Property
The CSS box-shadow property is used to apply one or more shadows to an element.
Specify a Horizontal and a Vertical Shadow
In its simplest use, you only specify a horizontal and a vertical shadow.
The default color of the shadow is the current text-color.
2/24/2026
CSS Box Shadow
46
2/24/2026
Types of CSS Style
47
The most common way to add CSS, is to keep the styles in external CSS files.
2/24/2026
Ended!
48
Chapter one
Overview HTML and CSS Fundamentals
2/24/2026