What HTML Consists of ?

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

* what HTML consists of ?

- consists of elements act together to perform web page

* what’s HTML elements ?


- there’s 2 shapes of the HTML element
1- pair element
< tagname > content < /tagname >
Starting tag end tag
2- empty element
<tagname / > or <tagname>

* what’s the main elements ?


- elements must be added in any html file

1- <html></html> → to hold all html page elements


2- <head></head> → to hold title of page and meta data
3-<body></body> → to hold all html elements that describe the content

* what’s nesting in html ?


- putting element inside element
- the main elements will be nested like this

<html lang="en">
<head>

</head>
<body>

</body>
</html>

* use <!DOCTYPE html > element at the first line


- to let the browser know that’s file html version is 5
<!DOCTYPE html>
<html>
<head>
</head>
<body>

</body>
</html>
* <title >title here</title>
1- defines a title in the browser tab
2- provides a title for the page when it is added to favorites
3- displays a title for the page in search engine results

- this element nested inside <head> element


EX:
<head>
<title>myProject</title>
</head>

* for make heading elements use


- from <h1></h1> to <h6></h6> as importance of the heading
EX:
<body>
<h1>heading1</h1>
<h2>heading2</h2>
<h3>heading3</h3>
<h4>heading4</h4>
<h5>heading5</h5>
<h6>heading6</h6>
</body>

* <p>paragraph here</p> → to add paragraph


EX:
<p>this is paragraph,this is paragraph,this is paragraph,this is
paragraph,this is paragraph,this is paragraph,this is paragraph,t
his is paragraph,this is paragraph,this is paragraph,this is para
graph,this is paragraph,this is paragraph,</p>
* <br/> → to make break line any where in document
EX:
<p>this is paragraph, <br> this is paragraph</p>

* <hr> → to make horizontal rule between elements


EX:
<p>this is paragraph, this is paragraph</p>
<hr>
<p>this is paragraph, this is paragraph</p>

* <pre> → will add text without remove white spaces


EX:
<p>this is paragraph,
this is paragraph</p>
<pre>this is paragraph,
this is paragraph</pre>

* HTML styling tags


1- <b> , <strong> → to make text bold
EX:

<p>this is <b>new</b> paragraph</p>


<p>this is <strong>new</strong> paragraph</p>

2- <i> , <em> → to make text italic


EX:
<p>this is <i>new</i> paragraph</p>
<p>this is <em>new</em> paragraph</p>

3- <small> → make font size smaller than default


EX:
<p>this is <small>new</small> paragraph</p>

4- <del> → insert line-through the text


EX:
<p>this is <del>new</del> paragraph</p>

5- <ins> → insert line under the text


EX:
<p>this is <ins>new</ins> paragraph</p>

6- <sub> → change the position of text to be lower than it’s line


EX:
<p>H <sub>2</sub> O</p>

7- <sup> → change the position of text to be higher than it’s line


EX:
<p>x <sup>2</sup></p>

* <a></a> → to add link into page


- you should use href attribute

-what’s the attribute ?


- are special words used inside the start tag to control the element's behavior
- it’s syntax
<tagname attrname =” value ”> content </tag name>

- in href attribute you will put the URL of the target website
EX:
<a href="https://www.google.com">click here</a>

- use target attribute to change link to open in new tab


- target attribute default value is _self , we will change it to _blank
EX:
<a href="https://www.google.com" target="_blank">click here</a>
*<img src =” ” alt =” ” /> → to inset image
- src attribute to set the path of the image in your pc
- alt attribute to display alternative text only when Image not loaded or damaged
EX:

<img src="1.jpg" alt="this image about tourism">

- if the image not next to the html file , you should write right path
- create new folder ( images ) inside the project folder and put the image inside it
EX:
<img src="images/1.jpg" alt="this image about tourism">

* <button></button> → to add button


EX:
<button>click here</button>

You might also like