UNIT - II(WIDT)
UNIT - II(WIDT)
UNIT – II
HTML forms: HTML form elements, input types, input attributes, HTML5, HTML graphics,
HTML media – video, audio, plug INS, you tube.
CSS: CSS home, introduction, syntax, colours, back ground, borders, margins, padding,
height/width, text, fonts, icons, tables, lists, position, over flow, float, CSS combinators,
pseudo class, pseudo elements, opacity, tool tips, image gallery, CSS forms, CSS counters,
CSS responsive.
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 1
WEB INTERFACE DESIGNING TECHNOLOGIES
Syntax:
<form>
First name: <input type="text" name="first_name" />
Last name: <input type="text" name="last_name" />
</form>
4.Checkbox Control:
❖ Checkboxes are used when more than one option is required to be selected.
❖ They are also created using HTML <input> tag but type attribute is
target= checkbox.
❖ The common attributes are type, name, value and checked used in <checkbox>
tag.
Syntax:<form>
<input type="checkbox" name="Web technology" value="on"> Web technology
<input type="checkbox" name="Mathematics" value="on"> Mathematics
</form>
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 2
WEB INTERFACE DESIGNING TECHNOLOGIES
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 3
WEB INTERFACE DESIGNING TECHNOLOGIES
Syntax:<form>
<input type="submit" name="submit" value="Submit" />
<input type="reset" name="reset" value="Reset" />
<input type="button" name="ok" value="OK" />
<input type="image" name="imagebutton" src="D:\subbu\webtech\html5.gif" />
</form>
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 4
WEB INTERFACE DESIGNING TECHNOLOGIES
</textarea>
<br/><br/>
4 Upload Aadhar Card:
<input type = "file" name = "fileupload" accept = "image/*" /><br/><br/>
<input type = "submit" name = "submit" value = "Submit" />
<input type = "reset" name = "reset" value = "Reset" />
<input type = "button" name = "ok" value = "OK" />
<input type = "image" name = "imagebutton"
src = "D:\WebTech\Html5.png" width="60" height="40"/><br/><br/>
<marquee bgcolor="yellow" >Hi Welcome to Form Elements</marquee>
</form></body></html
Output:
• Multimedia: Multimedia comes in many different formats. It can be almost anything you
can hear or see.
• Multimedia on the web is sound, music, videos, movies, and animations and more. Web
pages often contain multimedia elements of different types and formats.
• Multimedia Formats:Multimedia elements (like audio or video) are stored in media files.
The most common way to discover the type of a file is to look at the file extension.
• Multimedia files have formats and different extensions like: .swf, .wav, .mp3, .mp4,
.mpg, .wmv, and .avi.
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 5
WEB INTERFACE DESIGNING TECHNOLOGIES
1. video tag:HTML 5 supports <video> tag also. The HTML video tag is used for streaming
video files such as a movie clip, song clip on the web page. Currently, there are three video
formats supported for HTML video tag.
1. mp4 2. webM 3. Ogg
2. audio tag:since the release of HTML 5, audios can be added to webpages using the
“audio” tag.
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 6
WEB INTERFACE DESIGNING TECHNOLOGIES
3. Plug – in: Plug – ins are computer programs that extend the standard functionality of the
browser.
a. The <embed> element: The <embed> element also defines an embedded object with in
an HTML document. Web browsers have supported the <embed> element for a long time.
However, it has not been a part of the HTML specification before HTML5.
Example:
<html>
<head>
<title>html embed tags</title>
</head>
<body>
<embed src=”audi.jpeg”>
</body>
</html>
b. The <object> element: The <object> element defines an embedded object with in an
HTML document. It was designed to embed plug – ins in web pages, but can also be used to
include HTML in HTML.
Example:
<html>
<head>
<title>html object tags</title>
</head>
<body>
<object width=”100%” height=”500px” data=”objects.html” type=”audio/mp3”>
</object>
</body>
</html>
4. Youtube: youtube accepts all types of videos to upload and get them played without
converting it. Youtube also supports add youtube links to the HTML tags and get them
played on the web pages without downloading.
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 7
WEB INTERFACE DESIGNING TECHNOLOGIES
Example:
<html>
<head>
<title>html iframe tags</title>
</head>
<body>
<iframe width=”500%” height=”480”
src=”https://www.youtube.com/embed/il_t1WVLNxk” >
</iframe>
</body>
</html>
❖ Style sheet: A Style Sheet is a collection of style rules that tells a browser how the
various styles are to be applied to the HTML tags to present the document.
❖ CSS stands for Cascading Style Sheets. CSS was invited by HakonWium Lie on
October 10, 1994.
❖ It is a style sheet language which is used to describe the look and formatting of a
document written in markup language.
❖ CSS is used to define styles for your web pages, including the design, layout and
variations in display for different devices and screen sizes.
❖ External style sheets are stored in CSS files.
❖ HTML, CSS and JavaScript are used for web designing. It helps the web designers to
apply style on HTML tags.
CSS Syntax:
❖ A CSS comprises of style rules that are interpreted by the browser and then applied
to the corresponding elements in your document.
❖ The declaration block contains one or more declarations separated by semicolons.
Each declaration includes a CSS property name and a value, separated by a colon.
❖ A CSS declaration always ends with a semicolon, and declaration blocks are
surrounded by curly braces.
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 8
WEB INTERFACE DESIGNING TECHNOLOGIES
❖ CSS saves time − you can write CSS once and then reuse same sheet in multiple
HTML pages. You can define a style for each HTML element and apply it to as many
Web pages as you want.
❖ Pages load faster − If you are using CSS, you do not need to write HTML tag
attributes every time. Just write one CSS rule of a tag and apply it to all the
occurrences of that tag. So less code means faster download times.
❖ Easy maintenance − To make a global change, simply change the style, and all
elements in all the web pages will be updated automatically.
❖ Global web standards − Now HTML attributes are being deprecated and it is being
recommended to use CSS. So it’s a good idea to start using CSS in all the HTML
pages to make them compatible to future browsers.
❖ Offline Browsing − CSS can store web applications locally with the help of an offline
catche. Using of this, we can view offline websites. The cache also ensures faster
loading and better overall performance of the website.
❖ Platform Independence − The Script offer consistent platform independence and
can support latest browsers as well.
❖ Multiple Device Compatibility– CSS can also allow the HTML documents to be
optimized for more than one type of device or media.
❖ Style sheet: A Style Sheet is a collection of style rules that that tells a browser how
the various styles are to be applied to the HTML tags to present the document.
❖ Rules can be applied to all the basic HTML elements, for example the <p> tag, or
you can define you own variation and apply them where you wish to.
❖ CSS is added to HTML pages to format the document according to information in
the style sheet.
❖ There are three ways to insert CSS in HTML documents.
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 9
WEB INTERFACE DESIGNING TECHNOLOGIES
1. Inline CSS
2. Internal CSS or Embedded CSS
3. External CSS
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 10
WEB INTERFACE DESIGNING TECHNOLOGIES
Output:
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 11
WEB INTERFACE DESIGNING TECHNOLOGIES
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 12
WEB INTERFACE DESIGNING TECHNOLOGIES
I. <div>tag :
❖ DIV is a division tag which is used to set the position of the content dynamically in
the webpage.
❖ The div element block separates the block from its surrounding content by a line
break.
❖ The <div> tag defines logical divisions in web page. It acts a lot like a paragraph tag,
but it divides the page up into larger sections.
❖ <div> tag gives the chance to define the style of whole section of HTML.
❖ The primary attributes of the <div> tag are: style, class and ID.
❖ To display the content in the specific position using div tag we have to use dynamic
properties as
• Position: absolute
• Left: point from the side specified
• Top: points from the top position
• Width: horizontal size of the div tag
• height: vertical size of the div tag
Example: To implement overlapping of images using img tag and div tag.
<!DOCTYPE html>
<html>
<head>
<title> Division tag </title>
</head>
<body bgcolor="sky blue">
<div style="position: absolute; left: 100; top: 80; border: 5px solid;">
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 13
WEB INTERFACE DESIGNING TECHNOLOGIES
Output:
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 14
WEB INTERFACE DESIGNING TECHNOLOGIES
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 15
WEB INTERFACE DESIGNING TECHNOLOGIES
</layer>
<layer style="background-color: blue; width:300px; height:100px;
position:relative; top:-220px; left:120px; z-index:3;">
</layer>
</body>
</html>
Output:
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 16
WEB INTERFACE DESIGNING TECHNOLOGIES
There are mainly certain types of properties of font, color and background, text, boxes and
lists etc.
I. Font properties:
The following are the font properties available:
These properties control the color of the text and the background, as well as the placement
and properties of a background image.
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 17
WEB INTERFACE DESIGNING TECHNOLOGIES
text- indent length/percentage { text- indent: 25px; } Indents the first line of
text
text- shadow length/percentage {text- shadow: 4px 4px 8px blue; } Set the shadow
around a text.
letter- spacing normal/length { letter- spacing: 4pt; } Provides space
between the letters
word- spacing normal/length { word- spacing: 4pt; } Set the space between
words.
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 18
WEB INTERFACE DESIGNING TECHNOLOGIES
V. List properties:
These properties control the formatting of HTML lists, ie<ol>and <ul>.
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 19
WEB INTERFACE DESIGNING TECHNOLOGIES
</style>
</head>
<body>
<h2>add a border to a table</h2>
<table>
<tr>
<th>firstname</th>
<th>lastname</th>
</tr>
<tr>
<td>balu</td>
<td>u</td>
</tr>
<tr>
<td>mani</td>
<td>k</td>
</tr>
</table>
</body>
</html>
4. CSS table – layout property: The table – layout property defines the algorithm
used to layout table cells, rows, and columns.
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 20
WEB INTERFACE DESIGNING TECHNOLOGIES
Example:
table{
table-layout:auto;
width:100%;
}
table{
table-layout:fixed;
width:100%;
}
5. CSS caption – side property: The caption – side property specifies the placement
of a table caption.
Example:
table{
caption-side:top;
}
6. CSS empty – cells property: The empty – cells property sets whether or not to
display borders on empty cells in a table.
Example:
table{
empty-cells:hide;
}
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 21
WEB INTERFACE DESIGNING TECHNOLOGIES
</style>
</head>
<body>
<p>This style will be applied on every paragraph.</p>
<p id="para1">Welcome to CSS</p>
<p>Hello CSS</p>
</body>
</html>
Output:
2. The id Selector:
❖ The id selector uses the id attribute of an HTML element to select a specific
element.
❖ The id of an element should be 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.
❖ The style rule below will be applied to the HTML element with id="para1":
Example :
<html>
<head>
<style type="text/css">
#para1
{
text-align: left;
color: navy;
font-family:verdana;
}
</style>
</head>
<body>
<p id="para1">Hello Welcome to CSS</p>
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 22
WEB INTERFACE DESIGNING TECHNOLOGIES
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 23
WEB INTERFACE DESIGNING TECHNOLOGIES
4. Grouping Selectors:
❖ If you have elements with the same style definitions. It will be better to group the
selectors, to minimize the code.
❖ To group selectors, separate each selector with a comma.
❖ In the example below we have grouped the selectors.
Example:
<html>
<head>
<style type="text/css">
h1, h2, p {
text-align: center;
color: tomato;
}
</style>
</head>
<body>
<h1>Welcome to CSS</h1>
<h2>Hello CSS</h2>
<p>You are working with Group Selector</p>
</body>
</html>
Output:
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 24
WEB INTERFACE DESIGNING TECHNOLOGIES
Syntax:
The syntax of pseudo-elements:
selector::pseudo-element
{
property: value;
}
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 25
WEB INTERFACE DESIGNING TECHNOLOGIES
Example
p::first-line
{
color: #ff0000;
font-variant: small-caps;
000000000000000000000000000000000000000}
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 26
WEB INTERFACE DESIGNING TECHNOLOGIES
{
color: red;
font-size: 23px;
}
color: red;
background: yellow;
}
Example program:
<html>
<head>
<title>example of css</title>
<style>
P::first-line{
color:blue;
font-variant:small-caps;
}
h1::before{
content:url(“/examples/images/marker-left.gif”);
}
h1::after{
Content:url(“/examples/images/marker-left.gif”);
}
h2:: first-letter{
color:red;
font-size:xx-large;
}
</style>
</head>
<body>
<h1>Adityadegree college</h1>
<p>
The first line of this paragraph is styled differently form the rest of line
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 27
WEB INTERFACE DESIGNING TECHNOLOGIES
The first line of this paragraph is styled differently form the rest of line
</p >
<h2>hello india</h2>
</body>
</html>
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 28
WEB INTERFACE DESIGNING TECHNOLOGIES
<p>visit<a href=https://www.adityacollege.comv
target="_blank">adityaclg</a></p>
</body>
</html>
Note: a:hover MUST come after a:link and a:visited in the CSS definition in order to be
effective! a:active MUST come after a:hover in the CSS definition in order to be effective!
Pseudo-class names are not case-sensitive.
<html>
<head>
<style>
body
counter-reset: section;
h2::before
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 29
WEB INTERFACE DESIGNING TECHNOLOGIES
counter-increment: section;
</style>
</head>
<style>
body{
counter-reset:section;
content:"section" counter(section)":";
h2::before {
counter-increment: section;
</style>
</head>
<body>
<h2>java</h2>
<h2>html</h2>
<h2>css</h2>
<h2>oracle</h2>
</body>
</html>
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 30
WEB INTERFACE DESIGNING TECHNOLOGIES
Using the icon library is the easiest way to add icons to our HTML page. It is possible to
format the library icons by using CSS. We can customize the icons according to their color,
shadow, size, etc.
There are given some of the icon libraries such as Bootstrap icons, Font Awesome
icons, and Google icons that can be used in CSS easily. There is no need to install or
download the libraries mentioned above.
Example:
<html>
<head>
<script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous">
</script>
</head>
<body>
<i class="fasfa-cloud"></i>
<i class="fasfa-heart"></i>
<i class="fasfa-car"></i>
<i class="fasfa-file"></i>
<i class="fasfa-bars"></i>
</body>
</html>
2. Google icons:
As similar to the above libraries, we can add it in our HTML page simply by adding the
link given below in the <head></head> section.
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
Example:
<html>
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>
<body>
<i class="material-icons">cloud</i>
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 31
WEB INTERFACE DESIGNING TECHNOLOGIES
<i class="material-icons">favorite</i>
<i class="material-icons">attachment</i>
<i class="material-icons">computer</i>
<i class="material-icons">traffic</i>
</body>
</html>
3. Bootstrap Icons:
To use the Bootstrap glyphicons, add the following line inside the <head> section of
your HTML page:
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
Example:
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/
bootstrap.min.css">
</head>
<body>
<i class="glyphiconglyphicon-cloud"></i>
<i class="glyphiconglyphicon-remove"></i>
<i class="glyphiconglyphicon-user"></i>
<i class="glyphiconglyphicon-envelope"></i>
<i class="glyphiconglyphicon-thumbs-up"></i>
</body>
</html>
K.Manikanta, Department Of Computer Science, Aditya Degree College For Women, Kkd 32