Ipr Module 1
Ipr Module 1
Internet:
● It is the largest network in the world that connects hundreds of thousands of individual
networks all over the world.
● The popular term for the Internet is the “information highway”.
● Rather than moving through geographical space, it moves your ideas and information
through cyberspace – the space of electronic movement of ideas and information.
● No one owns it.
● It has no formal management organization.
● As it was originally developed by the Department of defense, this lack of centralization
made it less vulnerable to wartime or terrorist attacks.
● To access the Internet, an existing network need to pay a small registration fee and agree
to certain standards based on the TCP/IP (Transmission Control Protocol/Internet
Protocol .
Web Essentials:
In the context of Internet Programming, Web Essentials refers to the foundational concepts, technologies,
and tools needed to build dynamic and interactive websites or web applications that communicate over the
internet.
CHP1:
Client:
The software that resides on the remote machine, communicates with the server, fetches the
information, processes it, and then displays it on the remote machine is called the client.
● initiates contact with server (―speaks firstǁ)
● typically requests service from server
● Web: client implemented in browser
Server:
● Web server is a computer where the web content is stored.
● Basically a web server is used to host the web sites but there exists other web servers also
such as gaming, storage, FTP, email etc.
● A web server is software and hardware that uses HTTP (Hypertext Transfer Protocol) and
other protocols to respond to client requests made over the World Wide Web.
● The main job of a web server is to display website content through storing, processing
and delivering web pages to users.
Web Page: A web page is a document or resource of information that is suitable for the World
Wide Web and can be accessed through a web browser.
Website: A collection of pages on the World Wide Web that are accessible from the same URL
and typically residing on the same server.
URL: Uniform Resource Locator, the unique address which identifies a resource on the Internet
for routing purposes.
Client-Server paradigm:
CHP1:
● The Client-Server paradigm is the most prevalent model for distributed computing
protocols.
● It is the basis of all distributed computing paradigms at a higher level of abstraction.
● It is service-oriented, and employs a request- response protocol.
● Client: When we talk about the word Client, it means to talk of a person or an
organization using a particular service. Similarly in the digital world a Client is a
computer (Host) i.e. capable of receiving information or using a particular service from
the service providers (Servers).
● Servers: Similarly, when we talk about the word Servers, It mean a person or medium
that serves something. Similarly in this digital world a Server is a remote computer
which provides information (data) or access to particular services.
Protocols
● The Web uses certain protocols for transferring and representing data.
● Set of rules for proper and meaningful communication.
● Networks have to follow these rules to successfully transmit data.
1- HTTP:
The Hypertext Transfer Protocol(HTTP) is used by the browser to tell the host computer what
file it wants to retrieve.
2- IP:
The Internet Protocol (IP) is used for routing IP packets between logan's computer and the server
based on IP addresses.
3- TCP:
The Transmission Control Protocol(TCP) is used for making sure the IP packets all arrive
correctly and in order.
CHP1:
HTTP:
● HTTP stands for HyperText Transfer Protocol.
● It is a protocol used to access the data on the World Wide Web (www).
● The HTTP protocol can be used to transfer the data in the form of plain text, hypertext,
audio, video, and so on.
● This protocol is known as HyperText Transfer Protocol because of its efficiency that
allows us to use it in a hypertext environment where there are rapid jumps from one
document to another document.
● HTTP is similar to the FTP as it also transfers the files from one host to another host.
● But, HTTP is simpler than FTP as HTTP uses only one connection, i.e., no control
connection to transfer the files.
● HTTP is used to carry the data in the form of MIME-like format.
● HTTP is similar to SMTP as the data is transferred between client and server.
● The HTTP differs from the SMTP in the way the messages are sent from the client to the
server and from server to the client.
● SMTP messages are stored and forwarded while HTTP messages are delivered
immediately.
Features of HTTP
● Connectionless protocol
● Media independent
● Stateless
Messages:
HTTP messages are of two types: request and response. Both the message types follow the same
message format.
CHP1:
Request Message: The request message is sent by the client that consists of a request line,
headers, and sometimes a body.
Response Message: The response message is sent by the server to the client that consists of a
status line, headers, and sometimes a body.
CHP1:
● A client that wants to access the document in an internet needs an address and to facilitate
the access of documents, the HTTP uses the concept of Uniform
● Resource Locator (URL).
● The Uniform Resource Locator (URL) is a standard way of specifying any kind of
information on the internet.
● The URL defines four parts: method, host computer, port, and path.
CHP1:
HTML5:
● Hyper text markup language.
● Basic building block of the web.
● It defines the meaning and structure of the web.
● Hypertext: hyperlinks that an html page may contain or links that connect web pages to one
another.
● Markup language: refers to the way tags are used to define the page layout and elements
within the page or used to define structure of web pages.
● Html can be used for:
1.Web pages development
2. Internet navigation
3. Interactive GUI
4. Game development
CHP1:
HTML STRUCTURE:
● The <!DOCTYPE html> declaration defines that this document is an HTML5 document.
● The <html> element is the root element of an HTML page.
● The <head> element contains meta information about the HTML page.
● The <title> element specifies a title for the HTML page (which is shown in the browser's
title bar or in the page's tab).
● The <body> element defines the document's body, and is a container for all the visible
contents, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
● The <h1> element defines a large heading.
● The <p> element defines a paragraph.
HTML ELEMENT:
● An HTML element is defined by a start tag, some content, and an end tag:
● <tagname> Content goes here... </tagname>
● The HTML element is everything from the start tag to the end tag:
● <h1>My First Heading</h1>
● <p>My first paragraph.</p>
● Web pages can be created and modified by using professional HTML editors.
● However, for learning HTML we recommend a simple text editor like Notepad (PC) or
TextEdit (Mac).
● We believe that using a simple text editor is a good way to learn HTML.
● Follow the steps below to create your first web page with Notepad or TextEdit.
● Step 1: Open Notepad (PC)
● Windows 8 or later:
● Open the Start Screen (the window symbol at the bottom left on your screen).
CHP1:
Type Notepad.
● Windows 7 or earlier:
● Open Start > Programs > Accessories > Notepad
HTML Headings
● HTML headings are defined with the <h1> to <h6> tags.
● <h1> defines the most important heading. <h6> defines the least important heading:
Code:
<!DOCTYPE html>
<html>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
</body>
</html>
OUTPUT:
HTML Paragraphs
● Possible values for the color are, many are predefined (red, blue, green, ...)
● All colors can be specified as a six character hexadecimal value: #RRGGBB
1. #FF0000 – red
2. #888888 – gray
3. #00FF00 –green
4. #000000 – black
● For example : <h1 style="background-color:#ff6347;">...</h1>
HTML Fonts
● The <font> tag specifies the font face, font size, and color of text.
<!DOCTYPE html>
<html>
<body>
<h1 style="font-family:verdana;">This is a heading</h1>
<p style="font-family:courier;">This is a paragraph.</p>
</body>
</html>
HTML List
● HTML lists allow web developers to group a set of related items in lists.
1. Unordered HTML List
● An unordered list starts with <ul> tag.
● Each list item starts with <li> tag.
● The list items will be marked with bullets (small black circles) by default.
CODE:
CHP1:
OUTPUT:
Code:
<!DOCTYPE html>
<html>
<body>
<h2>An ordered HTML list</h2>
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Output:
● The <a> tag defines a hyperlink, which is used to link from one page to another.
● An Anchor tag have 3 important attributes:
1. the href attribute (hypertext reference) defines the target address of the document.
2. the name attribute of the anchor tag can be used to enable users to “jump” to a specific point
on a page.
3. the target attribute specifies how the destination page or the target document should be
CHP1:
opened. target="_ blank" is used for opening of the target page in a new tab.
● Example, <a href="http://www.google.com"> Google </a>
● Example, <a href=“./index.php"> Home </a>.
● Example, <a href=“#reference"> Reference Section. </a>
HTML Images
● The HTML <img> element embeds an image into the document.
● Syntax: < img src = “ pathToImage” />
● Attributes:
1. the src attribute is required, and contains the path to the image we want to embed.
2. the alt attribute holds a text description of the image, which isn't mandatory but is
incredibly useful for accessibility (screen readers read this description out to their users
so they know what the image means). Alt text is also displayed on the page if the image
can't be loaded for some reason: for example, network errors, content blocking etc…
3. the width & height attribute can be in units of pixels or percentage of page or frame.
4. the align attribute (currently deprecated) will aligns the image with its surrounding
context (Use the float and/or vertical-align CSS properties instead of this attribute.
CODE:
<!DOCTYPE html>
<html>
<body>
<h2>HTML Image</h2>
<img src="pic_trulli.jpg" alt="Trulli" width="500" height="333">
</body>
</html>
HTML Tables:
● HTML tables allow web developers to arrange data into rows and columns.
● A table in HTML consists of table cells inside rows and columns.
● Each table cell is defined by a <td> ta and </td> tag.
● <td> stands for table data.
● Each table row starts with a <tr> tag and ends with </tr>.
CHP1:
● Sometimes you want your cells to be headers. In those cases use the <th> tag instead of
<td> tag.
Code:
OUTPUT:
HTML Forms
● HTML forms are used to create GUIs on Web pages
● Usually the purpose is to ask the user for information
CHP1:
Text field:
● The <input type=“text”> defines a single-line input field for text input.
● Code
<form>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname">
</form>
● Output
read out loud the label when the user focus on the input element.
Radio buttons:
● The <input type="radio"> defines a radio button.
● Radio buttons let a user select ONE of a limited number of choices.
● Code:
OUTPUT:
Checkboxes:
● The <input type=“checkbox”> defines a checkbox.
● Checkboxes let a user select ZERO or MORE options of a limited number of choices.
● Code:
CHP1:
● OUTPUT:
● OUTPUT:
CHP1:
● OUTPUT:
2. Video element:
● The <video> element is used to show a video on a web page.
● Code:
CHP1:
Semantic Elements:
● A semantic element clearly describes its meaning to both the browser and the developer.
● Examples of non-semantic elements: <div> and <span> - Tells nothing about its
content.
● Examples of semantic elements: <form>, <table>, and <article> - Clearly defines its
content.
● In HTML there are some semantic elements that can be used to define different parts of a
web page:
CHP1:
DRAG:
● Make an Element Draggable : Set the draggable attribute to true.
● < img draggable= “true”>
CHP1:
● function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
● Function is called , drag(event), that specifies what data to be dragged.
● The dataTransfer.setData() method sets the data type and the value of the dragged data.
● In this case, the data type is "text" and the value is the id of the draggable element.
Drop:
● function drop(ev) {
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
ev.target.appendChild(document.getElementById(data));
}
• Call preventDefault() to prevent the browser default handling of the data (default is open
as link on drop).
• Get the dragged data with the dataTransfer.getData() method. This method will return any
data that was set to the same type in the setData() method.
• The dragged data is the id of the dragged element.
• Append the dragged element into the drop element.
● Code:
CHP1:
● Output:
CHP1:
CSS 3
• CSS stands for cascading style sheets
• CSS describes how HTML elements are to be displayed on screen, paper, or in other media
• CSS saves a lot of work. It can control the layout of multiple web pages all at once
• External stylesheets are stored in CSS files
• CSS is used to define styles for your web pages, including the design, layout and variations
in display for different devices and screen sizes.
• A css rule consists of a selector and a declaration block.
CSS Selectors:
• CSS selectors are used to "find" (or select) the HTML elements you want to style.
• We can divide css selectors into five categories:
1. Simple selectors (select elements based on name, id, class)
2. Combinator selectors (select elements based on a specific relationship between them)
3. Pseudo-class selectors (select elements based on a certain state)
4. Pseudo-elements selectors (select and style a part of an element)
5. Attribute selectors (select elements based on an attribute or attribute value)
CSS Id selector:
• The id selector uses the id attribute of an HTML element to select a specific element.
• The id of an element is unique within a page, so the id selector is used to select one unique
element!
• To select an element with a specific id, write a hash (#) character, followed by the id of the
element.
CHP1:
• The css rule on next slide will be applied to the html element with id="para1":
• Code:
Output:
Output:
Output:
CHP1:
OUTPUT:
CHP1:
CODE:
OUTPUT:
CHP1:
Output:
Rule cascading
● A cascading style sheet rule tells the browser what the HTML looks like, and what it
should do.
● A rule can dictate what just one html tag should look like, or you can construct your
own rule to be applied as and where you want it.
● There are three parts to a rule: the selector, the property, and the value.
1. Selector: it is an html tag at which a style will be applied. This tag could be anything
like <h1> or <table>.
2. Property: it is a type of attribute of html tag. All html attributes are converted into CSS
properties.
3. Value: these are assigned to properties.
CHP1:
Inheritance
● When you set inherit on a CSS property, the property takes the value from the
element’s parent. This applies not only to inheritable properties, but to all CSS
CSS backgrounds
● The CSS background properties are used to add background effects for elements.
Properties Description
background_attachment Specifies whether the background images fixed or scrolls with the
rest of the page.
CSS Borders:
● The border-style property specifies what kind of border to display.
● The following values are allowed:
1. Dotted: defines a dotted border
2. Dashed:defines a dashed border
3. Solid: defines a solid border
4. Double: defines a double border
5. Groove: defines a 3D grooved border. The effect depends on the border-color value
6. Ridge: defines a 3D ridged border. The effect depends on the border-color value
7. Inset: defines a 3D inset border. The effect depends on the border-color value
8. Outset: defines a 3D outset border. The effect depends on the border-color value
9. None: defines no border
10. Hidden: defines a hidden border
CHP1:
CSS Colors
● The color property specifies the color of text.
● Syntax :
Color: color name;
CHP1:
● Property values:
Value Description
❑ Rgb:
❑ An RGB color value is specified with the rgb() function, which has the following
syntax: rgb(red, green, blue)
❑ Each parameter (red, green, and blue) defines the intensity of the color and can be an
integer between 0 and 255 or a percentage value (from 0% to 100%).
❑ For example, the rgb(0,0,255) value is rendered as blue, because the blue parameter is set to
its highest value (255) and the others are set to 0.
● Hexadecimal colors:
❑ A hexadecimal color is specified with: #RRGGBB, where the RR (red), GG (green) and
BB (blue) hexadecimal integers specify the components of the color. All values must be
between 00 and FF.
❑ For example, the #0000ff value is rendered as blue, because the blue component is set to its
highest value (ff) and the others are set to 00.
● Hsl colors:
❑ HSL stands for hue, saturation, and lightness - and represents a cylindrical-coordinate
representation of colors.
❑ An hsl color value is specified with the hsl() function, which has the following syntax:
❑ hsl(hue, saturation, lightness)
❑ Hue is a degree on the color wheel (from 0 to 360) - 0 (or 360) is red, 120 is green, 240 is
blue. Saturation is a percentage value; 0% means a shade of gray and 100% is the full color.
CHP1:
● Rgba colors
❑ Rgba color values are an extension of rgb color values with an alpha channel - which specifies
the opacity of the object.
❑ An rgba color is specified with the rgba() function, which has the following syntax: rgba(red,
green, blue, alpha)
❑ The alpha parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque).
● Hsla colors
❑ Hsla color values are an extension of hsl color values with an alpha channel - which specifies the
opacity of the object.
❑ An hsla color value is specified with the hsla() function, which has the following syntax:
(Hue, saturation, lightness, alpha)
❑ The alpha parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque).
• Box-shadow: Property applies shadow like a box. You only specify a horizontal and a
vertical shadow. The default color of the shadow is the current text-color.
CHP1:
• Box-shadow: Property applies shadow like a box. You only specify a horizontal and a
vertical shadow. The default color of the shadow is the current text-color.
Text formatting:
• CSS text formatting properties is used to format text and style text.
• CSS text formatting include following properties:
Property Description
Text decoration
Property Description
Text_underline_position Used to specify the position of underline set by text decoration property.
CHP1:
Output:
CSS3 Transformations:
CSS 2D Transforms:
• CSS transforms allow you to move, rotate, scale, and skew elements.
• Example: Mouse over the element below to see a 2D transformation: