Introduction To HTML+CSS+Javascript
Introduction To HTML+CSS+Javascript
on
Industrial Training
Programming Foundations with HTML + CSS
+ Javascript
Submitted to:- Submitted By:-
Mr. Papendra Kumar Abhishek Kumar
Assistant Professor 180201
Computer Science and Engineering CSE- 4th year
Goals
Introduction to web technologies:
● HTML
● CSS
● Javascript
HTML
HTML means Hyper Text Markup Language. <html>
<head>
The HTML allow us to construct the visible part of a website. </head>
<body>
<div>
HTML is NOT a programming language, it’s a markup language, <p>Hi</p>
which means its purpose is to give structure to the content of the </div>
website. </body>
</html>
It is a series of nested tags (it is a subset of XML) that contain all
the website information (like texts, images and videos). Here is an
example of tags:
<title>This is a title</title>
The HTML defines the page structure. A website can have several
HTMLs to different pages.
HTML: basic rules
Some rules about HTML:
● It uses XML syntax (tags with attributes, can contain other tags).
<tag_name> content </tag_name>
● It stores all the information that must be shown to the user.
● There are different HTML elements for different types of information and behaviour.
● The information is stored in a tree-like structure (nodes that contain nodes inside) called
DOM (Document Object Model).
● It gives the document some semantic structure (pe. this is a title, this is a section, this is
a form) which is helpful for computers to understand websites content.
● It must not contain information related to how it should be displayed (that information
belongs to the CSS), so no color information, font size, position, etc.
HTML: syntax example
Tag name
attributes
</div>
HTML: main tags
Although there are lots of tags in the HTML specification, 99% of the webs use a subset of
HTML tags with less that 10 tags, the most important are:
The more structure has the information, the easier will be to access it and present it.
We can change the way the information is represented on the screen depending on the tags
where it is contained, so we shouldn't be worried about using too many tags.
Technologies
● HTML
● CSS
● Javascript
CSS
Allows to specify how to present (render) the document info stored in the HTML.
Allows to controls all the aspects of the visualization and some other features:
This will change all the tags in my web ( ‘*‘ means all) to look blue with font Tahoma with
14px, and leaving a margin of 10px around.
CSS fields
Here is a list of the most common CSS fields and an example:
● color: #FF0000; red; rgba(255,00,100,1.0); //different ways to specify colors
● background-color: red;
● background-image: url('file.png');
● font: 18px 'Tahoma';
● border: 2px solid black;
● border-top: 2px solid red;
● border-radius: 2px; //to remove corners and make them more round
● margin: 10px; //distance from the border to the outer elements
● padding: 2px; //distance from the border to the inner elements
● width: 100%; 300px; 1.3em; //many different ways to specify distances
● height: 200px;
● text-align: center;
● box-shadow: 3px 3px 5px black;
● cursor: pointer;
● display: inline-block;
● overflow: hidden;
CSS how to add it
We can specify more precise selectors besides the name of the tag. For instance, by class
or id:
p.intro {
color: red;
}
This will affect to the p tags of class intro that are inside the tag div of id main
<div id="main">
<p class="intro">....</p> ← Affects this one
</div>
● HTML
● CSS
● Javascript
Javascript
A regular programming language, easy to start, hard to master.
You can change the content of the HTML or the CSS applied to an element.
You can even send or retrieve information from the internet to update the content
of the web without reloading the page.
Javascript: Syntax
Very similar to C++ or Java but much simpler.
http://www.w3schools.com/
Selectors: https://developer.mozilla.org/en-US/docs/CSS/Getting_Started/Selectors
To learn Javascript.
http://codeacademy.com
To learn jQuery:
http://docs.jquery.com/Tutorials
The End