Web Desihing File
Web Desihing File
AIM: Introduction to HTML, CSS, Bootstrap Java Script and applications of them.
BOOTSTRAP
Bootstrap is an open-source and free CSS framework
developed by Mark Otto and Jacob Thornton while working
at Twitter. It was developed to make interface development
and maintenance easy and consistent. Bootstrap is a
mobile-first framework that optimizes code for mobile
devices first and scales up components as necessary using
CSS media queries. It is useful to develop responsive
websites without rewriting the code for each device or
screen. Bootstrap has not only HTML/CSS components but
also JS components. It provides pre-built CSS and
JavaScript for lists, navigation bars, forms, and other web
elements. Bootstrap is a pure CSS and JavaScript
framework that can be used with any editor or server
technology.
WHAT IS BOOTSTRAP?
Bootstrap mainly includes CSS (Cascading Style Sheets) and an optional
JavaScript-supported design template (plug-ins) that deals with typography,
buttons, forms, and other user interface components. This Bootstrap
framework helps rapid web development and supports developers in
creating responsive web pages.
HISTORY OF BOOTSTRAP
Twitter Blueprint was the first name for Bootstrap and was developed on
Twitter by Mr. Mark Otto and Jacob Thornton. It was released as an open-
source product on GitHub in August 2011. The framework is primarily built
to encourage design uniformity and reliability of web pages across
applications. Before its existence, developers used various external
libraries to perform responsive web development, leading to
incompatibilities in web development and heavy maintenance burdens.
WHY SHOULD DEVELOPERS USE BOOTSTRAP
Here are some of the essential usages of Bootstrap listed:
It is a lightweight and hence widely used framework for creating responsive sites.
What is CSS?
presentation of Web pages, including colors, layout, and fonts, thus making our
web pages presentable to the users.
CSS is designed to make style sheets for the web. It is independent of HTML and
can be used with any XML-based markup language. Now let’s try to break the
acronym: CSS stands for Cascading Style Sheets. It is the language for describing
the
CSS Syntax
Selector {
Property 1: value;
Property 2: value;
Property 3: value;
For example:
h1
Color: red.
Text-align center.
#unique
{
color: green;
JAVA SCRIPT
Introduction
A general understanding of the Internet and the World Wide Web (WWW).
Good working knowledge of Hypertext Markup Language (HTML).
Some programming experience. If you are new to programming, try one of
the tutorials linked on the main page about JavaScript.
If you are new to JavaScript, start with the articles in the learning area and
the JavaScript Guide. Once you have a firm grasp of the fundamentals, you can use
the JavaScript Reference to get more details on individual objects and statements.
What is JavaScript?
JavaScript is a cross-platform, object-oriented scripting language used to make
webpages interactive (e.g., having complex animations, clickable buttons, popup
menus, etc.). There are also more advanced server-side versions of JavaScript such
as Node.js, which allow you to add more functionality to a website than
downloading files (such as real time collaboration between multiple computers).
Inside a host environment (for example, a web browser), JavaScript can be
connected to the objects of its environment to provide programmatic control over
them.
JavaScript contains a standard library of objects, such as Array, Date, and Math,
and a core set of language elements such as operators, control structures, and
statements. Core JavaScript can be extended for a variety of purposes by
supplementing it with additional objects, for example:
This means that in the browser, JavaScript can change the way the webpage
(DOM) looks. And, likewise, Node.js JavaScript on the server can respond to
custom requests sent by code executed in the browser.
JavaScript and Java are similar in some ways but fundamentally different in some
others. The JavaScript language resembles Java but does not have Java's static
typing and strong type checking. JavaScript follows most Java expression syntax,
naming conventions and basic control-flow constructs which was the reason why it
was renamed from Live Script to JavaScript.
Java is a class-based programming language designed for fast execution and type
safety. Type safety means, for instance, that you can't cast a Java integer into an
object reference or access private memory by corrupting the Java bytecode. Java's
class-based model means that programs consist exclusively of classes and their
methods. Java's class inheritance and strong typing generally require tightly
coupled object hierarchies. These requirements make Java programming more
complex than JavaScript programming.
With Bootstrap’s popularity comes a wealth of helpful resources: articles, tutorials, third-party
plug-ins and extensions, templates, theme builders, and so on. So, whether you’re looking for
inspiration or code snippets, you’ll have everything you need to accelerate your progress.
You would think that having so many resources available, everyone would take advantage of it
and use it through their projects but believe it or not - that is not the case. Some developers waste
their time and slow project progress by skipping some great code snippets or resources. Although
you should not just blindly copy and paste, you must understand the good parts and adopt them
to your coding style and technical needs. The ability to find and sort out good resources and be
able effectively utilize it is also a skill and requires years of experience and knowledge.
EXPERIMENT NO 2
Aim: Design the static web pages required for an online bookstore website. As it
must contain three frames Home page, Login page and catalogue page.
Description:
<title>: Sets the title of the web page, which appears in the browser
tab.
<link reel="stylesheet">: Links an external CSS file (styles.css) for
styling.
<header>: Defines the header section of the web page, which typically
contains the website's title/logo and navigation menu.
<h1>: The main heading of the Home Page, welcoming visitors to the
online bookstore.
<nav>: The navigation menu containing links to the Home Page,
Login Page, and Catalog Page.
<main>: The main content section of the web page.
<section class="intro">: A section for introducing the website, with a
heading and a brief description.
<section class="featured books">: A section where you can feature
popular or recommended books. In the comment, it suggests adding
book images and descriptions.
This page is similar in structure to the Home Page but with a different
title.
<section class="login-form">: A section dedicated to the login form.
<form>: Defines an HTML form where users can enter their
credentials. The action attribute specifies where the form data should
be sent (e.g., to a server-side script like "login_process.php" for
processing).
<label>: Labels for the username and password input fields.
<input type="text"> and <input type="password>: These are text
input fields for the username and password, respectively. The
required attribute ensures that users must fill them out.
<input type="submit">: The submit button for the login form.
Similar structure to the Home Page and Login Page with a different
title.
<section class="book-list">: A section for displaying the book catalog.
Inside this section, you would typically list the books available in your
online store. You can include details such as book titles, authors,
descriptions, and images.
Please note that this is static HTML, and for a functional online book store,
you would need to integrate server-side scripting (e.g., PHP, Node.js) to
handle user authentication and retrieve data from a database for the
catalog. Additionally, you would implement the necessary security
measures and create actual pages for book details, user profiles, and
shopping cart functionality.
The <link rel="stylesheet"> references a CSS file (not shown in the code)
that would contain the styles for your web pages, including fonts, colors,
layout, and other visual elements. The styling is essential to make your web
pages look appealing and user-friendly.
Is this conversation helpful so far?Co
C
CODE:
Home page (index.html)
<!DOCTYPE html>
<html>
<head>
<title>Online Book Store</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<header>
<h1>Welcome to Our Online Book Store</h1>
<nav>
<a href="index.html">Home</a>
<a href="login.html">Login</a>
<a href="catalog.html">Catalog</a>
</nav>
</header>
<main>
<section class="intro">
<h2>Discover a World of Books</h2>
<p>Welcome to our online bookstore, where you can find a vast
collection of books on various topics.</p>
</section>
<section class="featured-books">
<h2>Featured Books</h2>
<!-- Add featured book images and descriptions here -->
</section>
</main>
</body>
</html>
Login page: (Login.html)
<!DOCTYPE html>
<html>
<head>
<title>Login - Online Book Store</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<header>
<h1>Login to Online Book Store</h1>
<nav>
<a href="index.html">Home</a>
<a href="login.html">Login</a>
<a href="catalog.html">Catalog</a>
</nav>
</header>
<main>
<section class="login-form">
<h2>Login</h2>
<form action="login_process.php" method="post">
<label for="username">Username:</label>
<input type="text" id="username" name="username"
required>
<br>
<label for="password">Password:</label>
<input type="password" id="password" name="password"
required>
<br>
<input type="submit" value="Login">
</form>
</section>
</main>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Login - Online Book Store</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<header>
<h1>Login to Online Book Store</h1>
<nav>
<a href="index.html">Home</a>
<a href="login.html">Login</a>
<a href="catalog.html">Catalog</a>
</nav>
</header>
<main>
<section class="login-form">
<h2>Login</h2>
<form action="login_process.php" method="post">
<label for="username">Username:</label>
<input type="text" id="username" name="username"
required>
<br>
<label for="password">Password:</label>
<input type="password" id="password" name="password"
required>
<br>
<input type="submit" value="Login">
</form>
</section>
</main>
</body>
</html>
OUTPUT
HOME PAGE
OUTPUT LOGIN PAGE
HTML Structure:
CSS Styles:
The CSS rules define the appearance and layout of the login form.
It sets the background color, font, container size, margins, padding, and
styles for input fields and the submit button.
Container:
The .container div defines a box that contains the login form. It's
centered on the page and has a white background with a subtle
shadow.
Form Elements:
<h2>: Displays the heading "Book Store Login" at the top of the form.
<form>: Defines the login form. The action attribute specifies where the
form data is sent when submitted. In this example, it's set to
login_process.php, which is a hypothetical server-side script for
processing the login.
Styling:
The CSS styles make the form visually appealing and user-friendly by
setting the input fields and button's appearance and positioning.
Code:
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<style>
body {
font-family: Arial, Helvetica, sans-serif.
background-color: #f2f2f2;
text-align: center;
}
.login-container {
margin: 150px auto.
padding: 20px.
width: 300px.
background-color: #fff.
border-radius: 5px.
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
input[type="text"], input[type="password"] {
width: 100%.
padding: 10px.
margin: 8px 0.
border: 1px solid #ccc.
border-radius: 3px.
}
input[type="submit"] {
background-color: #007BFF.
color: #fff.
border: none.
padding: 10px 20px.
border-radius: 3px.
cursor: pointer.
}
input[type="submit"]:hover {
background-color: #0056b3.
}
</style>
</head>
<body>
<div class="login-container">
<h2>Login</h2>
<form action="login_process.php" method="post">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
<br>
<label for="password">Password:</label>
<input type="password" id="password" name="password"
required>
<br>
<input type="submit" value="Login">
</form>
</div>
</body>
</html>
OUTPUT login page:
EXPERIMENT NO 4:
AIM: Catalogue Page: The catalogue page should contain the details of all the books available in the
website in a table
Description:
You would need to replace the example book images, titles, authors, and prices with
your actual book data. Additionally, in a real-world scenario, you might need to
implement dynamic functionality for adding items to a cart, handling user interactions,
and integrating with a backend system.
<div class="book">
<img src="book1.jpg" alt="Book 1">
<h3>Book Title 1</h3>
<p>Author: Author Name 1</p>
<p>Price: $10.99</p>
<button>Add to Cart</button>
</div>
<div class="book">
<img src="book2.jpg" alt="Book 2">
<h3>Book Title 2</h3>
<p>Author: Author Name 2</p>
<p>Price: $12.99</p>
<button>Add to Cart</button>
</div>
</div>
</body>
</html>
OUTPUT OF CATALOGUE PAGE: