HTML CSS
HTML CSS
1
Why we should use?
Use anytime,
Market Expansion Advertising
anywhere, any devices
2
Basic Website Language
HTML CSS
• HTML stands for Hyper Text • CSS stands for Cascading Style
Markup Language, which is the Sheet, which is used to design
most widely used language on the web page to be more
Web to develop web pages. attractive.
3
Required Software Installation
To create website application, some software are needed.
The most popular Editor is Dreamweaver and others are Notepad, Notepad++,
Sublime Text, VSCode and so on.
Photoshop (pixel) and Illustrator (vector) are widely used to create design and
sometime Paint, FormatFactory application are used to design logo or images.
4
Copy code with color
Ctrl + Shift + P
Install Package
Ctrl + Shift + P
Highlight
5
Ctrl + C and Ctrl + Alt + V
6
Procedure
1. Create a folder “coffeehouse” on your Computer Desktop
2. Open sublime text
3. Save untitled file as a index.html in the coffeehouse folder
4. Type <ht and Enter
7
8
9
HTML Page: Body
<body> <!DOCTYPE HTML>
You met the <body> element <html>
in the first example we <head>
created.
Everything inside this <title>My First HTML Page</title>
element is shown inside the </head>
main browser window.
<body>
<p>This is some text...</p>
</body>
</html>
HTML body
10
Save as index.html
Create a folder on your desktop “coffeehouse”
Open Sublime Text
Go to File Tab New File
Save as “index.html” and write code <ht.
11
Test and Result
1. To test the webpage, Select the index.html in the
Coffeehouse folder
2. And press Right click and choose Open with Chrome.
12
13
14
15
By default, a browser will show each paragraph on a new line with some space between it and
any subsequent paragraphs.
16
Code Definition
<b></b> bold
<i></i> italicized
<u></u> underlined
<sup></sup> Samplesuperscript
<sub></sub> Samplesubscript
Paragraph <p>
<p>This is a paragraph.</p> <blockquote>This is a block quote. In this chapter we
will show some basic HTML examples. Don't worry
<p>This is a <b>Bold</b> paragraph.</p>
if we use tags you have not learned about yet.In this
<p>This is a <i>Itallic</i> paragraph.</p> chapter we will show some basic HTML examples.
Don't worry if we use tags you have not learned
<p>This is a <sup>Super</sup>paragraph.</p> about yet.In this chapter we will show some basic
<p>This is a <sub>Sub</sub> paragraph.</p> HTML examples.on't worry if we use tags you have
not learned about yet.</blockquote>
<p>This is a paragraph.</p>
<q>In this chapter we will show some basic HTML
<p>This is <em>EM</em> a paragraph.</p> examples. Don't worry if we use tags you have not
<p>This is <strong>Strong</strong> a paragraph.</p> learned about yet.</q>
<dt>
The unordered list is created with the <ul>
element.
1. Apple i. Apple
2. Orange ii. Orange
3. Grapefruit iii. Grapefruit
a. Apple
A. Apple b. Orange I. Apple
B. Orange c. Grapefruit II. Orange
C. Grapefruit III. Grapefruit
20
Pairs of text and associated definition; text is in <dt> tag, definition in <dd> tag
<dl>
<dt>HTML</dt>
<dd>A markup language. </dd>
<dt>CSS</dt>
<dd>Language used to style the web
page. </dd>
</dl>
List (Unorder list)
<ul> <ul type="circle">
<li>Apple</li> <li>Apple</li>
<li>Mango</li> <li>Mango</li>
<li>Orange</li> <li>Orange</li>
</ul>
</ul>
<ul type="square">
<li>Apple</li>
<li>Mango</li>
<li>Orange</li>
</ul>
22
List (Order List)
<ol> <ol type="A">
<li>Apple</li> <li>Apple</li>
<li>Mango</li> <li>Mango</li>
<li>Orange</li> <li>Orange</li>
</ol> </ol>
23
List (Order List)
<ol type="I">
<li>Apple</li>
<li>Mango</li>
<li>Orange</li>
</ol>
<ol type="i">
<li>Apple</li>
<li>Mango</li>
<li>Orange</li>
</ol>
24
List (Definition List)
<dl>
<dt>HTML</dt>
<dd>This is HTML lists allow web
developers to group a set of related items in
lists.</dd>
</dl>
25
Link
1. Link to Top (ID)
2. Link to Pages (Same folder, Child folder, Parents folder and so on)
3. Link to other website
4. Link to other website with new tab
5. Link to email
26
Link to Pages
1. File New file
2. Save untitle file as about.html in the coffeehouse folder (same folder with
index.html)
3. Type <ht and Enter
4. Type About using <h1> in the title code
index.html about.html
27
Link to Pages
1. Create a new folder “admin” in the coffeehouse folder (child folder of coffeehouse)
2. File New file
3. Save untitled file as login.html in the coffeehouse folder
4. Type <ht and Enter
5. Type Login using <h1> in the title code
index.html about.html login.html
30
Link to Email
31
Link with ID (on a page – top)
32
Table
<table> <table border="1"> <td>Two Two</td>
<tr> <tr> <td>Two Three</td>
<td>One One</td> <td rowspan="2">One </tr>
<td>One Two</td> One</td>
<tr>
</tr> <td>One Two</td>
<td colspan="2">Three
<td>One Three</td> One</td>
<tr> </tr> <td>Three Three</td>
<td>Two One</td> <tr> </tr>
<td>Two Two</td> </table>
</tr>
</table>
33
<table border="1" cellpadding="15" cellspacing="10"> <table border="1">
<thead>
<tr bgcolor="blue">
<th>Item No</th>
<th>Item No.</th>
<th>Item Name</th>
<th>Item Name</th>
<th>Item Price</th>
<th>Item Price</th>
</thead>
</tr>
<tbody>
<tr>
<tr>
<td>1</td>
<td>1</td>
<td>Hot Coffee</td>
<td>Hot Coffee</td>
<td bgcolor="yellow">2000 MMK</td>
<td bgcolor="yellow">2000 MMK</td>
</tr>
</tr>
<tr>
<tr>
<td>2</td>
<td>2</td>
<td>Iced Coffee</td>
<td>Iced Coffee</td>
<td>2500 MMK</td>
<td>2500 MMK</td>
</tr>
</tr>
<tr> </tbody>
<td>3</td> <tfoot>
<td>Whipped Coffee</td> <th colspan="2">Total</th>
<td>3500 MMK</td> <th>5000 MMK</th>
</tr> </tfoot>
34
</table> </table>
Forms
1. Form 1. Col and Row in text area
2. Fieldset
2. Email
3. Legend
3. url
4. Action (get or post)
5. label
4. Required
6. Input 5. Placeholder
7. Select 6. Color picker
8. Button 7. Date picker
9. HTML 5
10. Maxlength
8. Datalist
11. Size
35
Form
<form action="#" method="post">
Two types of methods: get and post
Get method is used to search data
<fieldset> Post method is used in login form.
Difference between get and post is …
<legend>Login Form</legend>
</fieldset>
</form>
36
Text Input
<form>
<fieldset>
<legend>Login Form</legend>
<label>User Name:</label><br>
<input type="text" name="firstname" size="15" maxlength=8 placeholder="Enter Your
Name..."><br><br>
<label>Password:</label><br>
<input type="password" name="password" size="15" maxlength=8 placeholder="Enter
Your Password..."><br><br>
<label>Message</label><br>
<textarea rows="5" cols="15">Enter Your Message</textarea>
</fieldset>
</form>
37
Selection : Radio Button
<label>Male</label>
<input type="radio" name="gender" value="Male">
<label>Female</label>
<input type="radio" name="gender" value="Female">
38
Selection: Checkbox
<input type="checkbox" name="" value="Apple">
<label>Apple</label>
<input type="checkbox" name="" value="Mango">
<label>Mango</label>
<input type="checkbox" name="" value="Orange">
<label>Orange</label>
39
Selection: Dropdown
<select> <select size="3">
<option value="Lion">Lion</option> <option value="Lion">Lion</option>
<option value="Tiger">Tiger</option> <option value="Tiger">Tiger</option>
</select> </select>
<select multiple>
<option value="Lion">Lion</option>
<option value="Tiger">Tiger</option>
<option value="Bear">Bear</option>
</select>
40
datalist
The <datalist> element specifies a list of <form>
pre-defined options for
an <input> element.
<input list="browsers" name="browser">
42
Datetime picker and Color picker
<input type="date" name="">
43
Input Text: email and url
<input type="url" name="">
44
Required, Size and Max length
<input type="text" name="username" id="un" required
max="20" size="8">
45
Sample Login Form
<form action="#" method="post">
<fieldset>
<legend>Login Form</legend>
<label>Username:</label><br>
<input type="text" name="username" id="un" required>
<br><br>
<label>Password:</label><br>
<input type="password" name="password" id="pw" required>
<br><br>
<input type="submit" name="login" value="Login">
</fieldset>
</form>
46
Image
<img src="../../images/capu.jpg“ >
<img src="../../images/capu.jpg" alt="Capu Image" title="Coffee" >
<img src="../../images/capu.jpg" width="300px" height="200px">
<img src="../../images/capu.jpg" width="300px" height="200px"
alt="capu" title="capu coffee">
<img src="../../images/capu.jpg" width="30%" alt="capu" title="capu
coffee">
47
marquee
<marquee>
<img src="../../images/capu.jpg" width="300px" height="200px">
<img src="../../images/creamcoffee.jpg" width="300px" height="200px">
<img src="../../images/mccoffee.jpg" width="300px" height="200px">
<img src="../../images/icedcoffee.jpg" width="300px" height="200px">
</marquee>
48
Marquee: direction
<marquee direction="right">
<img src="../../images/capu.jpg" width="300px" height="200px">
<img src="../../images/creamcoffee.jpg" width="300px" height="200px">
<img src="../../images/mccoffee.jpg" width="300px" height="200px">
<img src="../../images/icedcoffee.jpg" width="300px" height="200px">
</marquee>
49
Marquee: direction up and down
<marquee direction="up">
<img src="../../images/capu.jpg" width="300px" height="200px">
<img src="../../images/creamcoffee.jpg" width="300px" height="200px">
<img src="../../images/mccoffee.jpg" width="300px" height="200px">
<img src="../../images/icedcoffee.jpg" width="300px" height="200px">
</marquee>
<marquee direction="down">
<img src="../../images/capu.jpg" width="300px" height="200px">
<img src="../../images/creamcoffee.jpg" width="300px" height="200px">
<img src="../../images/mccoffee.jpg" width="300px" height="200px">
<img src="../../images/icedcoffee.jpg" width="300px" height="200px">
</marquee>
50
Marquee: behavior scroll
<marquee behavior="scroll">
<img src="../../images/capu.jpg" width="300px" height="200px">
<img src="../../images/creamcoffee.jpg" width="300px" height="200px">
<img src="../../images/mccoffee.jpg" width="300px" height="200px">
<img src="../../images/icedcoffee.jpg" width="300px" height="200px">
</marquee>
52
Audio
<audio controls>
<source src="../../media/HappyPiano.mp3" type="audio/mpeg">
</audio>
53
Video
<video controls>
<source src="../../media/CoffeeBeans.mp4" type="video/mp4">
</video>
54
Map (iframe)
Go to https://www.mapsdirections.info/en/custom-google-maps/
Press Create Custom Map and write your address
56
References
1. https://developer.mozilla.org/en-US/docs/Learn/Common_questions/
Pages_sites_servers_and_search_engines
2. https://www.w3schools.com/html/
3. HTML and CSS: Design and Build Websites: Duckett, Jon
4. https://stackoverflow.com/questions/21037711/sublime-text-2-paste-with-colors-to-
ms-word
57
Thank You for Your Time
Any Question ?
58
CSS
CSS stands for Cascading
Style Sheets
CSS describes how HTML
elements are to be displayed
on screen, paper, or in other
media
59
CSS Comments
/* This is a single-line comment */
p {
color: red;
}
60
Color Picker
https://pinetools.com/image-color-picker
61
Inline css
Internal css
External css
62
Inline css
<h1 style="background-color:navy;">Hello World</h1>
<p style="background-color:pink">Lorem ipsum dolor sit amet, consectetuer adipiscing
elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit
lobortis nisl ut aliquip ex ea commodo consequat.</p>
63
Internal CSS
<style type="text/css"> <h2>Hello World Heading Internal CSS
Testing</h2>
h2{
<p>Lorem ipsum dolor sit amet,
background-color: seagreen; consectetuer adipiscing elit, sed diam
} nonummy nibh euismod tincidunt ut laoreet
dolore magna aliquam erat volutpat. Ut wisi
p{ enim ad minim veniam, quis nostrud exerci
tation ullamcorper suscipit lobortis nisl ut
background-color: yellow; aliquip ex ea commodo consequat.</p>
}
</style>
64
External CSS
Create a css folder in the coffeehouse folder h3{
File New file background-color: brown;
Save untitled file as style.css in the css folder }
Write link code under the <title>
<link rel="stylesheet" type="text/css"
href="css/style.css"> li{
background-color: midnightblue;
<h3>Heading 3 External CSS Testing</h3> }
<p>H<sub>2</sub>O</p>
<ul> p{
<li>Apple</li>
color: gray;
<li>Mango</li>
}
<li>Orange</li>
65
css color and background-color
<h1 style="color:Tomato;">Hello <h1 style="background-
World</h1> color:DodgerBlue;">Hello World</h1>
<p style="color:DodgerBlue;">Lorem <p style="background-
ipsum...</p> color:Tomato;">Lorem ipsum...</p>
<p style="color:MediumSeaGreen;">Ut
wisi enim...</p>
Html color code website
Color Pattern Picker
66
padding
67
padding
68
border
CSS BORDER STYLE
dotted - Defines a dotted border
dashed - Defines a dashed border
solid - Defines a solid border
double - Defines a double border
groove - Defines a 3D grooved border. The effect depends on
the border-color value
ridge - Defines a 3D ridged border. The effect depends on the
border-color value
inset - Defines a 3D inset border. The effect depends on the
border-color value
outset - Defines a 3D outset border. The effect depends on
the border-color value
none - Defines no border
hidden - Defines a hidden border
69
margin
70
Navigation
HTML CSS
71
padding
72
css flex box
73