Académique Documents
Professionnel Documents
Culture Documents
--> Programmers will use web technologies "to develop Frontend of an application".
whereas Java is used "to develop Backend of an application".
--> These two languages are having "Different representation", where Java has an "instruction"
representation and Web Technologies has an "Tags representation".
--> All Instructions are represented with "{}" and All Tags are represented with "<>".
--> All the Codings must be started with "Template". For HTML Coding, we have to follow
the below Template:
<!doctype html>
<html lang="en">
<head>
<title>Document</title>
</head>
<body>
</body>
</html>
NOTE: <br> tag is nothing but "break tag", which is used to break current line and give
the contents in next line.
--> "Placeholder" attribute is used to create "water mark" on text box. And it can also be
used as an alternative for Labels.
NOTE: By default, Radio buttons can be selected Multiple. Explicitly, Programmers makes it
to act like single option selector by using "name" attribute.
--> For "name" attribute, we pass an "identifier", which must be maintained same throughout
all radio buttons.
--> As a programmer, we use checkboxes, if we have to give user "To Select Multiple option".
--> DropDown List is preferred over Radio Buttons because If their are multiple options
to be provided, then radio buttons would occupy more space compared to DropDown List.
--> DropDown List can be created by using "<select> tag and <option> tag".
--> Textarea is preferred, if user is providing more contents like address, comments, feedback etc.
Textarea can also be resized by using "rows" attribute and "cols" attribute.
NOTE: Inputs can be made as "Mandatory" by using "required" attribute and "<form>" tag.
* symbol on labels are just an indication that current input is mandatory for users.
--> "title" attribute is used within <input> tag, which can be used to provide information
about the pattern which has to be followed.
syntax:
pattern="[what type of contents user shd provide]{what shd be length of content}"
Example-1: PhoneNumber:__________________
condition-1: only digits
condition-2: must be exactly 10-digits
Example-3: CVV:_____
condition-1: only digits
condition-2: must hav exactly 3-digits
pattern="[0-9]{3}"
Special Note:
1. Pattern for validating PAN Card Number:
pattern="[A-Z]{5}[0-9]{4}[A-Z]{1}"
--------------------------------------------------------------------------------------
HTML Tables:
--> Programmers makes use HTML Tables Concept "To Organize/align the output on the Browser".
--> To start working with HTML Tables, programmers must decide number of rows and number of
columns required.
--> In this, we make use of 3-important tags:
i. <table> tag
ii. <tr> tag
iii. <td> tag
--> <tr> tag represents row, whereas <td> tag represents column.
---------------------------------------------------------------------------
Hyperlinks:
--> Connecting two HTML Files in an app is called as Hyperlinks.
--> Hyperlinks are represented in the program by using "Anchor Tag", which is indicated as
"<a>" tag.
--> <a> tag takes two attributes:
i. "href" attribute - which is used to provide HTML FileName to be linked.
ii. "target" attribute - which is used to open Hyperlink in new tab of browser.
syntax:
<a href="HTMLFileNameToBeConnected" target="blank"></a>
--------------------------------------------------------------------------------
Text-Formatting Tags:
--> As a programmer, we use text-formatting tags for "Changing the appearance of the text
in an application".
Tags Functionality/Behaviour
i. <h1>,<h2>,<h3> --> Used to increase font size of the text.where
<h4>,<h5>,>h6> <h1> is having highest font size and <h6>
is lowest font size.
-----------------------------------------------------------------------------------------
<div> tag:
--> Programmers use <div> tag "to create separate sections for particular purpose".
In order to start working with <div> tag, Programmers must provide respective
width and height as dimensions.
--> Height and width must be mentioned together by using "style" attribute. and also it
must be given with "pixels[px]".
--> "float" property is used for aligning the sections. It can be given with "right" and
"left" as values.
NOTE: Usage of "style" attribute represents working of CSS. CSS basically used to enhance the
output on browser.
------------------------------------------------------------------------------------
HTML Lists
--> Programmers will make use HTML Lists "To Arrange the content along with different types
of serial numbers representation".
--> Ordered List is displayed in the form of "Numbers, Alphabets or Roman Numbers". whereas
Unordered List is displayed in the form of "Bullets".
--> To change the type of serial number representation, we make use of "type" attribute
within <ol> tag and <ul> tag.
------------------------------------------------------------------------------
Multimedia Tags:
--> We have 3 important multimedia tags which are given below:
i. <img> tag
ii. <audio> tag
iii. <video> tag
--> <img> tag is used to place image files in an application, which can be resizable according
to programmers need.
--> It takes 4-attributes and they are "src", "height", "width" and "alt" attribute.
"src" attribute is used to provide Path of Image File. "height" and "width" attribute
is used to resize the image.
--> "alt" attribute is used to provide text which will be displayed, if their is an issue
in loading the image.
--> <audio> tag is used to place audio files and <video> tag is used to place video files
in an application.
NOTE: <meta> tag is used to provide some extra information about File like
i. editor used for coding.
ii. programmer name who has done coding.
iii. technologies used in coding.
iv. description about the coding in the given file.
----------------------------------------------------------------------------------
CSS(Cascading Styling Sheet):
--> CSS is used by programmers in order to Enhance/Improve the output of HTML Coding
on the Browser.
--> In Inline CSS Coding, we make use of "style attribute" within HTML Tag.
--> In Internal CSS coding, we make use of "<style> tag" within <head> tag.
--> In External CSS coding, we make use of "Separate CSS File" to write css program and
link to HTML File using <link> tag.
syntax:
<link rel="stylesheet" href="CSS_FileName">
NOTE: If all types of CSS Coding is applied, then priority is given as below
--> "opacity" css property is used to reduce brightness of the given color. The values
which can be given is between 0.0 to 1.0.
------------------------------------------------------------------------------
Types of Selectors:
--> There are 3-types of selctors:
i. Element Selector
ii. Id Selector
iii. Class Selector
--> If CSS has to be applied for all occurance of respective tag, then it is referred as
"Element Selector".
--> If CSS has to be applied for one occurance of respective tag, then it is referred as
"Id Selector".
--> Id selector can be worked by using "id" attribute with "#" symbol, which indicates that
the specified identifier is an "id".
--> If CSS has to be applied for More than one occurance but not all occurance of respective tag
then it is referred as "Class Selector".
--> Class selector can be worked by using "class" attribute with "." symbol, which indicates that
the specified identifier is an "class".
-------------------------------------------------------------------------
Few Commonly used CSS Properties:
1. "background-color" property is used to apply backgroundcolor for respective HTML element.
2. "background-image" property is used to provide background image for the <body> tag.
The syntax to be followed is:
background-image:url('Image File Name with extension');
NOTE: The above syntax works only if "Coding files" and "Image File" are in same folder.
4. "padding" property is used to provide space around the content. It can also be applied
for particular side by using any one of the below css properties:
i. padding-top - for Top side.
ii. padding-right - for Right side.
iii. padding-bottom - for Bottom side.
iv. padding-left - for Left side.
NOTE: We can also apply padding for four sides by using short cut as given below:
syntax:
padding:top right bottom left;
Ex:
padding:20px 30px 40px 50px; Here 20px is for Top side
30px is for Right side
40px is for bottom side
50px is for left side
10. "letter-spacing" property is used to provide space between letters of the word.
11. "word-spacing" property is used to provide space between words of the sentence.
12. Combinators is the concept which is used to apply CSS for particular inner tags.
In other words, Combinators is nothing but Group of selectors.
13. "font-size" property is used in CSS to increase the size of font displayed.
14. "float" property is used to align the contents towards left and right.
15. "margin" property is used to provide space from the extreme borders. It can also be
applied for specific side by using below properties:
i. margin-top
ii. margin-right
iii. margin-bottom
iv. margin-left
16. "background-size" property is used to resize background image given for <body> tag.
17. "pseudo classes" are special classes which applies unique styling for HTML Tags.
syntax:
tagname:pseudoclassname { property:value;........... }
18. "hover" is an pseudo class which applies CSS Properties only if cursor is placed
on the contents.
Example:
a:hover { CSSPropertiesCode }
19. "border" property is used to separate the contents by drawing one solid line between
them. border property must be given with 3-important info:
i. border-width
ii. border-type
iii. border-color
NOTE: While working with "border" property, it is mandatory to provide border-width and border-type.
whereas border-color is optional.
20. "border-collapse" property is used to remove extra borders and provie common border
among the contents.
---------------------------------------------------------------------------------------------
JavaScript:
--> Programmers prefer Javascript for two important reasons:
i. It provides flexibility in validation of User data.
ii. It offers page-responsive behaviour.
--> Internal Javascript coding is performed by writing <script> tag within <head> tag.
whereas External Javascript coding is performed in separate JS file and linked into
HTML File by using below syntax:
<script src="External Javascript FileName"></script>
-------------------------------------------------------------------------------------
Variable Declaration and Function Declaration in JS:
--> Variables are declared by using "var" keyword. Irrespective of data to be stored,
we use only "var" keyword in javascript.
syntax:
var varName = value;
where varName is an identifier.
--> Functions are declared by using "function" keyword inorder to perform some opration.
Every function will be called for its execution.
syntax:
function funcName(args/no args)
{
//code
}
where funcName is an identifier.
NOTE: In Javascript coding, we can include HTML Tags within double quotes("")
---------------------------------------------------------------------------------------
Operators and Statements in JavaScript:
--> All the operators like Arthimetic operators, Relational operators, logical operators
is same as JAVA Language.
--> All Statements like Conditional Statements, Looping Statements are same as JAVA Language.
NOTE: Generally Local variables in javascript will not be given with "var" keyword.
----------------------------------------------------------------------------------------
Functions With Arguments:
--> We prefer functions with arguments to pass desired values according to users need.
--> When we call function with arguments, then it is programmers responsibility to pass
values for arguments.
--> The number of values we pass must be equal to number of arguments in the function.
----------------------------------------------------------------------------------
Event Handlers:
--> Calling Javascript function from HTML file based on the events like reloading the page,
pressing any key on keyboard, clicking buttons etc. is called as Event Handlers.
--> All Event Handlers will be startinf with "on", followed by respective event.
--> The syntax used to subsitute JS Output into HTML file is:
document.getElementById("identifier").innerHTML = JSOutputToBeGiven.
where innerHTML refers to substituting JSOutput in HTMLFile.
NOTE: "value" property is used to read data from HTML File to JS File, whereas "innerHTML"
property is used to give data from JS File to HTML File.
[value]
HTML------------------->Javascript
<------------------
[innerHTML]
--> "onkeyup" Event handler executes JS Function, once user releases the key which was
pressed. "onkeypress" Event handler executes JS Function, once user presses any key.
--> "length" property is used to find length of the contents stored in an variable.
--> "style" property is used in JS to indicate that CSS is being used in the program.
NOTE: we cannot repeat same event handler within one tag. Two functions cannot be called
by using one event handler.
--> "backgroundColor" property is used to apply background colors for an specified HTML
tag. It works only after "style" property is used.
--> "onblur" event handler is used to execute function if user leaves the current input
and moves to next input.
--> "borderColor" property is used to apply colors to borders of the input. It works with
onblur event handler.
--> "borderRadius" property is used to change rectangular shaped borders into curved
shaped borders.
--> "boxShadow" property is used to provide reflection of the text box. It takes 4-imp
values:
i. horizontal distance. ii. vertical distance. iii. blur. iv. color
NOTE: If horizontal distance and vertical distance is given as 0px, then actual text box
and reflection of text box is at same position.
NOTE: "focus" is an pseudo class in CSS, which is used to execute CSS Properties only if
user selects an specified Tag/Id/Class.
-----------------------------------------------------------------------------
Popup Boxes:
--> We have 3-types of popup boxes:
1. alert popup box
2. confirm popup box
3. prompt popup box
--> All the above popup boxes are represented in the form of functions.
--> alert() function allows user to select OK option. confirm() function allows user to
select either OK or CANCEL option.
--> prompt() function allows user to provide "Value" first and then followed by selecting
OK or CANCEL option.
-----------------------------------------------------------------------------------
JavaScript Objects:
--> Object is an entity which consists of multiple information, which can be referred as
variables.
--> All the info given by user will be combined as an object and passed onto the server
for further processing.
--> To combine info into object, we make use of "{}", object literals. To read values from
object, we use "ObjectName.infoName".
Example: A Car Object is having color, brand and price as information.
var car = {color:"white",
brand:"skoda",
price:12.00
}
----------------------------------------------------------------------------------------
Pseudo classes[continue..]
--> The 4-important pseudo classes which works with cursor movements are:
i. :link - used to indicate an hyperlink as "not visited".
ii. :visited - used to indicate an hyperlink as "visited".
iii. :hover - used to apply css if user place the cursor on hyperlink.
iv. :active - used to apply css if user clicks the hyperlink.
--> we dont have :blur pseudo class. In order to implement blur functionality in CSS, then
we have to make use of ":not(:focus)".
--------------------------------------------------------------------------