Web Desingning
Web Desingning
UNIT – 1
Q, No – 1. Describe the basic principle of developing a website.
There are various principle of developing a website.
a) Simple is the best
b) Consistency
c) Readability
d) Mobile Compa bility
e) Text of size
f) Types of font
g) Image
h) Videos etc…
Hos ng
The web hos ng is a storage loca on that is use to store content of your website.
The website hos ng and stored content of your website that are also known as servers.
The computer will connect to the sever and the web pages will be delivered through the browser.
Dynamic Website
a) In dynamic website the web pages are returned by server which are process during the run me
and source are wri en in run me.
b) Content of webpages can be changed.
c) Interac on with database is possible.
d) It is slower than sta c website.
e) Higher development cost.
HEAD: This contains the informa on about the HTML document. For Example, the Title of the page,
version of HTML, Meta Data, etc.
BODY: This contains everything you want to display on the Web Page.
Example :-
Q, No 7. Root Element :- The <html> element is the root element and it defines the whole HTML
document. It has a start tag <html> and an end tag </html> . The <body> element defines the document's
body. It has a start tag <body> and an end tag </body> .
Q, No – 8 . Parsing Element :- The following elements have varying levels of special parsing rules: HTML's
address , applet , area , ar cle , aside , base , basefont , bgsound , blockquote , body , br , bu on ,
cap on , center , col , colgroup , command , dd , details , dir , div , dl , dt , embed , fieldset , figcap on ,
figure , footer , form ...
UNIT – 2
Q, No – 1. How to define MARK Element, STRONG Element, CODE Element and SMALL Element.
MARK Element :- Mark element are used to mark and highlight the text in html documents for
reference purposes.
CLASS – Indicate class name for the mark element
ID – Indicate a unique id for the mark element.
STYLE – Indicate a inline element for the mark element.
TITLE – Indicate the tle element for the mark element.
STRONG ELEMENT :- The strong element are used are used to emphasize important text.
CODE ELEMENT :- Code element are used to computer code in html documents.
SMALL ELEMNT :- Small element are used to represent small element in documents.
Example :-
<table border="1" >
<tr>
<th>Name</th>
<th>Age</th>
<th>Country</th>
</tr>
<tr>
<td>Harry Depp</td>
<td>28</td>
<td>Britain</td>
</tr>
<tr>
<td>John Smith</td>
<td>35</td>
<td>USA</td>
</tr>
<tr>
<td>Ram Krishna</td>
<td>19</td>
<td>Nepal</td>
</tr>
</table>
Q, No – 5. Write short note on image and how to insert image in web pages.
IMAGE :- The HTML <img> tag is used to embed an image in a web page. Images are not technically
inserted into a web page; images are linked to web pages. The <img> tag creates a holding space
for the referenced image.
The <img> tag is empty, it contains a ributes only, and does not have a closing tag.
The <img> tag has two required a ributes:
Advantages of Frames
Frame Provides technical sophis cated appearance to the web site.
It facility to reduce downloading me and improves the usability of the website.
Frames generally include naviga on link, header or footers, which help user to find and navigate to
required informa on.
It separates content of website from naviga on elements, which is useful for website maintenance
and content modifica on.
Disadvantages of Frames
The web developer must be track of more HTML documents linked with main frame.
It is difficult to print the en re page, which is developed using frame.
Example :-
<html>
<head>
< tle>Frameset Example 1< tle>
</head>
<frameset rows="35%, 65%">
<frame src ="frame_1.html" />
<frame src ="frame_2.html" />
</frameset>
</html>
Advantage
It is less complex therefore the effort are significantly reduced.
It helps to form spontaneous and consistent changes.
Easy for the user to customize the online page
It reduces the file transfer size.
Disadvantage
There exists a scarcity of security.
Browser compatibility.
There might be cross-browser issues while using CSS.
There are multiple levels which creates confusion for non-developers and beginners.
External CSS
With an external style sheet, you can change the look of an entire website by changing just one file!
Each HTML page must include a reference to the external style sheet file inside the <link> element,
inside the head section.
Example
External styles are defined within the <link> element, inside the <head> section of an HTML page:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="mystyle.css">
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Internal CSS
An internal style sheet may be used if one single HTML page has a unique style.
The internal style is defined inside the <style> element, inside the head section.
Example
Internal styles are defined within the <style> element, inside the <head> section of an HTML page:
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: linen;
}
h1 {
color: maroon;
margin-left: 40px;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Inline CSS
An inline style may be used to apply a unique style for a single element.
To use inline styles, add the style attribute to the relevant element. The style attribute can contain any
CSS property.
Example
Inline styles are defined within the "style" attribute of the relevant element:
<!DOCTYPE html>
<html>
<body>
</body>
</html>
Example
Here, all <p> elements on the page will be center-aligned, with a red text color:
p {
text-align: center;
color: red;
}
The id of an element is unique within a page, so the id selector is used to select one unique element!
To select an element with a specific id, write a hash (#) character, followed by the id of the element.
Example
The CSS rule below will be applied to the HTML element with id="para1":
#para1 {
text-align: center;
color: red;
}
To select elements with a specific class, write a period (.) character, followed by the class name.
Example
In this example all HTML elements with class="center" will be red and center-aligned:
.center {
text-align: center;
color: red;
}
Example
The CSS rule below will affect every HTML element on the page:
* {
text-align: center;
color: blue;
}
Table
List
Lists are used to group together related pieces of information.
It is used for ranking the data; I mean numbering or bulleting the data according to its rank.
It can also be used for designing and layout formatting.
For an example: You can design a menu on webpage using lists.
o list-style-type: This property is responsible for controlling the appearance and shape of the marker.
o list-style-image: It sets an image for the marker instead of the number or a bullet point.
o list-style-position: It specifies the position of the marker.
o list-style: It is the shorthand property of the above properties.
o marker-offset: It is used to specify the distance between the text and the marker. It is unsupported in IE6 or
Netscape 7.
CSS Class :- The class selector is used to select the HTML elements with a specific class attribute. It is
written with a period character . (full stop symbol) followed by the class name.
Syntax:
.class{
// declarations of CSS
}
Q, No – 11. Explain Box model and its dimension.
The CSS box model is a container that contains multiple properties including borders, margins,
padding, and the content itself. It is used to create the design and layout of web pages. It can be used
as a toolkit for customizing the layout of different elements. The web browser renders every element
as a rectangular box according to the CSS box model.
CSS Padding
The CSS padding properties are used to generate space around an element's content, inside of any
defined borders.
With CSS, you have full control over the padding. There are properties for setting the padding for each
side of an element (top, right, bottom, and left).
CSS has properties for specifying the padding for each side of an element:
padding-top
padding-right
padding-bottom
padding-left
Example
Set different padding for all four sides of a <div> element:
div {
padding-top: 50px;
padding-right: 30px;
padding-bottom: 50px;
padding-left: 80px;
}
CSS Margins
The CSS margin properties are used to create space around elements, outside of any defined borders.
With CSS, you have full control over the margins. There are properties for setting the margin for each
side of an element (top, right, bottom, and left).
CSS has properties for specifying the margin for each side of an element:
margin-top
margin-right
margin-bottom
margin-left
Example
Set different margins for all four sides of a <p> element:
p {
margin-top: 100px;
margin-bottom: 100px;
margin-right: 150px;
margin-left: 80px;
}
CSS Borders
The CSS border properties allow you to specify the style, width, and color of an element's border.
Example
Demonstration of the different border styles:
p.dotted {border-style: dotted;}
p.dashed {border-style: dashed;}
Q, No – 12. Discuss CSS advanced and grouping dimension.
Dimensions in CSS: To specify the height and width of an element you can use height and width
properties. It does not specify the borders, margins, and padding, it just sets the height and width inside
the border, margins, and padding for an HTML element.
Auto This is the default. The browser calculates the height and width
Inherit The height and width will be inherited from its parent value
The text-align property in CSS is used for the alignment of text. This CSS property is used to set the horizontal
alignment of a table-cell box or the block element. It is similar to the vertical-align property but in the horizontal
direction.
The text-align property includes values like justify, center, right, left, initial, and inherit. It specifies the horizontal
alignment of text in an element.
Syntax
Example
h1 {
text-align: center;
}
h2 {
text-align: left;
}
h3 {
text-align: right;
}
Q, No – 14. Write about Pseudo Code and write down common categories of pseudo class in CSS.
A Pseudo class in CSS is used to define the special state of an element. It can be combined with a CSS
selector to add an effect to existing elements based on their states. For Example, changing the style of
an element when the user hovers over it, or when a link is visited. All of these can be done using
Pseudo Classes in CSS.
Note that pseudo-class names are not case-sensitive.
Syntax:
selector: pseudo-class{
property: value;
}
The color property in CSS is used to set the color of HTML elements. Typically, this property is used
to set the background color or the font color of an element. In CSS, we use color values for
specifying the color. We can also use this property for the border-color and other decorative effects.
Text Color
The color property is used to apply foreground color (which includes text color).
body {
color: black;
}
Text Color
The background-color property is used to apply a background color to an element. You can also
use the background shorthand property.
body {
background-color: green;
}
Border Color
The border-color is a shorthand property for setting the color on all sides of an element's
border. There are actually quite a few different properties for doing this (these are included
in the above list).
aside {
border-color: blue;
}
The text-decoration-color allows you to set the color of the text-decoration property.
a:link {
text-decoration: underline;
text-decoration-color: orange;
}
Q, No – 1. Client side scripting :- A client-side script is a small program (or set of instructions) that is
embedded (or inserted) into a web page. It is processed within the client browser instead of the web
server.
The client side script downloads at the client end from the server along with the HTML web page it is
embedded in. The web browser interprets and executes the code and then displays the results on the
monitor.
The script that executes on the user’s computer system is called client. It is embedded (or inserted)
within the HTML document or can be stored in an external separate file (known as external script).
The script files are sent to the client machine from the web server (or severs) when they are requested.
The client’s web browser executes the script, then displays the web page, including any visible output
from the script.
Q, No – 2. What is JavaScript :- JavaScript is a dynamic computer programming language. It is lightweight
and most commonly used as a part of web pages, whose implementations allow client-side script to interact
with the user and make dynamic pages. It is an interpreted programming language with object-oriented
capabilities.
JavaScript was first known as LiveScript, but Netscape changed its name to JavaScript, possibly because of
the excitement being generated by Java. JavaScript made its first appearance in Netscape 2.0 in 1995 with
the name LiveScript. The general-purpose core of the language has been embedded in Netscape, Internet
Explorer, and other web browsers.
Less server interaction − You can validate user input before sending the page off to the server. This
saves server traffic, which means less load on your server.
Immediate feedback to the visitors − They don't have to wait for a page reload to see if they have
forgotten to enter something.
Increased interactivity − You can create interfaces that react when the user hovers over them with a
mouse or activates them via the keyboard.
Richer interfaces − You can use JavaScript to include such items as drag-and-drop components and
sliders to give a Rich Interface to your site visitors.
1. An object
2. An array
3. A date
Q, No – 2. What is an Operator?
In JavaScript, an operator is a special symbol used to perform operations on operands (values and
variables). For example,
2 + 3; // 5
Here + is an operator that performs addition, and 2 and 3 are operands.
Assignment Operators
Arithmetic Operators
Comparison Operators
Logical Operators
Bitwise Operators
String Operators
Other Operators
const x = 5;
= Assignment operator a = 7; // 7
const number = 3 + 5; // 8
+ Addition x + y
- Subtraction x - y
* Multiplication x * y
/ Division x / y
% Remainder x % y
** Exponentiation (Power) x ** y
JavaScript if Statement
The if statement is used to evaluate a particular condition. If the condition holds true, the associated
code block is executed.
Syntax:
if ( condition ) {
// If the condition is met,
//code will get executed.
}
Example :
1. const num = 0;
2. if (num > 0) {
a. console.log("Given number is positive.");
3. } else if (num < 0) {
a. console.log("Given number is negative.");
4. } else {
a. console.log("Given number is zero.");
5. };
Q, No – 4. Described Loops in Javascript.
The JavaScript loops are used to iterate the piece of code using for, while, do while or for-in loops. It makes the code
compact. It is mostly used in array.
There are four types of loops in JavaScript.
1. for loop
2. while loop
3. do-while loop
4. for-in loop
1. while (condition)
2. {
3. code to be executed
4. }
JavaScript do while loop
The JavaScript do while loop iterates the elements for the infinite number of times like while loop. But, code
is executed at least once whether condition is true or false. The syntax of do while loop is given below.
1. do{
2. code to be executed
3. }while (condition);
Example :
1. <script>
2. var i=21;
3. do{
4. document.write(i + "<br/>");
5. i++;
6. }while (i<=25);
7. </script>
Syntax :
window.prompt("sometext","defaultText");
Confirm Box
A confirm box is often used if you want the user to verify or accept something.
When a confirm box pops up, the user will have to click either "OK" or "Cancel" to proceed.
If the user clicks "OK", the box returns true. If the user clicks "Cancel", the box returns false.
Syntax
window.confirm("sometext");
Alert Box
An alert box is used if we want to make sure information comes through the authenticate user.
Q, No – 6. What is an Event ?
JavaScript's interaction with HTML is handled through events that occur when the user or the browser
manipulates a page.
When the page loads, it is called an event. When the user clicks a button, that click too is an event. Other
examples include events like pressing any key, closing a window, resizing a window, etc.
Mouse events:
mouseover onmouseover When the cursor of the mouse comes over the element
mousedown onmousedown When the mouse button is pressed over the element
mouseup onmouseup When the mouse button is released over the element
Keyboard events:
Keydown & Keyup onkeydown & onkeyup When the user press and then release the key
Form events:
change onchange When the user modifies or changes the value of a form element
Window/Document events
unload onunload When the visitor leaves the current webpage, the browser
unloads it
resize onresize When the visitor resizes the window of the browser
To learn more about Arrays, please check out the JavaScript array chapter.
Array Properties
The following table lists the standard properties of the Array object.
Property Descrip on
prototype Allows you to add new proper es and methods to an Array object.
Array Methods
The following table lists the standard methods of the Array object.
Method Description
copyWithin() Copies part of an array to another location in the same array and returns it.
filter() Creates a new array with all elements that pass the test in a testing function.
find() Returns the value of the first element in an array that pass the test in a testing function.
findIndex() Returns the index of the first element in an array that pass the test in a testing function.
Q, No – 8. Javascript Object :- In JavaScript, objects are king. If you understand objects, you understand
JavaScript.
Q, No – 9. JavaScript Functions
JavaScript functions are used to perform operations. We can call JavaScript function many times to reuse the code.
1. <script>
2. function msg(){
3. alert("hello! this is message");
4. }
5. </script>
6. <input type="button" onclick="msg()" value="call function"/>
1. Basic Validation − First of all, the form must be checked to make sure all the mandatory fields
are filled in. It would require just a loop through each field in the form and check for data.
2. Data Format Validation − Secondly, the data that is entered must be checked for correct form
and value. Your code must include appropriate logic to test correctness of data.
If a form field (fname) is empty, this function alerts a message, and returns false, to prevent the form
from being submitted:
JavaScript Example
function validateForm() {
let x = document.forms["myForm"]["fname"].value;
if (x == "") {
alert("Name must be filled out");
return false;
}
}
UNIT – 5
The server that hosts your website is a physical computer that runs continuously to make the site available
for visitors all the time. Buying servers for web hosting will allow you to store all the data of your website in
the those servers of your provider.
> Types of websites.
1. Shared Hosting :- With shared hosting, multiple users share the same server resources, including memory,
processing power, and storage space.
Pros
Cost-effective, ideal for small-scale websites
Technical expertise is not required
Pre-configured server options
No need to take care of maintenance and server administration
Cons
Minimal access to server configuration
Increased traffic on other websites can affect your website’s speed
2. Virtual Private server web hosting :- VPS web hosting is a great option for medium-sized sites,
eCommerce shops, and large blogs with a rapidly growing number of visitors.
Pros
Top-Level Domain (TLD) refers to the suffix or the last part of a domain name. There’s a limited list of
predefined suffixes which includes:
TLDs are classified into two broad categories: generic top-level domains (gTLDs) and country-code
top-level domains (ccTLDs).
Generic Top-Level Domain (gTLDs) is a generic top-level domain name that identifies the domain class
it is associated with (.com, .org, .edu, etc).
Country Code Top-Level Domain (ccTLD) is a two-letter domain extension, such as .uk or .fr, assigned
to a country, geographic location or territory.
Q, No – 3. Explain Name Server.
A nameserver is a server in the DNS that translates domain names into IP addresses. Nameservers store and
organize DNS records, each of which pairs a domain with one or more IP addresses. These servers act as the
bridge between domain names, which we humans can remember, with IP addresses, which computers can
process.
System and Security - A section to check your computer's status, backup and restore, and others.
Network and Internet - View network status.
Hardware and Sound - View which devices are on your computer and add devices.
Programs - Uninstall programs.
User Accounts - Change user accessibility.
Appearance and Personalization - Change desktop options, like fonts and screen readers.
Clock and Region - Change date and time.
Ease of access - Optimize your display settings.
Types of SEO.
1. On-Page SEO (On-Site SEO):
2. Off-Page SEO (Off-Site SEO):
3. Technical SEO
4. International SEO
5. Local SEO
6. E-commerce SEO
7. Content SEO
8. Mobile SEO
9. White-Hat SEO
10. Black-Hat SEO
11. Gray-Hat SEO
12. Negative SEO
> White Hat SEO :- White hat SEO is the opposite of Black Hat SEO. Generally, white hat SEO refers
to any practice that improves your search rankings on a search engine results page (SERP)
while maintaining the integrity of your website and staying within the search engines’ terms of
service. These tactics stay within the bounds as defined by Google. Examples of white hat SEO
include:
Offering quality content and services
> Black Hat SEO :- Black hat SEO refers to a set of practices that are used to increases a site or
page’s rank in search engines through means that violate the search engines’ terms of
service. The term “black hat” originated in Western movies to distinguish the “bad guys” from
the “good guys,” who wore white hats (see white hat SEO). Recently, it’s used more commonly
to describe computer hackers, virus creators, and those who perform unethical actions with
computers.
The following SEO tactics are considered black hat and should not be exercised at all if you
want to stay above board with Google and other search engines:
Content Automation
Doorway Pages
Hidden Text or Links
Keyword Stuf ing
Reporting a Competitor (or Negative SEO)
Sneaky Redirects
Cloaking
Localized Traffic
Using local SEO tools such as Google My Business can help you improve your localized traffic.
Mobile Friendly
Good SEO means your site is responsive, your site speed is good, and there’s no latency for mobile users.
Expert Status
Following best SEO practices means your site is an authority. You only have one article per keyword, and you
only have backlinks from high-quality sites.
Customer Friendly
Potential customers find your site because of your SEO. They come to your site and see that you’re
professional. There are no grammatical errors in your content. You’re using the latest technology on a
secure site, and they only need to locate the buy button.
Disadvantages
Targeted by Competitors
Effective SEO means you rank high. Sites that rank high are targeted by competitors who want a slice of the
SEO pie, which means you’re always on your toes.
Changes
SEO can change. Just say the word “panda” and watch business owners frown. One small change to SEO, and
you can be at the top of the search results one day and the next day find your site greatly demoted.
Penalties
You need to always be on top of your game, which may require some financial investment. One example is
websites that haven’t been upgraded to responsive design will be penalized.
Slow Results
SEO isn’t a fast-moving process. You can update your site and use best practices and not see results for
months.
No Promises
You could update all your content and website features and still not find that your site has improved. SEO
doesn’t promise results.
Step 2: Indexing
The second step is indexing. Indexing is when a search engine decides whether or not it is going to use the
content that it has crawled.
Step 3: Ranking
The third step is really the most important step, and that is ranking. Ranking can only happen after the
crawling and indexing steps are complete.
> Discuss the three types of SEO :-
Technical Optimization:- Technical Optimization is the process of completing activities on your site that are
designed to improve SEO but are not related to content. It often happens behind the scenes.
On-Page Optimization:- On-Page Optimization is the process of ensuring the content on your site is relevant
and provides a great user experience. It includes targeting the right keywords within your content and can
be done through a content management system. Common examples of content management systems
include WordPress, Wix, Drupal, Joomla, Magento, Shopify, and Expression Engine.
Off-Page Optimization:- Off-Page Optimization is the process of enhancing your site’s search engine rankings
through activities outside of the site. This is largely driven by backlinks, which help to build the site’s
reputation.
2. Content
Content, in this context, doesn’t only refer to visible on-screen elements like texts and
images.
a. Text
b. Structural text elements
c. Graphics
d. Videos
e. Metatags