INTERNET PROGRAMMING
- Common Elements
- Headers
- Linking
- Images
- Unordered Lists
- Nested and Ordered Lists
- HTML Tables
- Basic HTML Forms
1. COMMON ELEMENTS:-
Basic Elements
The basic elements of an HTML page are:
- A text header, denoted using the
<h1>
,<h2>
,<h3>
,<h4>
,<h5>
,<h6>
tags. - A paragraph, denoted using the
<p>
tag. - A horizontal ruler, denoted using the
<hr>
tag. - A link, denoted using the
<a>
(anchor) tag. - A list, denoted using the
<ul>
(unordered list),<ol>
(ordered list) and<li>
(list element) tags. - An image, denoted using the
<img>
tag - A divider, denoted using the
<div>
tag - A text span, denoted using the
<span>
tag
The next few pages will give an overview of these basic HTML elements.
Example:
Input: n = 5 v1[] = {3, 4, 2, 2, 4} m = 4 v2[] = {3, 2, 2, 7} Output: 2 2 3 Explanation: The common elements in sorted order are {2 2 3}
Your Task:
This is a function problem. You need to complete the function common_element that takes both the lists as parameters and returns a list of common elements.
Constraints:
1 ≤ n, m ≤ 105
1 ≤ Vi ≤ 105
Definition and Usage
The <header>
element represents a container for introductory content or a set of navigational links.
A <header>
element typically contains:
- one or more heading elements (<h1> - <h6>)
- logo or icon
- authorship information
Note: You can have several <header>
elements in one HTML document. However, <header>
cannot be placed within a <footer>, <address> or another <header>
element.
Example
A header for an <article>:
A heading here
Posted by John Doe
Some additional information here
Lorem Ipsum dolor set amet....
Prerequisite – Introduction of Compiler design
Linker is a program in a system which helps to link a object modules of program into a single object file. It performs the process of linking. Linker are also called link editors. Linking is process of collecting and maintaining piece of code and data into a single file. Linker also link a particular module into system library. It takes object modules from assembler as input and forms an executable file as output for loader.
Linking is performed at both compile time, when the source code is translated into machine code and load time, when the program is loaded into memory by the loader. Linking is performed at the last step in compiling a program.
Source code -> compiler -> Assembler -> Object code -> Linker -> Executable file -> Loader
Linking is of two types:
1. Static Linking –
It is performed during the compilation of source program. Linking is performed before execution in static linking. It takes collection of relocatable object file and command-line argument and generate fully linked object file that can be loaded and run.
Static linker perform two major task:
- Symbol resolution – It associates each symbol reference with exactly one symbol definition .Every symbol have predefined task.
- Relocation – It relocate code and data section and modify symbol references to the relocated memory location.
The linker copy all library routines used in the program into executable image. As a result, it require more memory space. As it does not require the presence of library on the system when it is run . so, it is faster and more portable. No failure chance and less error chance.
2. Dynamic linking – Dynamic linking is performed during the run time. This linking is accomplished by placing the name of a shareable library in the executable image. There is more chances of error and failure chances. It require less memory space as multiple program can share a single copy of the library.
Here we can perform code sharing. it means we are using a same object a number of times in the program. Instead of linking same object again and again into the library, each module share information of a object with other module having same object. The shared library needed in the linking is stored in virtual memory to save RAM. In this linking we can also relocate the code for the smooth running of code but all the code is not relocatable.It fixes the address at run time.
4. IMAGES:-
The HTML <img> tag is used to embed an image in a web page. Images are not technically inserted into a web page; images are linked to web pages. The <img> tag creates a holding space for the referenced image. ... src - Specifies the path to the image. alt - Specifies an alternate text for the image.
Images can improve the design and the appearance of a web page.
HTML Images Syntax
The HTML <img>
tag is used to embed an image in a web page.
Images are not technically inserted into a web page; images are linked to web pages. The <img>
tag creates a holding space for the referenced image.
The <img>
tag is empty, it contains attributes only, and does not have a closing tag.
The <img>
tag has two required attributes:
- src - Specifies the path to the image
- alt - Specifies an alternate text for the image
Example
HTML Image
The src Attribute
The required src
attribute specifies the path (URL) to the image.
Note: When a web page loads, it is the browser, at that moment, that gets the image from a web server and inserts it into the page. Therefore, make sure that the image actually stays in the same spot in relation to the web page, otherwise your visitors will get a broken link icon. The broken link icon and the alt
text are shown if the browser cannot find the image.
Example
<!DOCTYPE html>
<html>
<body>
<h2>Alternative text</h2>
<p>The alt attribute should reflect the image content, so users who cannot see the image gets an understanding of what the image contains:</p>
<img src="img_chania.jpg" alt="Flowers in Chania" width="460" height="345">
</body>
</html>
Alternative text
The alt attribute should reflect the image content, so users who cannot see the image gets an understanding of what the image contains:
Animated Images
HTML allows animated GIFs:
Example
HTML Unordered List or Bulleted List displays elements in bulleted format . We can use unordered list where we do not need to display items in any particular order. The HTML ul tag is used for the unordered list. There can be 4 types of bulleted list:
- disc
- circle
- square
- none
To represent different ordered lists, there are 4 types of attributes in <ul> tag.
Type | Description |
---|---|
Type "disc" | This is the default style. In this style, the list items are marked with bullets. |
Type "circle" | In this style, the list items are marked with circles. |
Type "square" | In this style, the list items are marked with squares. |
Type "none" | In this style, the list items are not marked . |
HTML Unordered List Example
- HTML
- Java
- JavaScript
- SQL
ul type="circle"
- HTML
- Java
- JavaScript
- SQL
ul type="square"
- HTML
- Java
- JavaScript
- SQL
ul type="none"
- HTML
- Java
- JavaScript
- SQL
I'd like to produce the following in HTML:
1. One
2. Two
1. Inner One
2. Inner Two
3. Three
One way is
<ol>
<li>One</li>
<li>Two</li>
<ol>
<li>Inner One</li>
<li>inner Two</li>
</ol>
<li>Three</li>
</ol>
Nested HTML Lists
Lists can be nested (list inside list):
<!DOCTYPE html>
<html>
<body>
<h2>A Nested List</h2>
<p>Lists can be nested (list inside list):</p>
<ol>
<li>Coffee</li>
<li>Tea
<ol>
<li>Black tea</li>
<li>Green tea</li>
</ol>
</li>
<li>Milk</li>
</ol>
</body>
</html>
A Nested List
Lists can be nested (list inside list):
- Coffee
- Tea
- Black tea
- Green tea
- Milk
HTML Table
Company | Contact | Country |
---|---|---|
Alfreds Futterkiste | Maria Anders | Germany |
Centro comercial Moctezuma | Francisco Chang | Mexico |
Ernst Handel | Roland Mendel | Austria |
Island Trading | Helen Bennett | UK |
Laughing Bacchus Winecellars | Yoshi Tannamuri | Canada |
Magazzini Alimentari Riuniti | Giovanni Rovelli | Italy |
Define an HTML Table
A table in HTML consists of table cells inside rows and columns
Example
A simple HTML table:
<!DOCTYPE html>
<html>
<style>
table, th, td {
border:1px solid black;
}
</style>
<body>
<h2>A basic HTML table</h2>
<table style="width:100%">
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
</table>
<p>To undestand the example better, we have added borders to the table.</p>
</body>
</html>
OUTPUT:-
A basic HTML table
Company | Contact | Country |
---|---|---|
Alfreds Futterkiste | Maria Anders | Germany |
Centro comercial Moctezuma | Francisco Chang | Mexico |
To undestand the example better, we have added borders to the table.
Example
HTML Forms
If you click the "Submit" button, the form-data will be sent to a page called "/action_page.php".
MY YouTube Channel SUBSCRIBE NOW
BALAN.E M.SC INFORMATION TECHNOLOGY 2 YEAR |
THANK YOU !