Академический Документы
Профессиональный Документы
Культура Документы
Output:
Hello there welcome to html tag .It is heading one
this text will be italic and this text will not italic
The core setup
• It all begins with the <html> tag. This tag signifies the start
of a web page.
• You must always begin your HTML code with this tag and
all the other tags will go between <html> and it's closing tag
</html> .
• The body section is set with the <body> tag which comes
right after the <head> tag and the page's content will go
between <body> and it's closing tag </body>
• Page body:
<body>
Here is some text that will be seen on the page
</body>
An Entire HTML document
• The entire code:
<html>
<head>
<title>
HTML is cool
</title>
</head>
<body>
Here is some text that will be seen on the page
</body>
</html>
• This same structure will apply to the code of all of the pages you
will build, no matter how simple or complex.
HTML Text formatting
Output:
The font of this text will be Georgia, it will be green, and a size of 4.
Bold, italic, and underlined text
Output:
Output:
Here is some big text
Example:
<address> Technobic<br />
P.O. BOX 45<br />
Kombolch, Ethiopia<br />
</address>
HTML Colors
• In HTML, colors can be added by using the style
attribute.
• You can specify a color by its name (eg, blue), its
hexadecimal value (eg, #0000ff), RGB value (eg
rgb(0,0,255)), or its HSL value (eg
hsl(240,100%,100%)).
Syntax
Foreground Color
• To add color to an HTML element, you use
style="color:{color}", where {color} is the color
value.
HTML Colors
Example
<h3 style="color:blue">HTML Colors</h3>
Background Color
• To add a background color to an HTML element, you
use style="background-color:{color}", where {color}
is the color value.
For example:
For example:
• <h3 style="border:1px blue solid">HTML Colors</h3>
HTML Color Codes
Hex Code Decimal Code
Color Name
RGB RGB
Maroon 800000 128,0,0
Red FF0000 255,0,0
Orange FFA500 255,165,0
Yellow FFFF00 255,255,0
Olive 808000 128,128,0
Green 008000 0,128,0
Hex Code Decimal Code
Color Name
RGB RGB
Purple 800080 128,0,128
Fuchsia FF00FF 255,0,255
Lime 00FF00 0,255,0
Teal 008080 0,128,128
Aqua 00FFFF 0,255,255
Blue 0000FF 0,0,255
Superscripts and subscripts
Output:
102 = 100
Example:
H<sub>2</sub>O
Output:
H20
Creating spaces
Example:
some text
Lists
• Lists are an excellent way to present information in
an organized fashion.
Computer languages
1. HTML
2. Javascript
3. PHP
Example:
<b>Computer languages</b>
<ol type="I">
<li>HTML</li>
<li>Javascript</li>
<li>PHP</li>
</ol>
Output:
Computer languages
I. HTML
II. Javascript
III. PHP
Lists within lists
Example
<ul>
<li>Big animals
<ol type="I">
<li>Giraffe</li>
<li>Elephant</li>
<li>Bear</li>
</ol>
</li>
<li>Small animals
<ol type="I">
<li>Rabbit</li>
<li>Cat</li>
<li>Hamster</li>
</ol>
</li>
</ul>
Definition lists
• The <hr> tag takes the attribute width which specifies the
width of the horizontal line.
NOTE: The <hr> tag has no end tag.
Example:
<hr width="95%" />
Output:
Common character entities
Example:
Output:
google.com
HTML links
target - denotes where a link will open.
Example:
<a href="http://www. google.com" target="_blank">Google!</a>
HTML links
• The target attribute can have the following possible
values:
• _blank:- opens the URL in a new browser window.
• _self:- loads the URL in the current browser window.
• _parent:- loads the URL into the parent frame (still
within the current browser window). This is only
applicable when using frames.
• I then created the hyperlink (what the user will click on).
This is done by linking to the name of the named anchor.
You need to proceed the name with a hash (#) symbol.
• Example HTML Code:
<a href="#link_targets">Link Targets</a>
HTML links
Email Links
• You can create a hyperlink to an email address. To do
this, use the mailto attribute in your anchor tag.
• Example:
Email Links
• You can go a step further than this. You can auto-
complete the subject line for your users, and even the
body of the email. You do this appending subject and
body parameters to the email address.
• <a
href="mailto:abebe@example.com?subject=Question&
body=Hey there">Email to Abebe</a>
HTML Comments
• Comments are a part of the HTML code and is used
to explain the code. The main thing to remember is
that HTML comments are not visible to your
website visitors.
• You write comments like this:
<!-- Write your comment here -->
• Comments always start with <!-- and end with -->.
This tells the browser when a comment begins and
ends.
The <img> tag
Example:
<img src=“image.jpg“ />
• The alt attribute of <img> tag: specifies alternative
text to be displayed if an image does not load.
Example:
Password fields
<form>
Username: <input type="text" name="name" />
<br />
Password: <input type="password" name="password" />
</form>
Buttons
<form>
<input type="button" value="Click here for a message"/>
</form>
Radio buttons
<b> Which web browser do you use?</b>
<form>
<input type="radio" name="browser" value="Firefox"/> Firefox
<input type="radio" name="browser" value="Opera" />Opera
<input type="radio" name="browser" value="Chrome" />Chrome
<input type="radio" name="browser" value="Other" />Other
</form>
Checkboxes
Checkboxes are similar to radio buttons, but with checkboxes you can
select more than one option at a time.
Example:
Tables:
• are used to display content on a webpage in a tabular
format (much like a spreadsheet).
Example
Example:
<table border="1" cellspacing="2" cellpadding="2">
<tr> <td></td><td></td></tr>
<tr> <td></td><td></td></tr>
<tr> <td></td><td></td></tr>
</table>
Adding Content to the table
• Now that we have a structure for our table, we can
add some content to it. The content of a table is
placed inside the table's cells..so inside the <td> tags
in the table.
Example:
<table border="1" cellspacing="2" cellpadding="2">
<tr> <td>First row, first column</td>
<td>First row, second column</td> </tr>
<tr> <td>HTML</td> <td>Javascript</td> </tr>
<tr> <td>CSS</td> <td>PHP</td> </tr>
</table>
Empty cells
• A table cell may not appear unless it has content inside of it.
• You can include empty cells in a table by placing the
character entity inside a table cell.
Example:
<table border="2">
<tr>
<td>Four cells in this table</td>
<td>One is empty</td>
</tr>
<tr>
<td>Three are filled</td>
<td> </td>
</tr>
</table>
Headings
<table border="2">
<tr>
<th> Web development</th>
<th>Software development</th>
</tr>
<tr>
<td>HTML</td>
<td>C++</td>
</tr>
<tr>
<td>PHP</td>
<td>Fortran</td>
</tr>
</table>
Captions
<table border="2">
<caption> Computer languages</caption>
<tr>
<th>Web development</th>
<th>Software development</th>
</tr>
<tr>
<td>HTML</td>
<td>C++</td>
</tr>
<tr>
<td>PHP</td>
<td>Fortran</td>
</tr>
</table>
Table Column Spanning
• You can make a cell span more than one row using
the rowspan attribute of the <td> tag.
Example:
<body bgcolor="#FFFFFF">
<body bgcolor="rgb(255,255,255)">
<body bgcolor="white">
Setting the background color of a table
• To set one background color for an entire table, use
the bgcolor attribute inside the <table> tag.
Example:
<table border="1" bgcolor="orange">
<tr>
<td>Here is a</td>
<td>table with a</td>
</tr>
<tr>
<td>background color</td>
<td>of orange</td>
</tr>
</table>
Adding a background image to elements
<body background="images.jpg">
Adding a background image to a table
• You can add a background image to a table that will
cover the entire table.
Example:
<table border="1" background="images.jpg">
<tr>
<td>This table</td>
<td>will have</td>
</tr>
<tr>
<td>a sky</td>
<td>background image</td>
</tr>
</table>
HTML Marquees
• A HTML marquee is a scrolling piece of text
displayed either horizontally across or vertically
down your web site page depending on the settings.
• This is created by using HTML tag <marquee>.
Syntax:
• A simple syntax to use marquee is as follows:
Examples: