Docsity

INTRODUCTION TO WEB TECHNOLOGY, Lecture notes of Web Programming and Technologies

Partial preview of the text

Download INTRODUCTION TO WEB TECHNOLOGY and more Lecture notes Web Programming and Technologies in PDF only on Docsity!

BCA SEM- 1

WEB TECHNOLOGY

WEB TECHNOLOGY

UNIT-I Introduction to World Wide Web, Web Browsers, Web Servers, BOM, DOM, HTTP. HTML5: Introduction, HTML5 Tags, Links, Input, Images, Lists, Tables, Creating Forms, Styling Forms, Placeholder, Inline and Block elements, Id vs Class elements. UNIT-II CSS3– Basics: Need and Benefit of CSS3, CSS3 Syntax, Comments, Including CSS3 in HTML Documents (Inline, Embedded and External Style Sheets).CSS3- Selectors: Universal Selector, Element Type Selector, Id Selectors, Class Selectors, Group Selectors. CSS3-Styles: CSS Color, CSS Background, CSS Fonts, CSS Text, CSS Links, CSS Lists, CSS Tables.CSS3-Box Model: Margin, Padding, Border, Outline, Visibility, Display, Multiple Columns. UNIT – III Responsive Web Design (RWD)- Introduction, Viewport, Creating Responsive Websites, Responsive Images, Responsive Texts. RWD-Media Queries: Introduction, Media Types, Device Breakpoints. RWD-Grid View: Introduction, grid-row, grid-column. UNIT-IV Introduction to Javascript, JavaScript and Forms Variables, Functions, Operators, Conditional Statements and Loops, Arrays, DOM Methods, Strings, Java Script Closures, JSON. Events Handling (Mouse Events, Keyboard Events). UNIT-V Introduction to TypeScript-Overview of Typescript, Interface, classes, Functions, Generics, Enums, Adv Types, Modules, JSX overview. BCA- I SEMESTER JANUARY 2022 WEB TECHNOLOGY Time:3 Hrs Max.Marks: PART A (20 Marks) 1a) What is meant by Hyperlink? b) Define HTML5. c) What is Id Selectors and Class Selectors? d) What is RWD? e) What is meant by Padding? f) What are Media Query Breakpoints? g) What is DOM Methods? h) Define ISON Events. i)Define Enumeration. j) What is AdvTypes? PART-B (5 x 10 = 50 Marks) Unit- 1 2a) Explain about List tags with example. b) Write about Document object model in detail. Or 3a) Write about HTML5. b) Explain about Inputs, Images, Tables in HTML 5.

b) What is the Document object model? Or

  1. a) How to create a table in HTML. Explain with relevant example. b) explain How to insert Images in a web page with program. Unit-II 4 a What is CSS? Discuss types b) Explain back ground Or
  2. a) Explain about the design Model in CSS. b) Explain Font Properties in CSS3. Unit-III 6 a) Discuss about components of RWD. b) Explain about WD media quires. Or
  3. a) How to create responsive websites? Explain b) Explain briefly about media types. Unit-IV
  4. a) What are the key features of Java Script and Dom methods b)Explain different operators in Java script and J Son. Or
  5. a) Explain Control statements in Java Script. b) What is meant by array? Explain the possible ways to declare strings in java Unit-V
  6. a) Write Short notes typescript functions. b) Explain about typescript generics. Or 11.a) Explain about typescript classes. b) State the advantages and disadvantages of classes.

UNIT-I

UNIT-I Introduction to World Wide Web, Web Browsers, Web Servers, BOM, DOM, HTTP. HTML5: Introduction, HTML5 Tags, Links, Input, Images, Lists, Tables, Creating Forms, Styling Forms, Placeholder, Inline and Block elements, Id vs Class elements. Introduction of HTML

  • HTML stands for Hyper Text Markup Language. It helps to create Web pages.
  • It organizes text, images, links, and media using tags and elements that browsers can interpret.
  • It is a markup language, not a programming language. HTML is like giving labels to parts of a webpage so that the browser knows how to show them
  • It is a static language, meaning it does not inherently provide interactive features but can be combined with CSS for styling and JavaScript for interactivity.
  • HYPERTEXT MARKUP LANGUAGE was developed by TIMBERNERS-LEE an English scientist when he worked at CERN, the European center for particle Physics.
  • The current version of Html is Html 5. **************************************************************************8******************** Features for Html: 1.HTML is Not Case Sensitive
  • HTML is not case sensitive. Example: and are treated the same.
  1. Error-Free Language
  • HTML is mostly error-tolerant. Even if small mistakes are present, browsers can still try to display the page correctly.
  1. Simple and Easy to Learn
  • HTML is a simple language.
  • Easy to write, understand, and does not require programming knowledge.
  1. Supports Multimedia
  • HTML allows you to add audio, video, and images to your webpages.
  • for images
  • for sound
  • for video
  1. Platform Independent
  • HTML works on any operating system (Windows, Linux, Mac, etc.).
  • Web pages written in HTML can run on any browser or device.
  1. Uses Angular Brackets
  • HTML elements are written inside angular brackets (< >). Example:

    This is a paragraph

  1. Executed by Browser
  • HTML code is read and interpreted by the web browser , not compiled like other languages.
  1. File Extension
  • HTML files are saved with .html or .htm extension. Example: mypage.html or home.htm

HEAD of the HTML document holds information about the document and The BODY contains the content that displays on the screen. The basic structure of html document is as follows:

------ HEAD Section

----------------------- BODY Section

Tag: Declares the document type. It is optional Tag: This tag starts the html document and contains the other tags. It has an opening and a closing tag i.e. it is a paired tag. Tag: This tag contains the HEAD section of the HTML document, which holds information about the page, such as its title. This head section of the document contains the other elements like , <BASE>, <BASEFONT> ,<LINK>, <META> ,<SCRIPT> <BODY> Tag: This tag contains the body of the HTML document. It includes the contents that will actually appear in the web browser. EX: <!DOCTYPE html> <html> <head> <title>My First Web Page

Welcome to My Website

This is a simple HTML page structure.

Execute an HTML Program

  1. Write the HTML code in Notepad or any text editor.
  2. Save the file with .html extension (example: mypage.html).
  3. Go to the folder where you saved the file.
  4. Double-click the file to open it in a web browser.
  5. To see changes, edit the file , save it, and refresh the browser.

OUTPUT:

Comments in HTML:

  • Comments are non-executable statements. It means comments are not executed by web browser.

  • Comments can be included anywhere in the program.

  • Generally in comments we can write program details or author details or any other details. These details help the programmer to refer at later stage. Syntax:

    Each comment can contain many lines of text. If the comment runs over a number of lines, each must start and end with - - and must not contain within its body. Ex:

    Comments can be placed in either the head or body of HTML document. Ex:

web page number one! WELCOME TO HTML! ************************************************************************************

Physical Formatting Tags/Formattig Tags /Text Formattig with example:

These tags are used to tell the browser how we want the text to appear. The most important physical tags are as follows:

Text Formatting in HTML

Welcome to web page

Welcome to web page

Welcome to web page

Junior Degree College

Computer Lab

Computer Lab

(a + b)2 = a2 + b2 + 2ab

Molecular formula for water is H2O

Adding Colors in HTML :

  1. Colors enhance the appearance of a web page and make it more attractive and user-friendly.
  2. Color can be used in many places like: o Page background o Text o Headings o Link
  3. There are 3 main ways to define colors in HTML:

a. Using Predefined Color Names Simple names like: red, green, blue, orange, etc. Example:

This is red text

**b. Using RGB Values** o Format: rgb(red, green, blue) o Values range from **0 to 255** Examples: ▪ rgb(255, 0, 0) = red ▪ rgb(0, 0, 255) = blue ▪ rgb(0, 255, 0) = green **c. Using Hexadecimal Color Codes** o Format: #RRGGBB Examples: ▪ #FF0000 = red ▪ #00FF00 = green ▪ #0000FF = blue Example:

My First Web Page

Welcome to My Website

This is a simple HTML page structure.

Olive text

Lime text

The Attributes of tag are Type: It specifies the type of list item for ordered list. The values of this attribute are as follows: Type Description type="1" The list items will be numbered with numbers (default) type="A" The list items will be numbered with uppercase letters (A, B, C,...) type="a" The list items will be numbered with lowercase letters(a,b,c ) type="I" The list items will be numbered with uppercase roman numbers(I,II,III,IV. ) type="i" The list items will be numbered with lowercase roman numbers(i,ii,iii,iv. ) 2.Unordered List:

  • If the elements or items in a list do not require any order then we can use unordered list.
  • The items are marked with bullets. The beginning and ending tags for unordered list are and respectively.
  • The list item is represented by and there is no ending tag for . The Attributes of tag ATTRIBUTES:- Type: It specifies the type of list item for unordered lists. The values of this attribute are as follows: Value Description disc The list item is marked with a filled circle bullet (default) circle The list item is marked with a circle square The list item is marked with a filled square none The list items will not be marked The following program demonstrates unordered list.

An unordered HTML list

Coffee Tea Milk

3.Definition List:

  • HTML also supports description lists.
  • A description list is a list of terms, with a description of each term.
  • The tag defines the description list, the tag defines the term (name), and the tag describes each term. Example:

A Description List

Coffee - black hot drink Milk - white cold drink

-------------------------------------------------

Nested Lists:

A list within another list is termed as nested list. If we want a bullet list inside a numbered list or a bullet list inside another bullet list or a numbered list inside a bullet list etc.. , such type of list is called as nested list. Example :

Nested List Example

  1. Creating a link: The tag is used to enclose the text or element that will serve as the clickable link, and the href attribute is set to the URL of the page or resource you want to link to.
  2. Activating the link: When a user clicks on the link text (or image), the browser interprets the href attribute and navigates the user to the specified URL. Example1: hyperlink to website
Text Link Example <p>Click the link to visit Wikipedia </p>

Output:

In this example:

The tag defines the hyperlink.

The href attribute specifies the URL to link to. The text "Wikipedia" becomes the clickable link.

Graphical hyperlinks (Or) Images as Hyper Links: These are graphical hyperlinks which uses an image instead of text. This type of hyper links consists of a single image, and when the user clicks on link it can open another HTML document in the same directory or links to another web site. Images as hyperlinks are created by placing an image between an opening tag and closing tag. The following program demonstrates images as hyperlinks. Save the following file as sample.html

My First Web Page

Welcome to My Website

This is a simple HTML page structure.

Save the following file as imagelink.html

image as hyperlink

For more details click on the following image:

Output: If we click on the image the following screen will be displayed.

Images and it’s formats: Images can be added to a web page by using tag. If images are

included in a web page, it will be more attractive but the problem with including many images in a web page is, loading images is a slow process.

Rose Image

OUTPUT Align Attribute : Align attribute of tag has following values: Left: positions the image to the current left margin; any text that follows flows around the images right margin. Middle: aligns the vertical midline of the image with the baseline of the text. Set as center even in Internet explorer. Right: position the image to the current right margin, any text that allows flowing around the images left margin. Top: It aligns the text top of the image. Bottom: aligns the text bottom of the image. This is the default.

** TAG in HTML:** tag is used to control the presentation of the text, like size, color of the text, font face etc.. ATTRIBUTES: Color: this attribute is used to change the color of any portion of the text. Ex: or

Face: This attribute is used to specify the font face. Ex:

size: This attribute is used to change the size of the text enclosed between the opening and ending tags. The size of the text values range from 1 to 7, where 1 is the smallest and 7 is the largest. Each browser renders an html document using a default size 3. Ex-1: Example:

Font Example

This is a sample text with font example.

Output:

Tables in HTML:

1.Tables in HTML pages are used to organize the information in a row or column format. 2.In HTML tables are divided into rows and each row is divided into data cells. The horizontal and vertical lines of a table are called as Dividers. An HTML table is created using the tag. Inside the table, we use: : Table Row : Table Header : Table Data

  1. represents a row, and within each row, and tags represent the cells in that row, which can contain text, images, lists, or even another table
  2. tag is used to define table header. The text in is bold and centered by default.