Unit 1
Unit 1
What is Internet
the Internet is a global network comprised of smaller networks that are interconnected
using standardized communication protocols. The Internet standards describe a framework
known as the Internet protocol suite. This model divides methods into a layered system of
protocols.
Using the internet we can send emails, photos, videos, messages to our loved ones. Or in other
words, the internet is a widespread interconnected network of computers and electronics
devices(that support internet). It creates a communication medium to share and get information
online. If your device is connected to the Internet then only you will be able to access all the
applications, websites, social media apps, and many more services. Internet nowadays is
considered as the fastest medium for sending and receiving information.
Origin Of Internet: The internet came in the year 1960 with the creation of the first working
model called ARPANET (Advanced Research Projects Agency). It allowed multiple computers
to work on a single network that was their biggest achievement at that time. ARPANET use
packet switching to communicate multiple computer systems under a single network. In October
1969, using ARPANET first message was transferred from one computer to another. After that
technology continues to grow.
What is WWW:
The World Wide Web (WWW) is a network of online content that is formatted in HTML and
accessed via HTTP. The term refers to all the interlinked HTML pages that can be accessed
over the Internet. The World Wide Web was originally designed in 1991 by Tim Berners-Lee
while he was a contractor at CERN.
The World Wide Web is most often referred to simply as "the Web."
It is all the Web pages, pictures, videos and other online content that can be accessed via a
Web browser. The Internet, in contrast, is the underlying network connection that allows us to
send email and access the World Wide Web.
What is DSN :
The Domain Name System (DNS) is called the phonebook of the Internet. When a user types a
domain name or website address into the address bar of the browser, the DNS server is
responsible for translating the domain name to a specific IP address, driving it to the correct
website.
Protocols :
What is protocols
A protocol is a set of rules and guidelines for communicating data. Rules are defined for each
step and process during communication between two or more computers. Networks have to
follow these rules to successfully transmit data.
Below protocols play the major role in web development
1.HTTP
2.FTP
3. SMTP
1.HTTP:
2.FTP
Email is emerging as one of the most valuable services on the internet today. Most internet
systems use SMTP as a method to transfer mail from one user to another. SMTP is a push
protocol and is used to send the mail whereas POP (post office protocol) or IMAP (internet
message access protocol) are used to retrieve those emails at the receiver’s side.
HTML 5 CONCEPTS:
HTML5 is a next version of HTML. Here, you will get some brand-new features which will make
HTML much easier. These new introducing features make your website layout clearer to both
website designers and users. There are some elements like <header>, <footer>, <nav> and
<article> that define the layout of a website.
<!DOCTYPE html>
<html>
<body>
</body> </html>
Already you see about head and body and title tags in your web technologies subject in last
semester
What is <!DOCTYPE>
On the HTML document you have often seen that there is a <!DOCTYPE html> declaration before
the <html> tag. HTML <!DOCTYPE> tag is used to inform the browser about the version of HTML
used in the document. It is called as the document type declaration (DTD).
Technically <!DOCTYPE > is not a tag/element, it just an instruction to the browser about the
document type. It is a null element which does not contain the closing tag, and must not include
any content within it.
HTML5 Document :
SECTION
ARTICAL
ASIDE
HEADER
FOOTER
NAV
1. Section:
<section> …. </section>
A page can be split into a section like introduction and contact information so ..on . each
of this section in different tag.
<section id="DS">
<h1> Data Structures</h1>
<p> Stack, Queue ,Linked List, Tree, Graph </p>
</section>
<section id="JS">
2.Article: It contains independent content which does’nt require any other context.
Example: Blog Post, Newspaper Article etc
<article id="prg">
3.Aside : It is used to place content in a sidebar i.e. aside the existing content. It is related to
surrounding content.
<aside>
<data> Place which elements are use to show on side bar </data>
</aside>
4.Header: it is for header for section or article . There can multiple header on a page
<article>
<header>
<h1> Class </h1>
</header>
<p> class is a logical structure </p>
</article>
<footer>
<p> Copy rights @ 2009 </p>
</footer>
<nav>
<a href="/html/">HTML</a> |
<a href="/css/">CSS</a> |
<a href="/js/">JavaScript</a> |
<a href="/python/">Python</a>
</nav>
Input Elements:
1. Date:
2. Datetime-local:
The resulting value includes the year, month, day, and time.
3. Month
5.time
6.email
The input value is automatically validated to ensure it is a properly formatted e-mail address.
7.range :
The <input type="range"> defines a control for entering a number whose exact value is not
important (like a slider control).
<section>
<h2>Price Range...</h2>
<label id="num"> Enthe the Price Range.. </label>
<input type ="range" value="count" min="500" max="10000" required/>
</section>
8. Url:
<section>
HTML5 Graphics:
1.Canvas
2.SVG
1.HTML Canvas :
The html canvas is used to draw the graphics on web page using javascript
The <canvas> is a element is only a container for graphics .You must use javascript actually
draw the graphics
<canvas id="canvas_1" width="300" height="300" style="border: 1px solid blueviolet; " />
If you want to draw in this canvas you need to write the javascript code
Step 1 : get the element of canvas into javascript code using below code
Step 2 : The getContext() is a built-in HTML object, with properties and methods for drawing:
var canvas = document.getElementById("canvas_1");
//alert(canvas);
var ctx = canvas.getContext("2d");
ctx.moveTo(0, 0);
ctx.lineTo(200, 100);
ctx.stroke();
for Draw the line we use moveTO and lineTo and stroke
moveTo: The moveTo() method moves the path to the specified point in the canvas, without
creating a line.
lineTo: The lineTo() method adds a new point and creates a line TO that point FROM the last
specified point in the canvas (this method does not draw the line).
Stroke():Use the stroke() method to actually draw the path on the canvas.
<!DOCTYPE html>
<html
<head>
<title> HTML 5 GRAPHICS ....</title>
</head>
<body>
<!-- canvas tag -->
<section id="canvas_basic">
<canvas id="canvas_1" width="300" height="300" style="border: 1px solid blueviolet; " />
</section>
<section>
<canvas id="canvas_2" width="200" height="200" style="border: 1px solid blue;"/>
</section>
</body>
<script>
var canvas_1 = document.getElementById("canvas_1");
//alert(canvas);
var ctx = canvas_1.getContext("2d");
ctx.moveTo(0, 0);
ctx.lineTo(200, 100);
ctx.stroke();
var canvas_2 = document.getElementById("canvas_2");
var ctx2 = canvas_2.getContext("2d");
ctx2.fillstyle="#FF0000";
ctx2.fillRect(0,0,100,50);
//ctx.fillstyle="#FF0000";
//ctx.fillRect(0,0,150,75);
</script>
</html>
Output:
Svg in HTML5:
Examples :
</circle>
</svg>
Now I want display the text on the circle . Let us see how you have to display the text on the
circle .
<section id ="SVG_1">
<svg width="200" height="200">
<circle cx="100" cy="100" r="60" stroke="blue" stoke-width="4" fill="blue"> </circle>
<text x="70" y="100" fill="white"> Iam Circle </text>
</svg>
</section>
Above code we use <text> tag after circle tag for display text on the circle
<section id ="svg_rect">
<svg width ="200" height="100">
<rect width="150" height="100" fill="blue" > Hey iam rectangle </rect>
<text x="10" y="50" fill="white"> hey this rectangle</text>
</svg>
</section>
HTML MEDIA :
Multimedia comes in many different formats. It can be almost anything you can hear or see, like
images, music, sound, videos, records, films, animations, and more.
.mpg,.mpeg,.avi,.wmv,.mp4,.webm,.swf,.ogg …etc
.midi,.wav,.gg,.wav,.mp3,.mp4…etc
1.video
2.Audio
3.object
4.embed
1. Video:
The html video element is used to show a video on video on web browser
Control : This Control Attribute adds the video like play,pause, and volume
Autoplay: Start the Video automatically (in most case’s it is not working in chrome)
Source tag in Video : Defines multiple media resources for media elements, such as <video>
and <audio>
2. Audio :
The HTML <audio> element is used to play an audio file on a web page.
The <source> element allows you to specify alternative audio files which the browser
may choose from. The browser will use the first recognized format.
<audio controls>
<source src="music.mp3" type="audio/mpeg"/>
</audio>
Plug-ins :
Plug-ins are computer programs that extend the standard functionality of the
browser.
3. Object :
</object>
4. Embed :
The <embed> element also defines an embedded object within an HTML document
5. Iframe :
An inline frame is used to embed another document within the current HTML document.
1.Margin
2.Padding
3.Border
4.Margin
1. Margin : Margin properties are used to create space around the elements out side of any
defined borders
Margin Properties:
Margin-top:
Margin-right:
Margin-bottom:
Margin-left:
2.Padding : The css padding properties are used to create space around an elements context
inside of any defined borders
Padding Properties :
Padding-top
Padding-right
Padding-bottom
Padding-left
1. Rounded
<style>
.rounded1{
border-radius: 30px;
background-color: cornflowerblue;
width:200px;
height: 150px;
}
</style>
<body>
<div>
<spam style="padding: 20px;"> hey iam rounded1</spam>
</div>
</body>
The border-radius properties:
1.border-top-right-radius
2.border-top-left-radius
3.border-bottom-right-radius
4.border-bottom-left-radius
.rounded3{
border-top-left-radius: 12px;
border-bottom-right-radius:50px;
background-color: brown;
width: 200px;
height: 150px;
}
<div class="rounded3">
<spam style="padding: 20px;">
border-rounded properties
</spam>
</div>
2.Border Images :
border-image is used for the draw the image around the element
example : border-image:url(“image.jpg”) 30
below code for border-image:
.border_image{
border: 10px solid transparent ;
border-image: url("border.jpg") 20 round;
padding: 20px;
width: 200px;
height: 150px;
}
Css allows multiple background images for an element , through the background-image
property
html {
background-image: url(logo.png ), url(bgi2.jpg);
height: 100%;
background-position: bottom right, left;
background-repeat: no-repeat, repeat;
padding: 15px;
}
CSS Shadow:
1.text-shadow
2.box-shadow
1.text-shadow :
2.box-shadow
The CSS box-shadow property is used to apply one or more shadows to an element
1.translate (): Method moves an element from it current position (according to the parameters
given for the X-axis and the Y-axis)
2.rotate (): rotate the element clockwise or counter-clockwise according a given degree
3.scale():The scale method is increase and decrease the size of the element
For example scale(2,3) based on this 2 times width and 3 times height
4.skew(): method skews an element along the X and Y-axis by the given angles.
5.Matrix():The matrix() method combines all the 2D transform methods into one.
The matrix() method take six parameters, containing mathematic functions, which allows you to
rotate, scale, move (translate), and skew element
3d transmission:
With the CSS transform property you can use the following 3D transformation methods:
1.rotateX(40deg)
2.rotateY(45deg)
3.rotate(90deg)
#mydiv{
transform: rotateX(40deg);
transform: rotateY(45deg);
transform: rotateZ(90deg);
}
Out put :
Css Animation :
@keyframes
When you specify CSS styles inside the @keyframes rule, the animation will gradually change
from the current style to the new style at certain times.
#div_1{
border: 2px;
background-color: aqua;
height:200px;
width: 200px;
animation-name: example;
animation-duration: 10s;
}
#div_2{
background-color: black;
height:200px ;
width: 200px;
animation-name: example2;
animation-duration: 4s;
}
#div_3{
background-color: green;
height: 200px;
width: 200px;
position: absolute;
right: 0px;
top: 0px;
animation: example1;
animation-duration: 15s;
}
@keyframes example1{
0%{background-color:blueviolet; right:0px; top:0px;}
25%{background-color: brown; right: 200px; top:0px;}
50%{background-color: chocolate; right: 200px; top:200px;}
75%{background-color:green; right:0px; top:200px;}
100%{background-color: darkgreen; right:0px; top:0px;}
}
@keyframes example2 {
0%{background-color: orange;}
25%{background-color: red;}
50%{background-color:yellow;}
100%{background-color: green;}
}
@keyframes example {
from{background-color: red}
to{background-color:green}
CSS Tooltip:
Tool tip is used to specify extra information about particular html element. When user moves the
mouse
1 .tooltip
2.tooltiptext
3.tooltip:hover .tooltiptext
1. Tooltip: this style to use display the of main content we have to define the like below :
2. .tooltip {
3. position: relative;
4. display: inline-block;
5. border-bottom: 1px dotted black;
6. }
2 . Tooltiptext: this style for extra information . below style for extra information
2. .tooltiptext {
3. visibility: hidden;
4. width: 300px;
5. height: 50px;
6. white-space: initial;
7. background-color: orangered;
8. color: #fff;
9. text-align: center;
10. border-radius: 6px;
11. padding: 5px 0;
12. /* Position the tooltip */
13. position: absolute;
14. }
3 .tooltip:hover .tooltiptext : This style is used display hide text through mouse on over .
4 .tooltip:hover .tooltiptext {
5 visibility: visible;
6 }
Responsive web design makes your web page look good on all devices.
1.Viewport
2.Gridview
3.Media
1. Viewport:
The viewport varies with the device, and will be smaller on a mobile phone than on a
computer screen.
Html5 introduced <meta> tag this tag helps to control over the view port
The width=device-width part sets the width of the page to follow the screen-width of the device
(which will vary depending on the device).
The initial-scale=1.0 part sets the initial zoom level when the page is first loaded by the browser.
2. Gridview:
Many web pages divided into grid view , which means that the page is divided into columns .
we want to use a responsive grid-view with 12 columns, to have more control over the web
page.
100/12:8.333
Based on this we have to define the col values like col-1:8.33 for col-2 you need add 8.33 +
8.33 for col-3 you need to add the value of col-2 +8.33 so … on
.col-1 : 8.33%
.col-2 : 16.66%
.col-3 : 25%
.col-4 : 33.33%
.col-5 : 41.66%
.col-6 : 50%
.col-7 : 58.33%
.col-8 : 66.66%
.col-9 : 75%
.col-10 : 83.33%
.col-11 : 91.66%
.col-12 : 100%
Example of 12 columns:
[class*="col-"]
{
float: left;
padding:15px;
}
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
[class*= “col-“]
Float:left;
Padding:15px;
Above code for common style for the naming sequence of “col- “
3.Media Query
It uses the @media rule to include a block of CSS properties only if a certain condition is true.
<style>
body{
background-color: black;
body{
background-color: brown;
} }
Above style when page more than 600px then background color black when page reduced or
reach to 600px then background-color: brown
1.what is xml
3.xml Schema
4.DOM
5.xslt
6.sax
1. what is xml
XML documents form a tree structure that starts at "the root" and branches to "the
leaves".
XML DTD:
An XML document validated against a DTD is both "Well Formed" and "Valid".
A DTD defines the structure and the legal elements and attributes of an XML document.
<!DOCTYPE note
[
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]>
!DOCTYPE note - Defines that the root element of the document is note
!ELEMENT note - Defines that the note element must contain the elements: "to, from,
heading, body"
!ELEMENT to - Defines the to element to be of type "#PCDATA"
!ELEMENT from - Defines the from element to be of type "#PCDATA"
!ELEMENT heading - Defines the heading element to be of type "#PCDATA"
!ELEMENT body - Defines the body element to be of type "#PCDATA"
Xml schema:
An XML Schema describes the structure of an XML document, just like a DTD.
An XML document validated against an XML Schema is both "Well Formed" and "Valid".
<xs:element name="note">
<xs:complexType>
<xs:sequence>
<xs:element name="to" type="xs:string"/>
<xs:element name="from" type="xs:string"/>
<xs:element name="heading" type="xs:string"/>
<xs:element name="body" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
One of the greatest strength of XML Schemas is the support for data types.
SCHEMA DTD
XSD stands for XML Schema Definition. DTD stands for Document Type Definition.
XSDs are written in XML. DTDs are derived from SGML syntax.
XSD supports datatypes for elements and DTD doesn't support datatypes.
attributes.
XSD defines order for child elements. DTD doesn't define order for child
elements.
XSD is simple to learn because you don't DTD is not simple to learn.
need to learn new language.
4 XML DOM:
DOM is an acronym stands for Document Object Model. It defines a standard way to access
and manipulate documents. The Document Object Model (DOM) is a programming API for
HTML and XML documents. It defines the logical structure of documents and the way a
document is accessed and manipulated.
XML DOM
Refer xml tree concept for under stand tree structure in xml
Let see how to access the xml document in html using javascript
Address .xml
5.XSLT :
Before XSLT, first we should learn about XSL. XSL stands for EXtensible Stylesheet Language.
It is a styling language for XML just like CSS is a styling language for HTML.
XSLT stands for XSL Transformation. It is used to transform XML documents into other formats
(like transforming XML into HTML).
In HTML documents, tags are predefined but in XML documents, tags are not predefined. World
Wide Web Consortium (W3C) developed XSL to understand and style an XML document, which
can act as XML based Stylesheet Language.
o XSLT: It is a language for transforming XML documents into various other types of
documents.
o XPath: It is a language for navigating in XML documents.
o XQuery: It is a language for querying XML documents.
o XSL-FO: It is a language for formatting XML documents.
The XSLT stylesheet is written in XML format. It is used to define the transformation rules to be
applied on the target XML document. The XSLT processor takes the XSLT stylesheet and applies
the transformation rules on the target XML document and then it generates a formatted document
in the form of XML, HTML, or text format. At the end it is used by XSLT formatter to generate the
actual output and displayed on the end-user.
A list of advantages of using XSLT:
o XSLT provides an easy way to merge XML data into presentation because it applies user
defined transformations to an XML document and the output can be HTML, XML, or any
other structured document.
o XSLT provides Xpath to locate elements/attribute within an XML document. So it is more
convenient way to traverse an XML document rather than a traditional way, by using
scripting language.
o XSLT is template based. So it is more resilient to changes in documents than low level
DOM and SAX.
o By using XML and XSLT, the application UI script will look clean and will be easier to
maintain.
o XSLT templates are based on XPath pattern which is very powerful in terms of
performance to process the XML document.
6 .XML SAX:
SAX is a programming interface for processing XML files based on events. The
DOM’s counterpart, SAX, has a very different way of reading XML code. The Java
implementation of SAX is regarded as the de-facto standard. SAX processes
documents state-independently, in contrast to DOM which is used for state-
dependent processing of XML documents.
Parsers are used to process XML documents. The parser examines the XML
document, checks for errors, and then validate it against a schema or DTD if it’s
a validating parser. The next step is determined by the parser in use. It may copy
the data into a data structure native to the computer language you’re using on
occasion. It may also apply styling to the data or convert it into a presentation
format.
Apart from triggering certain events, the SAX parser does nothing with the data.
It is up to the SAX parser’s user to decide. The SAX events include (among
others) as follows:
1. XML Text Nodes
2. XML Element Starts and Ends
3. XML Processing Instructions
4. XML Comments