Professional Documents
Culture Documents
Vishwa Technologies
Implant Training Report Submitted in partial fulfilment
For the award of the
Diploma in Engineering
Submitted by
ENROLLMENT NO. NAME OF STUDENT EXAM SEAT NO
2012140047 Onkar B Kolekar
Mode of Implant
Training Virtual
Training
DECLARATION
ACKNOWLEDGEMENT
We like to share our sincere gratitude to all those who help us in completion
of this Implant Training. During the work we faced many challenges due to our lack
of knowledge and experience but these people help us to get over from all the
difficulties and in final compilation of our idea to a shaped sculpture.
We would like to thank Mr. Kishor Shinde sir as well as Mr. Vishal Pawar sir
for his governance and guidance, because of which our whole team was able to
learn the minute aspects of a Computer Engineering.
We would also like to show our gratitude to our department faculties Mr.
Kishor Shinde of our Computer Engineering department for their continuous help and
monitoring during the work. I am thankful to supporting staff of our department as
well as Vishwa Technologies, for their help and support towards my training.
We are also thankful to our whole class and most of all to our parents who
have inspired us to face all the challenges and win all the hurdles in life.
ENROLLMENTNO. 2012140047
NAME OF STUDENT Onkar B Kolekar
ABSTRACT
In this training we have learn lot of about computer engineering, like scope of
computer engineering and Web Development
TABLE OF CONTENTS
Concept
Introduction
HTML
CSS
JAVASCRIPT
CHAPTER 8 Conclusion
What is HTML
Stands for "Hypertext Markup Language." HTML is the language used to create webpages.
"Hypertext" refers to the hyperlinks that an HTML page may contain. "Markup language" refers
to the way tags are used to define the page layout and elements within the page.
Below is an example of HTML used to define a basic webpage with a title and a single paragraph
of text.
<!doctype html>
<html>
<head>
<title>TechTerms.com</title>
</head>
<body>
<p>This is an example of a paragraph in HTML.</p>
</body>
</html>
The first line defines what type of contents the document contains. "<!doctype html>"
means the page is written in HTML5. Properly formatted HTML pages should include <html>,
<head>, and <body> tags, which are all included in the example above. The page title,
metadata, and links to referenced files are placed between the <head> tags. The actual contents
of the page go between the <body> tags.
The web has gone through many changes over the past few decades, but HTML has always been
the fundamental language used to develop webpages. Interestingly, while websites have become
more advanced and interactive, HTML has actually gotten simpler. If you compare the source of
an HTML5 page with a similar page written in HTML 4.01 or XHTML 1.0, the HTML5 page
would probably contain less code. This is because modern HTML relies on cascading style sheets
or JavaScript to format nearly all the elements within a page. NOTE: Many dynamic websites
generate webpages on-the-fly, using a serverside scripting language like PHP or ASP. However,
even dynamic pages must be formatted using HTML. Therefore, scripting languages often
generate the HTML that is sent to your web browser.
History of HTML
This chapter discusses a brief history of HTML language. Reading this will help you to
get an idea of how HTML has been evolved through the years.
Tim Berners-Lee, the inventor of HTML, used to work in the computer section of the
CERN (European Laboratory for Particle Physics) at Geneva, Switzerland.
CERN is an institution for researching particle physics which requires the collaboration
of physicists all over the world.
Tim has an idea of creating something which would enable physicists to share research
information from anywhere in the world, and he came with HTML which can contain
links of many documents from one document.
Tim's prototype Web browser on the NeXT computer came out in 1990.
• In 1991, an open discussion group HTML-talk was started across the internet for the development
of HTML.
• In 1992, Dave Raggett from Hewlett-Packard's Labs in Bristol, England who was one of the
enthusiastic of HTML, met Tim and upon returning England, Dave wrote a richer version of HTML
called HTML+.
• In 1992, NCSA showed interest in web and contributed to take the development of web a step
further.
• In December 1992, Marc Andreessen of Mosaic team (an early web browser) introduced img tag
in the HTML document.
• March 1993: Lou Montello releases the Lynx browser version 2.0a.
• May 1994: NCSA assigns commercial rights for Mosaic browser to Spyglass Inc.
• September 1994: The Internet Engineering Task Force (IETF) sets up an HTML working group.
• November 1995: Vendors unite to form a new group dedicated to developing an HTML standard.
• November 1995: Style sheets for HTML documents begin to take shape.
• July 1996: Microsoft seems more interested than first imagined in open standards.
• In spring 1998, HTML 4.01 was materialized finally and become a w3c recommendation.
The current version of HTML is HTML 4.01 which we have discussed in our HTML
tutorials.
Development of HTML 5 is underway but developers have already started using some
of it's features.
CSS, stands for Cascading Style Sheet is a computer language to describe presentation
(for example width, height, color, background color, alignment etc.) of
HTML and XML (and XML based languages like XHTML, SVG) web documents. In all
the examples of our tutorials, we have used HTML for implementing CSS.
From its invention, CSS has evolved through different versions. The present version of
CSS is CSS 2.1.
Next version of CSS is CSS3, which is under development but developers have already
started using some of its features.
In the consequent pages, we will discuss CSS 2.1 in detail. Learning which, you will be
able to implement CSS in your own web pages.
1. Writing CSS code in a separate file (CSS files are saved with .css extension) and
including that CSS file in head section of an HTML page using <link> element.
Advantages of CSS
2. Consistency: CSS can provide a consistent presentation for all of the pages of a
web site.
4. Save of bandwidth: Since CSS separates content form style, it makes a web
document lightweight, causing saving of bandwidth and in turn faster loading of the
page.
It was first released under the name of Live Script as part of Netscape Navigator 2.0 in
September 1995. It was renamed JavaScript on December 4, 1995. As JavaScript
works on the client side, It is mostly used for client-side web development.
JavaScript is designed for use on web pages and closely integrated with HTML.
JavaScript can create applications which run in the browsers such as IE, Opera,
FireFox, Google Chrome and other. Netscape submitted JavaScript to ECMA
International for standardization resulting in the standardized version named
ECMAScript.
JavaScript and Java are similar in some ways but fundamentally they are different. Java
is a programming language developed by Sun Microsystems, Inc. and JavaScript is a
scripting language developed by Netscape. Java is a server-side and static type
language. JavaScript is a client-side, dynamically typed language. Java programs are
compiled on the server and run on almost every platform without distribution of source
code whereas scripts written in JavaScript are placed inside a HTML document and
interpreted by the browser. The syntax, reserved-words of JavaScript and Java are also
different.
JavaScript Java
JavaScript is used for front-end web Java is used as a back-end language within
development (for example field level a web environment.
validation in a HTML form).
Interpreted (not compiled) by the client. Compiled bytecodes downloaded from the
Variable data types are not declared Variable data types must be declared as
(loose typing). Java maintains strong type checking.
Cannot automatically write to hard disk. Cannot automatically write to hard disk.
WHAT IS BOOTSTRAP?
Twitter Bootstrap is a front-end framework to develop web apps and sites fast. In modern
web development, there are several components which are required in almost all web
projects. Bootstrap provides you with all those basic modules - Grid, Typography, Tables,
Forms, Buttons, and Responsiveness. Besides, there are a plethora of other useful frontend
components like Dropdowns, Navigation, Modals, Typehead, Pagination, Carousal,
Breadcrumb, Tab, Thumbnails, Headers etc. With these, you can make a web project up
and running quickly and easily.
Moreover, since the entire framework is module based, you can customize it with your own
bit of CSS or even go for a complete overhaul after getting started.
It is based on the several best practices and we believe it is a very good point to start
learning modern day web development with HTML, and JavaScript/jQuery once you know
the basics.
Though there are criticisms, that all Bootstrap made projects looks same and you can make
a website up without much of HTML+CSS knowledge, we need to understand that
Bootstrap is a generic framework and like any other generic stuff, you need to customize it
to look it exclusively. And you need to developed when you are on your way to customizing
it and that is not feasible without a well understanding of HTML+CSS.
There are of course very good front-end frameworks available beside bootstrap and it's
completely a developer's choice who wants which. But it is definitely worth trying.
Moreover, our code which has given to be downloaded contains a bootstrap code folder
downloaded from the first link. This also contains the custom.css file we have used to
customize Bootstrap's original CSS.
Once unzipped, you would find that there are several files and folders are available within
the root folder bootstrap-3.0.0.
The main CSS files - bootstrap.css and minified version of it bootstrap-min.css are available
within 'CSS' folder which is placed within 'dist.' folder under bootstrap-3.0.0.
Within 'dist.' there is a 'is' folder, which contains the main JavaScript file bootstrap.js and a
minified version of it.
There is a separate 'js' folder within the root, which contains different JavaScript plugins in
separate files.
Another 'js' folder is found within 'assets' folder within the root. This holds html5shiv.js which
is HTML5 shim, used for IE8 support. There is also respond.min.js file, used for supporting
media queries in IE8. This folder also contains jquery.js on which Bootstrap's js plugins
depends.
There is an 'icon' folder within the same containing icons for favicon and icons for various
mobile devices.
'css' folder in the same path contains css files for documentation.
'_includes' and '_layouts' folder contains some default layout structure files which may be
useful for rapid prototyping.
'less' folder within root contains several .less files. If you are going for less based
development, these files are useful for you.
Within the root folder. there are lies several files. Some of them are HTML files which can
be used for basic prototyping. Besides, there is bower.json, browserstack.json used for
Bower based compilation. There is also composer.json and a YAML file _config.yml.
Besides downloading from the link given, you may also compile all CSS, js files with the
following command -
$ bower install bootstrap
You may clone the Bootstrap's Git repo git clone
git://github.com/twbs/bootstrap.git
For this tutorial, we have simple downloaded the Zip file and will be working out of that.
Once you finish this tutorial, we encourage you to install with bower and let us know how it
works.
NetDNA hosts compiled and minified version of Bootstrap CSS, Js, and optional theme css.
You may include them like following
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet"
href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<!-- Optional theme --> <link
rel="stylesheet"
href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/
bootstraptheme.min.css">
Basic HTML
Following is the basic HTML structure we will be using for our project
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap V3 template</title>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries ->
<!--[if lt IE 9]>
<script src="bootstrap-3.0.0/assets/js/html5shiv.js"></script>
<script src="bootstrap-3.0.0/assets/js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<h1>Hello, world!</h1>
<script src="//code.jquery.com/jquery.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed
-->
<script src="bootstrap-3.0.0/dist/js/bootstrap.min.js"></script>
</body>
</html>
Note that
html5shiv.js and respond.min.js are added in this template for IE8 support. Adding
these files are to Bootstrap version 3.
We have placed the bootstrap-3.0.0 folder within twitter-bootstrap folder which is placed
within our web server's root. All html files we will be creating will be placed within twitter
bootstrap folder. The purpose of stating this is nothing but to ease your deployment
process.
Customization
We are going to customize the out of the box styles of the Bootstrap's CSS. So, without
disturbing the original CSS file, which is within dist folder of the bootstrap-3.0.0, we are
going to create a separate CSS file called custom.css in the same folder. We will then
include that CSS file within our HTML files just bellows the original CSS file. This way, we
will be able to override the default styles when you want, but, if Bootstrap upgrades itself,
the original CSS file can also upgrade without disturbing our own customization. We
suggest you to follow this method in your development process also.
Creating navigation
For creating navigation will add the following code in our HTML file, just after the opening
body tag.
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
src="logo.png"></a></li>
<li><a href="price.html">Price</a></li>
<li><a href="contact.html">Contact</a></li>
<li class="dropdown">
<ul class="dropdown-menu">
<script>!function(d,s,id){var
js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);j
s.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs
);}}(document,"script","twitter-wjs");</script></li>
</ul>
</li>
</ul>
</nav>
For navigation, Bootstrap uses 'navbar' class in the container level. So, it is assigned to the
nav element which holds the entire navigation.
We have used 'navbar-inverse' class along with to change the default color of the navigation
bar dark instead of the default lighter one. 'Navbar-fixed-top' class makes sure that the
navbar stays fixed in the top position when we scroll down our HTML page.
At this point, we have added 'padding-top: 80px;' to the body in the custom.css file. Number
pf pixels you add as top padding to the body may vary, but unless you do so, the top part of
our content after navbar will be hidden.
Within the container nav, we have an unordered list with class 'nav' and 'navbar-nav'. Within
this unordered list. each list item holds a link in the navigation.
'navbar-brand' class is used to present the brand name. We have used an image for that.
Since our image's height is more than the line height of the navbar, we made some
customization here. We have increased the 'line-height' property of the '.navbar-nav>li>a' to
50px instead of default 20px. We have also made the font size 16px.
For the right most link, we have added dropdown. For that 'dropdown' class is added to the
associated li, just after that, an anchor is added having two classes 'dropdown-toggle' and
'caret'. This anchor actually holds the anchor text social in our project. This li then holds an
unordered list within this and again each list item of that nested list holds a link presented in
the dropdown.
We have added social plugins in the dropdown. The first li holds a markup for Google Plus,
the second li holds a markup for Facebook and third li holds markup and some js script for
displaying Twitter button.
Additionally, you have to add the following markup and script just after the opening body
tag, to make the Facebook button to work
<div id="fb-root
"></div>
(function
(d, s, id) {
if (d.getElementById
(id)) return
;
js= d.createElement
(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"
;
fjs
.parentNode
.insertBefore
(js, fjs);
}(document
, 'script'
, 'facebook-jssdk'
));
To make Twitter Button work, we have added the following script just before the closing
body tag
(function
() {
var po = document
.createElement
('script'
); po.type= 'text/javascript'
; po.async
= true;
po
.src = 'https://apis.google.com/js/plusone.js'
;
var s = document
.getElementsByTagName
('script'
)[0]; s.parentNode
.insertBefore
(po,
s);
})();
We used the following style to add some adding to the social buttons with 'socials' class
.socials {
padding: 10px;
For creating a slideshow just below the navbar, on the home page of our project. we will use
the following markup
<div id="carousel-example-generic" class="carousel slide">
<ol class="carousel-indicators">
target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-caption">
</div>
</div>
<div class="item">
<div class="carousel-caption">
<p><buttonclass
="btn btn-success btn-lg
">Try 30 day trial</p>
now
</div>
</div>
<div class"
= item">
<img src="cloud1.jpg
" alt="...">
<div class
="carousel-caption
">
<p><buttonclass"
= btn btn-success btn-lg
">Try 30 day trial</now
p>
</div>
</div>
</div>
<!-- Controls
-->
<a class
="left carousel-control
" href="#carousel-example-generic
" data-
slide"
= prev">
<spanclass"
= icon-prev
"></span>
</a>
<a class
="right carousel-control
" href="#carousel-example-generic
" data-
slide="next">
<spanclass
="icon-next
"></span>
</a>
</div>
</div>
There are four parts in the Carousal. The main container is defined using a div tag and
'carousel slide' class is assigned to it.
Then there is an ordered list having 'carousel-indicators' class associated with it. Each of the
list item in this ol refers to a slide. class 'active' is assigned to the slide which loads by
default when the page loads. When rendered, you can see them as tiny circles just below
the caption.
Then, each slide (image) is placed within a div tag and class 'item' is assigned to it. Each of
these items again nests a div with class 'carousel-caption' assigned to it. carousel-caption
holds some markup which is displayed as captions along with the image. We have an h1
and a button wrapped in a paragraph here, but you may have your own markup.
The last part is for next previous and slide/slide by control. This is defined using 'left' and
'carousel-control' for previous and 'right' and 'carousel-control' classes for next.
'icon-prev' and 'icon-next' classes are used for next and previous icons.
We have made some customization in the default carousal. We wanted the captions,
indicators, and next/previous icons to be rendered some pixels above its default position.
For that, we have added the following styles in our custom.css file
.carousel-inner .item .carousel-caption {
.carousel-indicators {
position: absolute;
top: 400px; }
.navbar { margin-
bottom:0;
.navbar-nav>li>a { line-
Responsive Image
You might have already noticed that for each of the images in the slideshow, we have used
'img-responsive' class. This is a new feature in Bootstrap v3.0.0. Using the 'img-responsive'
class along with img tag, Bootstrap makes the images responsive.
Creating Grid
Below the slideshow, we have placed our content using grids. We opened the grid with a div
with 'container' class. Note that we are going to develop a responsive website and unlike
previous versions of Bootstrap, here, we have a single class for container and the is
responsive by default.
Container div nests number of divs (three in the first row and six in the second row) with
class 'row' associated with them to create rows of the Bootstrap's grid.
Each row then holds divs with class 'col-x-y' to create columns. The value of x can be xs for
mobile devices, sm for tablets, md for laptops and smaller desktop screens, and lg for large
desktop screens. it takes a mobile first approach. The value of y can be any positive integer
but a total number of columns in a grid must not exceed 12. In our project, we have used lg
for the sake of simplicity but since we have done so, you may have a stacked experience
while watching the project site in mobile or tablets.
In a couple of days we will have a complete tutorial on Grid system of Twitter Bootstrap
V3.0.0 and there we will explore its awesomeness of the responsive capabilities.
In this example, we have wanted three equal width columns in our first row, so we used
'collg-4' for all of the columns. In the second row, we have made it 'col-lg-2' since we wanted
six columns.
Following is the markup for grid containing two rows, the first row has three columns and the
second row has six columns.
<div class="row barone">
<div class="col-lg-2">
<p><img src="https://www.w3resource.com/images/w3resourcelogo.gif"></p>
</div>
<div class="col-lg-2">
<div class="col-lg-2">
<p><img src="https://w3resource.com/update-images/mysql-logo.jpg"></p>
</div>
<div class="col-lg-2">
<p><img src="https://w3resource.com/update-images/javascript-logo.png"></p>
</div>
<div class="col-lg-2">
<p><img src="https://w3resource.com/update-images/java.png"></p>
</div>
<div class="col-lg-2">
<p><img src="https://w3resource.com/update-images/postgresql.png"></p>
</div>
</div>
Using tables
In the price.html page of our project, we are using a table to render a price table. We used
the following markup
<table class="table table-bordered">
<thead>
<tr>
<th>Features</th>
<th>Individual</th>
<th>Small Team</th>
<th>Medium Team</th>
<th>Enterprise</th>
</tr>
</thead>
<tbody>
<tr>
<td><h3>No. Of users</h3></td>
<td><span class="badge">One</span></td>
<td><span class="badge">Five</span></td>
<td><span class="badge">Fifteen</span></td>
<td><span class="badge">Unlimited</span></td>
</tr>
<tr>
<td><h3>Pro training</h3></td>
<td><span class="badge">No</span></td>
<td><span class="badge">Yes</span></td>
<td><span class="badge">Yes</span></td>
<td><span class="badge">Yes</span></td>
</tr>
<tr>
<td><h3>Forum Support</h3></td>
<td><span class="badge">Yes</span></td>
<td><span class="badge">Yes</span></td>
<td><span class="badge">Yes</span></td>
<td><span class="badge">Yes</span></td>
</tr>
<tr>
<td><span class="badge">No</span></td>
<td><span class="badge">No</span></td>
<td><span class="badge">Yes</span></td>
<td><span class="badge">Yes</span></td>
</tr>
<tr>
<td><h3>Weekly webinars</h3></td>
<td><span class="badge">No</span></td>
<td><span class="badge">No</span></td>
<td><span class="badge">Yes</span></td>
<td><span class="badge">Yes</span></td>
</tr>
<tr>
<td><h3>Price</h3></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
Two classes 'table' and 'table-bordered' are used which are default form Bootstrap's original
css file. But we have made some customizations to make the table heads look different by
adding following css in our customize.css file
th {
background-color: #428bca;
color: #ec8007;
z-index: 10;
font-size: 24px;
Using badges
We have used class 'badge' for displaying some texts within our table. We have customized
badge class also with following css
.badge { background-color: #428bca; color: #fff; font-
size: 22px;
For this and contact.html page, we have added another css rule in customize.css
.container > h1 { text-align: center;
Using form
In the contact.html file we have created three columns and in the first column, we have
embedded a from. We have used default styles for this.
<form class="form-horizontal" role="form">
<div class="form-group">
<div class="col-lg-10">
</div>
</div>
<div class="form-group">
<div class="col-lg-10">
</div>
</div>
<div class="form-group">
<div class="col-lg-10">
<select>
<option>USA</option>
<option>India</option>
<option>UK</option>
<option>Autralia</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-lg-10">
</div>
</div>
<div class="form-group">
</div>
</div>
</form>
'form-horizontal' class places the form controls horizontally. Note that there is role="form"
added for accessibility. This is anew feature of version 3.0.0.
For placing each of the form control Bootstrap 3.0.0 uses a new 'form-group' class.
In the second column of the grid in this page, we have placed some text simply.
In the third column of the grid in the contact.html page, we have added Google Map. For
that, we have used the following markup
<div id="map_canvas"></div>
</div>
And the following js, which has been added at the top the HTML file within head
function initialize() { var map_canvas =
google.maps.MapTypeId.ROADMAP
map_options)
} google.maps.event.addDomListener(window, 'load',
initialize);
And you must add the following script tag before the said js
<script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
Copy
You have to add following style in custom.css for the map to be rendered properly
#map_canvas { width: 400px; height: 400px;
This is how we have created our first simple project based on Twitter Bootstrap V3.0.0. But
we have just scratched the surface. This series will update all the Twitter Bootstrap Tutorial
we have to version 3.0.0 exploring new techniques and customizations.
jQuery
jQuery is a fast, small, cross-platform and feature-rich JavaScript library. It is designed to simplify the
client-side scripting of HTML. It makes things like HTML document traversal and manipulation,
animation, event handling, and AJAX very simple with an easy-to-use API that works on a lot of
different type of browsers.
The main purpose of jQuery is to provide an easy way to use JavaScript on your website to make it
more interactive and attractive. It is also used to add animation.
What is jQuery
jQuery is a small, light-weight and fast JavaScript library. It is cross-platform and supports different
types of browsers. It is also referred as ?write less do more? because it takes a lot of common tasks
that requires many lines of JavaScript code to accomplish, and binds them into methods that can be
called with a single line of code whenever needed. It is also very useful to simplify a lot of the
complicated things from JavaScript, like AJAX calls and DOM manipulation.
jQuery Features
Following are the important features of jQuery.
o HTML manipulation o
DOM manipulation o
DOM element selection
o CSS manipulation o
Effects and Animations
o Utilities
o AJAX o HTML event
methods o JSON
Parsing
o Extensibility through
plug-ins
So, you can say that out of the lot of JavaScript frameworks, jQuery is the most popular and
the most extendable. Many of the biggest companies on the web use jQuery.
Almost every new client these days wants a mobile version of their website. It’s
practically essential after all: one design for the BlackBerry, another for the iPhone,
the iPad, netbook, Kindle — and all screen resolutions must be compatible, too. In the
next five years, we’ll likely need to design for a number of additional inventions.
When will the madness stop? It won’t, of course.
Almost every new client these days wants a mobile version of their website. It’s
practically essential after all: one design for the BlackBerry, another for the iPhone, the
iPad, netbook, Kindle — and all screen resolutions must be compatible, too. In the next
five years, we’ll likely need to design for a number of additional inventions. When will
the madness stop? It won’t, of course.
In the field of Web design and development, we’re quickly getting to the point of
being unable to keep up with the endless new resolutions and devices. For many
websites, creating a website version for each resolution and new device would be
impossible, or at least impractical. Should we just suffer the consequences of losing
visitors from one device, for the benefit of gaining visitors from another? Or is there
another option?
require countless custom-made solutions for each new category of users. Obviously,
we can’t use motion sensors and robotics to accomplish this the way a building would.
Responsive Web design requires a more abstract way of thinking. However, some
ideas are already being practiced: fluid layouts, media queries and scripts that can
reformat Web pages and mark-up effortlessly (or automatically). But responsive Web
design is not only about adjustable screen resolutions and automatically resizable
images, but rather about a whole new way of thinking about design. Let’s talk about
all of these features, plus additional ideas in the making.
Adjusting Screen Resolution
With more devices come varying screen resolutions, definitions and orientations. New
devices with new screen sizes are being developed every day, and each of these
devices may be able to handle variations in size, functionality and even color. Some
are in landscape, others in portrait, still others even completely square. As we know
from the rising popularity of the iPhone, iPad and advanced smartphones, many new
devices are able to switch from portrait to landscape at the user’s whim. How is one to
design for these situations?
In addition to designing for both landscape and portrait (and enabling those
orientations to possibly switch in an instant upon page load), we must consider the
hundreds of different screen sizes. Yes, it is possible to group them into major
categories, design for each of them, and make each design as flexible as necessary.
But that can be overwhelming, and who knows what the usage figures will be in five
years? Besides, many users do not maximize their browsers, which itself leaves far
too much room for variety among screen sizes.
Morten Hjerde and a few of his colleagues identified statistics on about 400 devices
sold between 2005 and 2008. Below are some of the most common:
Since then even more devices have come out. It’s obvious that we can’t keep creating
custom solutions for each one. So, how do we deal with the situation?
PART OF THE SOLUTION: FLEXIBLE EVERYTHING
A few years ago, when flexible layouts were almost a “luxury” for websites, the only
things that were flexible in a design were the layout columns (structural elements) and
the text. Images could easily break layouts, and even flexible structural elements broke
a layout’s form when pushed enough. Flexible designs weren’t really that flexible;
they could give or take a few hundred pixels, but they often couldn’t adjust from a
large computer screen to a netbook.
Now we can make things more flexible. Images can be automatically adjusted, and we
have workarounds so that layouts never break (although they may become squished
and illegible in the process). While it’s not a complete fix, the solution gives us far
more options. It’s perfect for devices that switch from portrait orientation to landscape
in an instant or for when users switch from a large computer screen to an iPad.
Introduction : In this section I will talk about the project I created during my
training and I will code a website which will be dynamic and responsive. I
will use HTML, CSS, Javascript and also Bootsrap framework.
This explains responsiveness of my website and also one code refers to different
views in different browser sizes.
HTML CODE:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>David Chu's China Bistro</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/styles.css">
<link href='https://fonts.googleapis.com/css?family=Oxygen:400,300,700'
rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Lora' rel='stylesheet'
type='text/css'>
</head>
<body>
<header>
<nav id="header-nav" class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<a href="index.html" class="pull-left visible-md visible-lg">
<div id="logo-img" alt="Logo image"></div>
</a>
<div class="navbar-brand">
<a href="index.html"><h1>David Chu's China Bistro</h1></a>
<p>
<img src="images/star-k-logo.png" alt="Kosher certification">
<span>Kosher Certified</span>
</p>
</div>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<footer class="panel-footer">
<div class="container">
<div class="row">
<section id="hours" class="col-sm-4">
<span>Hours:</span><br>
Sun-Thurs: 11:15am - 10:00pm<br>
Fri: 11:15am - 2:30pm<br>
Saturday Closed
<hr class="visible-xs">
</section>
<section id="address" class="col-sm-4">
<span>Address:</span><br>
7105 Reisterstown Road<br>
Baltimore, MD 21215
<p>* Delivery area within 3-4 miles, with minimum order of $20 plus $3
charge for all deliveries.</p>
<hr class="visible-xs">
</section>
<section id="testimonials" class="col-sm-4">
<p>"The best Chinese restaurant I've been to! And that's saying a lot, since
I've been to many!"</p>
<p>"Amazing food! Great service! Couldn't ask for more! I'll be back again
and again!"</p>
</section>
</div>
CSS CODE:
body { font-
size: 16px;
color: #fff;
background-color: #61122f;
font-family: 'Oxygen', sans-serif;
}
#logo-img {
background: url('../images/restaurant-logo_large.png') no-repeat;
width: 150px; height: 150px; margin: 10px 15px 10px 0;
}
.navbar-brand {
padding-top: 25px;
}
.navbar-brand h1 { /* Restaurant name */
font-family: 'Lora', serif; color: #557c3e;
font-size: 1.5em; text-transform:
uppercase; font-weight: bold; text-
shadow: 1px 1px 1px #222;
margin-top: 0; margin-
bottom: 0;
line-height: .75;
}
.navbar-brand a:hover, .navbar-brand a:focus { text-
decoration: none;
}
.navbar-brand p { /* Kosher cert */
color: #000; text-transform:
uppercase; font-size: .7em;
margin-top: 15px;
}
.navbar-brand p span { /* Star-K */
vertical-align: middle;
}
#nav-list { margin-
top: 10px;
}
#nav-list a
{ color:
#951C49;
text-align: center;
}
#nav-list a:hover {
background: #E7E7E7;
}
#nav-list a span {
font-size: 1.8em;
}
#phone {
margin-top: 5px;
}
#phone a { /* Phone number */
text-align: right;
padding-bottom: 0;
}
#phone div { /* We Deliver */
color: #557c3e; text-align:
right;
padding-right: 15px;
}
/* FOOTER */ .panel-
footer { margin-top:
30px; padding-top: 35px;
padding-bottom: 30px;
background-color: #222;
border-top: 0;
}
.panel-footer div.row {
margin-bottom: 35px;
}
#hours, #address {
line-height: 2;
}
#hours > span, #address > span {
font-size: 1.3em;
}
#address p
{ color: #557c3e;
font-size: .8em;
line-height: 1.8;
}
#testimonials {
font-style: italic;
}
#testimonials p:nth-child(2) {
margin-top: 25px;
}
/* END FOOTER */
/* HOME PAGE */
.container .jumbotron { box-
shadow: 0 0 50px #3F0C1F;
border: 2px solid #3F0C1F;
}
text-transform:
uppercase;
background-color: #000;
color: #fff; opacity: .8;
}
.category-tile:hover {
box-shadow: 0 1px 5px 1px #cccccc;
}
#menu-categories-title + div {
margin-bottom: 50px;
}
/* END MENU CATEGORIES PAGE */
max-width: 250px;
}
.menu-item-photo div
{ position: absolute;
bottom: 0; right: 0; width:
80px; background-color:
#557c3e; text-align: center;
}
.menu-item-description {
padding-right: 30px;
}
h3.menu-item-title {
margin: 0 0 10px;
}
.menu-item-details { font-
size: .9em;
font-style: italic;
}
/* END SINGLE CATEGORY PAGE */
}
/* End Header */
/* Home Page
*/ .container .jumbotron {
background: url('../images/jumbotron_992.jpg') no-repeat;
height: 558px;
}
/* End Home Page */
}
/* Footer */ .panel-
footer section { margin-
bottom: 30px; text-
align: center;
}
.panel-footer section:nth-child(3) {
margin-bottom: 0; /* margin already exists on the whole row */
}
.panel-footer section hr
{ width: 50%;
}
/* End Footer */
/* Home Page
*/ .container .jumbotr
on { margin-top:
30px;
padding: 0;
}
#menu-tile, #specials-tile
{ width: 360px;
margin: 0 auto 15px;
}
.menu-item-photo {
margin-right: auto;
}
.menu-item-tile .menu-item-price {
text-align: center;
}
.menu-item-description {
text-align: center;;
}
}
/********** Super extra small devices Only :-) (e.g., iPhone 4) **********/
@media (max-width: 479px) {
/* Header */
.navbar-brand h1 { /* Restaurant name */
padding-top: 5px; font-
size: 6vw;
}
/* End Header */
/* Home page */
#menu-tile, #specials-tile
{ width: 280px;
margin: 0 auto 15px;
}
.col-xxs-12
{ position: relative;
min-height: 1px;
padding-right: 15px;
padding-left: 15px;
float: left;
width: 100%;
}
}
JAVASCRIPT CODE:
$(function () { // Same as document.addEventListener("DOMContentLoaded"...
// Same as
document.querySelector("#navbarToggle").addEventListener("blur",...
$("#navbarToggle").blur(function (event) {
var screenWidth = window.innerWidth; if
(screenWidth < 768) {
$("#collapsable-nav").collapse('hide');
}
});
});
(function (global) {
var dc = {};
"https://davids-restaurant.herokuapp.com/categories.json"; var
categoriesTitleHtml = "snippets/categories-title-snippet.html"; var
categoryHtml = "snippets/category-snippet.html"; var
menuItemsUrl =
"https://davids-restaurant.herokuapp.com/menu_items.json?category=";
var menuItemsTitleHtml = "snippets/menu-items-title.html"; var
menuItemHtml = "snippets/menu-item.html";
// Remove the class 'active' from home and switch to Menu button
var switchMenuToActive = function () { // Remove 'active' from
home button
var classes = document.querySelector("#navHomeButton").className; classes =
classes.replace(new RegExp("active", "g"), "");
document.querySelector("#navHomeButton").className = classes;
document.querySelector("#navMenuButton").className = classes;
}
};
// TODO: STEP 4: Insert the the produced HTML in STEP 3 into the main page
// Use the existing insertHtml function for that purpose. Look through this code
for an example // of how to do that.
// ....
insertHtml('#main-content', homeHtmlToInsertIntoMainPage);
},
false); // False here because we are getting just regular HTML from the server,
so no need to process JSON.
}
var categoriesViewHtml =
buildCategoriesViewHtml(categories,
categoriesTitleHtml,
categoryHtml);
insertHtml("#main-content", categoriesViewHtml);
},
false);
},
false);
}
function buildCategoriesViewHtml(categories,
categoriesTitleHtml,
categoryHtml) {
finalHtml += "</section>";
return finalHtml;
}
// Builds HTML for the single category page based on the data
// from the server
function buildAndShowMenuItemsHTML (categoryMenuItems) {
// Load title snippet of menu items page
$ajaxUtils.sendGetRequest( menuItem
sTitleHtml, function
(menuItemsTitleHtml) { // Retrieve
single menu item snippet
$ajaxUtils.sendGetRequest( menuIte
mHtml, function (menuItemHtml) {
var menuItemsViewHtml =
buildMenuItemsViewHtml(categoryMenuItems,
menuItemsTitleHtml,
menuItemHtml);
insertHtml("#main-content", menuItemsViewHtml);
},
false);
},
false);
}
menuItemsTitleHtml =
insertProperty(menuItemsTitleHtml,
"name",
categoryMenuItems.category.name);
menuItemsTitleHtml =
insertProperty(menuItemsTitleHtml,
"special_instructions",
categoryMenuItems.category.special_instructions);
finalHtml += html;
}
finalHtml += "</section>";
return finalHtml;
}
Without them this project and this report would not have been possible.