Unit 1 (Ii)
Unit 1 (Ii)
Process
Step 1: Design
This is the fun part. You'll likely talk about color schemes, function, special features (like e-
commerce), graphics, videos, and the overall look. We always recommend coming to the
meeting with a few examples of websites you love. After that meeting, the creative team takes
some time to bring your vision to life in 2D.
Step 2: Review
Once the team has had some time to work through the design process. it's time to show the client.
This is usually done in person with a presentation. You can discuss the layout, colors, etc. during
this time. Often, more meetings will follow as you'll likely have some feedback and changes that
you'd like the creative team to implement.
Step 3: Develop
Now that the design is approved, it is time for the website to go to the developer. The developer
starts to build the website on a production server so you can view the site online without it being
viewable to the public. During that time, you can work with the copywriter and other people in
the agency to nail down the voice, content, and graphics. This is usually the longest part of the
process, but it is the most important!
Step 4: Test
Once your website has been coded by the developer and you've settled on all of your content, it
is time to review your new site on the test server. You'll receive a link to view the website and
share with your company and decision-makers. Usually there are a few tweaks that need to be
made at this stage before the site is finalized.
Step 5: Launch!
At long last, your new site is ready to launch! Once you give the go-ahead, the developer will
start the launch process. This includes setting up hosting and getting the domain pointed. It will
also take some time to propagate. Be patient — it will be worth it! After a few hours, your site
should be live and ready for you and the rest of the world to enjoy!
PRINCIPLES OF GOOD WEBSITE
DESIGN
1. WEBSITE PURPOSE
1. Describing Expertise
2. Building Your Reputation
3. Generating Leads
4. Sales and After Care
2. SIMPLICITY
Colour
Colour has the power to communicate messages and evoke emotional responses. Keep
the colour selection limited to less than 5 colours. Complementary colours work very
well. Pleasing colour combinations increase customer engagement and make the user
feel good.
Type
Typography has an important role to play on your website. It commands attention and
works as the visual interpretation of the brand voice. Typefaces should be legible and
only use a maximum of 3 different fonts on the website.
Imagery
Imagery is every visual aspect used within communications. This includes still
photography, illustration, video and all forms of graphics. Most of the initial information
we consume on websites is visual and as a first impression, it is important that high-
quality images are used to form an impression of professionalism and credibility in the
visitors’ minds.
3. NAVIGATION
Navigation is the wayfinding system used on websites where visitors interact and find what
they are looking for. Website navigation is key to retaining visitors. If the website navigation
is confusing visitors will give up and find what they need elsewhere. Keeping navigation
simple, intuitive and consistent on every page is key.
4. F-SHAPED PATTERN READING
The F- based pattern is the most common way visitors scan text on a website. Eye-tracking
studies have found that most of what people see is in the top and left areas of the screen. The
F shaped layout mimics our natural pattern of reading in the West (left to right and top to
bottom). An effectively designed website will work with a reader’s natural pattern of
scanning the page.
5. VISUAL HIERARCHY
Visual hierarchy is the arrangement of elements in order of importance. This is done either
by size, colour, imagery, contrast, typography, whitespace, texture and style. One of the most
important functions of visual hierarchy is to establish a focal point; this shows visitors where
the most important information is.
6. CONTENT
An effective website has both great design and great content. Using compelling language
great content can attract and influence visitors by converting them into customers.
8. LOAD TIME
Waiting for a website to load will lose visitors. Nearly half of web visitors expect a site to
load in 2 seconds or less and they will potentially leave a site that isn’t loaded within 3
seconds. Optimising image sizes will help load your site faster.
9. MOBILE FRIENDLY
More people are using their phones or other devices to browse the web. It is important to
consider building your website with a responsive layout where your website can adjust to
different screens.
https://www.feelingpeaky.com/9-principles-of-good-web-design/
HTML Attributes
All HTML elements can have attributes
Attributes provide additional information about elements
Attributes are always specified in the start tag
Attributes usually come in name/value pairs like: name="value"
Example
<a href="https://www.w3schools.com">Visit W3Schools</a>
Example
<img src="img_girl.jpg">
Tomato
Orange
DodgerBlue
MediumSeaGreen
Gray
SlateBlue
Violet
LightGray
Background Color
You can set the background color for HTML elements:
Each parameter (red, green, and blue) defines the intensity of the color with a value between 0
and 255.
This means that there are 256 x 256 x 256 = 16777216 possible colors!
For example, rgb(255, 0, 0) is displayed as red, because red is set to its highest value (255),
and the other two (green and blue) are set to 0.
Another example, rgb(0, 255, 0) is displayed as green, because green is set to its highest value
(255), and the other two (red and blue) are set to 0.
To display black, set all color parameters to 0, like this: rgb(0, 0, 0).
To display white, set all color parameters to 255, like this: rgb(255, 255, 255).
#rrggbb
Where rr (red), gg (green) and bb (blue) are hexadecimal values between 00 and ff (same as
decimal 0-255).
For example, #ff0000 is displayed as red, because red is set to its highest value (ff), and the
other two (green and blue) are set to 00.
Another example, #00ff00 is displayed as green, because green is set to its highest value (ff),
and the other two (red and blue) are set to 00.
To display black, set all color parameters to 00, like this: #000000.
To display white, set all color parameters to ff, like this: #ffffff.
Block-level Elements
A block-level element always starts on a new line, and the browsers automatically add some
space (a margin) before and after the element.
A block-level element always takes up the full width available (stretches out to the left and right
as far as it can).
Example
<p>Hello World</p>
<div>Hello World</div>
Inline Elements
An inline element does not start on a new line.
Example
<span>Hello World</span>
<a>
<b>
<br>
<em>
<i>
<img>
<input>
<small>
<span>
<strong>
<sub>
<sup>
Comment tag
<!-- Write your comments here -->
HTML Links
<a href="url">link text</a>
_self - Default. Opens the document in the same window/tab as it was clicked
_blank - Opens the document in a new window or tab
_parent - Opens the document in the parent frame
_top - Opens the document in the full body of the window
Absolute URLs vs. Relative URLs
Both examples above are using an absolute URL (a full web address) in the href attribute.
A local link (a link to a page within the same website) is specified with a relative URL (without
the "https://www" part):
<h2>Absolute URLs</h2>
<p><a href="https://www.w3.org/">W3C</a></p>
<p><a href="https://www.google.com/">Google</a></p>
<h2>Relative URLs</h2>
<p><a href="html_images.asp">HTML Images</a></p>
<p><a href="/css/default.asp">CSS Tutorial</a></p>
Example
<a href="default.asp">
<img src="smiley.gif" alt="HTML tutorial" style="width:42px;height:42px;">
</a>
Example
<a href="mailto:[email protected]">Send email</a>
Link Titles
The title attribute specifies extra information about an element. The information is most often
shown as a tooltip text when the mouse moves over the element.
Example
<a href="https://www.w3schools.com/html/" title="Go to W3Schools HTML section">Visit our
HTML Tutorial</a>
To create a bookmark - first create the bookmark, then add a link to it.
When the link is clicked, the page will scroll down or up to the location with the bookmark.
Example
First, use the id attribute to create a bookmark:
Then, add a link to the bookmark ("Jump to Chapter 4"), from within the same page:
Example
<a href="#C4">Jump to Chapter 4</a>
You can also add a link to a bookmark on another page:
Image Floating
Use the CSS float property to let the image float to the right or to the left of a text:
Image Maps
The HTML <map> tag defines an image map. An image map is an image with clickable areas. The
areas are defined with one or more <area> tags.
Example
Here is the HTML source code for the image map above:
<map name="workmap">
<area shape="rect" coords="34,44,270,350" alt="Computer" href="computer.htm">
<area shape="rect" coords="290,172,333,250" alt="Phone" href="phone.htm">
<area shape="circle" coords="337,300,44" alt="Coffee" href="coffee.htm">
</map>
HRML FRAMES
HTML frames are used to divide your browser window into multiple sections where each section
can load a separate HTML document. A collection of frames in the browser window is known as
a frameset. The window is divided into frames in a similar way the tables are organized: into
rows and columns.
Disadvantages of Frames
There are few drawbacks with using frames, so it's never recommended to use frames in your
webpages −
Some smaller devices cannot cope with frames often because their screen is not big enough
to be divided up.
Sometimes your page will be displayed differently on different computers due to different
screen resolution.
The browser's back button might not work as the user hopes.
There are still few browsers that do not support frame technology.
Creating Frames
To use frames on a page we use <frameset> tag instead of <body> tag. The <frameset> tag
defines how to divide the window into frames.
The rows attribute of <frameset> tag defines horizontal frames and
cols attribute defines vertical frames.
Each frame is indicated by <frame> tag and it defines which HTML document shall open into
the frame.
<!DOCTYPE html>
<html>
<head>
<title>HTML Frames</title>
</head>
<frameset rows = "10%,80%,10%">
<frame name = "top" src = "/html/top_frame.htm" />
<frame name = "main" src = "/html/main_frame.htm" />
<frame name = "bottom" src = "/html/bottom_frame.htm" />
<noframes>
<body>Your browser does not support frames.</body>
</noframes>
</frameset>
</html>
HTML Iframes
An HTML iframe is used to display a web page within a web page.
An inline frame is used to embed another document within the current HTML document.
<!DOCTYPE html>
<html>
<body>
</iframe>
</body>
</html>
Syntax
<iframe src="url" title="description"></iframe>
Example
<iframe src="demo_iframe.htm" height="200" width="300" title="Iframe Example"></iframe>
Example
<iframe src="demo_iframe.htm" name="iframe_a" title="Iframe Example"></iframe>
<html>
<head>
<title>iframe hyperlink</title>
</head>
<body>
<h1>
iFrame Hyperlinks
</h1>
</body>
</html>
Linked file:
<HTML>
<HEAD>
<TITLE>linked file</TITLE>
</HEAD>
<BODY>
<p>
</p>
</a>
</span>
</BODY>
</HTML>
HTML Forms
An HTML form is used to collect user input. The user input is most often sent to a server for
processing.
<!DOCTYPE html>
<html>
<body>
<h2>HTML Forms</h2>
<form action="/welcome.html">
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="Submit">
</form>
<p>If you click the "Submit" button, the form-data will be sent to a page called
"/welcome.html".</p>
</body>
</html>
file:///D:/ welcome.html?fname=John&lname=Doe
HTML Form Attributes
The Action Attribute
defines the action to be performed when the form is submitted
Usually, the form data is sent to a file on the server when the user clicks on the submit button.
Value Description
The default value is _self which means that the response will open in the current window
The Method Attribute
specifies the HTTP method to be used when submitting the form data.
The form-data can be sent as URL variables (with method="get") or as HTTP post transaction
(with method="post").
GET:
POST:
Appends the form data inside the body of the HTTP request (the submitted form data is
not shown in the URL)
POST has no size limitations, and can be used to send large amounts of data.
Form submissions with POST cannot be bookmarked
Tip: Always use POST if the form data contains sensitive or personal information!
When autocomplete is on, the browser automatically complete values based on values that the
user has entered before.
When present, it specifies that the form-data (input) should not be validated when submitted.
<input type="submit">
</form>
<input>
<label>
<select>
<textarea>
<button>
<fieldset>
<legend>
<datalist>
<output>
<option>
<optgroup>
The for attribute of the <label> tag should be equal to the id attribute of the <input> element
to bind them together.
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
</optgroup>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</optgroup>
</select>
Visible Values:
Use the multiple attribute to allow the user to select more than one value:
Users will see a drop-down list of the pre-defined options as they input data
The list attribute of the <input> element, must refer to the id attribute of
the <datalist> element
<input list="browsers">
<datalist id="browsers">
<option value="Internet Explorer">
<option value="Firefox">
<option value="Chrome">
<option value="Opera">
<option value="Safari">
</datalist>
HTML Styles - CSS
(CSS) is a style sheet language used for describing the presentation of a document written
in a markup language such as HTML or XML
With CSS, you can control the color, font, the size of text, the spacing between elements, how
elements are positioned and laid out, what background images or background colors are to be
used, different displays for different devices and screen sizes, and much more!
Using CSS
CSS is used to define styles for your web pages, including the design, layout and variations in
display for different devices and screen sizes.
The most common way to add CSS, is to keep the styles in external CSS files. However, in this
tutorial we will use inline and internal styles, because this is easier to demonstrate, and easier
for you to try it yourself.
Inline CSS
An inline CSS is used to apply a unique style to a single HTML element.
The following example sets the text color of the <h1> element to blue, and the text color of
the <p> element to red:
An internal CSS is defined in the <head> section of an HTML page, within a <style> element.
The following example sets the text color of ALL the <h1> elements (on that page) to blue, and
the text color of ALL the <p> elements to red. In addition, the page will be displayed with a
"powderblue" background color:
<head>
<style>
body {background-color: powderblue;}
h1 {color: blue;}
p {color: red;}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
External CSS
An external style sheet is used to define the style for many HTML pages.
To use an external style sheet, add a link to it in the <head> section of each HTML page:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
body {
background-color: powderblue;
}
h1 {
color: blue;
}
p {
color: red;
}
Text Color
<h1 style="color:Tomato;">Hello World</h1>
<p style="color:DodgerBlue;">Lorem ipsum...</p>
<p style="color:MediumSeaGreen;">Ut wisi enim...</p>
Border Color
<h1 style="border:2px solid Violet;">Hello World</h1>
CSS Backgrounds
to add background effects for elements.
background-color
background-image
background-repeat
background-attachment
background-position
background (shorthand property)
background-color: lightblue;
opacity: 0.3;
opacity property specifies the opacity/transparency of an element. It can take a value from 0.0 -
1.0. The lower value, the more transparent
CSS background-image
background-image: url("paper.gif");
CSS background-repeat
body {
background-image: url("gradient_bg.png");
background-repeat: repeat-x;
}
CSS background-position
used to specify the position of the background image.
body {
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
}
CSS background-attachment
specifies whether the background image should scroll or be fixed
body {
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
background-attachment: fixed;
}
CSS background-size
body {
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-size: 300px 100px; or
background-size: auto;
}
CSS Border
The CSS border property defines a border around an HTML element.
p {
border: 2px solid powderblue;
}
CSS Border Style
border-style property specifies what kind of border to display
p.one {
border-style: solid;
border-width: 5px;
}
border-width: 5px 20px; /* 5px top and bottom, 20px on the sides */
border-width: 25px 10px 4px 35px; /* 25px top, 10px right, 4px bottom and 35px left */
CSS Fonts
In CSS there are five generic font families:
1. Serif fonts have a small stroke at the edges of each letter. They create a sense of
formality and elegance.
2. Sans-serif fonts have clean lines (no small strokes attached). They create a modern and
minimalistic look.
3. Monospace fonts - here all the letters have the same fixed width. They create a
mechanical look.
4. Cursive fonts imitate human handwriting.
5. Fantasy fonts are decorative/playful fonts.
The second and third fonts are backups, in case the first one is not found
font-style: italic;
CSS Padding
The CSS padding property defines a padding (space) between the text and the border.
p {
border: 2px solid powderblue;
padding: 30px;
}
CSS Margin
The CSS margin property defines a margin (space) outside the border.
p {
border: 2px solid powderblue;
margin: 50px;
}
Dogstudio.co
Recapafteruse.co.uk
Styling Links
The four links states are:
a:link {
color: red;
}
/* visited link */
a:visited {
color: green;
}
/* selected link */
a:active {
color: blue;
}
img {
border-radius: 8px;
}
img {
border-radius: 50%;
}
Center an Image
To center an image, set left and right margin to auto and make it into a block element:
img {
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
}
h1 {
text-shadow: 2px 2px;
}
h1 {
text-shadow: 2px 2px red;
}
Multiple Shadows
h1 {
text-shadow: 0 0 3px #FF0000, 0 0 5px #0000FF;
}
div {
color: blue;
border: 10px solid currentcolor;
}
p.test1 {
white-space: nowrap;
width: 200px;
border: 1px solid #000000;
overflow: hidden;
text-overflow: clip;
}
p.test1:hover {
overflow: visible;
}
The word-wrap property allows you to force the text to wrap - even if it means splitting it in the
middle of a word:
p {
word-wrap: break-word;
}
CSS Word Breaking
The CSS word-break property specifies line breaking rules.
p.test1 {
word-break: keep-all;
}
p.test2 {
word-break: break-all;
}
p.test1 {
writing-mode: horizontal-tb;
}
span.test2 {
writing-mode: vertical-rl;
}
p.test2 {
writing-mode: vertical-rl;
}
div.a {
text-transform: uppercase;
}
div.b {
text-transform: lowercase;
}
div.c {
text-transform: capitalize;
}
CSS 2D Transforms
CSS transforms allow you to move, rotate, scale, and skew elements.
translate()
rotate()
scaleX()
scaleY()
scale()
skewX()
skewY()
skew()
matrix()
The translate() method moves an element from its current position (according to the
parameters given for the X-axis and the Y-axis).
div {
transform: translate(50px, 100px);
}
transform: rotate(20deg);
transform: rotate(-20deg);
The scale() method increases or decreases the size of an element (according to the parameters
given for the width and height).
transform: scaleX(2);
transform: scaleY(3);
The skewX() method skews an element along the X-axis by the given angle.
transform: skewX(20deg);
The skewY() method skews an element along the Y-axis by the given angle.
transform: skewY(20deg);
The skew() method skews an element along the X and Y-axis by the given angles.
The matrix() method combines all the 2D transform methods into one.
The matrix() method take six parameters, containing mathematic functions, which allows you to
rotate, scale, move (translate), and skew elements.
The rotateX() method rotates an element around its X-axis at a given degree:
#myDiv {
transform: rotateX(150deg);
}
The rotateY() method rotates an element around its Y-axis at a given degree:
#myDiv {
transform: rotateY(150deg);
}
The rotateZ() method rotates an element around its Z-axis at a given degree:
#myDiv {
transform: rotateZ(90deg);
}
CSS Transitions
CSS transitions allows you to change property values smoothly, over a given duration.
transition
transition-delay
transition-duration
transition-property
transition-timing-function
div {
width: 100px;
height: 100px;
background: red;
transition: width 2s;
}
div:hover {
width: 300px;
}
div:hover {
width: 300px;
height: 300px;
}
ease - specifies a transition effect with a slow start, then fast, then end slowly (this is
default)
linear - specifies a transition effect with the same speed from start to end
ease-in - specifies a transition effect with a slow start
ease-out - specifies a transition effect with a slow end
ease-in-out - specifies a transition effect with a slow start and end
cubic-bezier(n,n,n,n) - lets you define your own values in a cubic-bezier function
Transition + Transformation
div {
transition: width 2s, height 2s, transform 2s;
}
div {
width: 100px;
height: 100px;
background: red;
transition: width 2s, height 2s, transform 2s;
}
div:hover {
width: 300px;
height: 300px;
transform: rotate(180deg);
}
CSS Tables
Table Borders
Firstname Lastname
Peter Griffin
Lois Griffin
table, th, td {
border: 1px solid;
}
Full-Width Table
table {
width: 100%;
}
table {
width: 100%;
}
Using collapse:
table, td, th {
table {
width: 100%;
border-collapse: collapse;
th {
height: 70px;
}
or
table {
width: 50%;
}
By default, the content of <th> elements are center-aligned and the content of <td> elements
are left-aligned.
td {
text-align: center;
}
Vertical Alignment
The vertical-align property sets the vertical alignment (like top, bottom, or middle) of the
content in <th> or <td>.
By default, the vertical alignment of the content in a table is middle (for both <th> and <td>
elements).
td {
height: 50px;
vertical-align: bottom;
}
Table Padding
To control the space between the border and the content in a table, use the padding property on
<td> and <th> elements:
th, td {
padding: 15px;
text-align: left;
}
Horizontal Dividers
Add the border-bottom property to <th> and <td> for horizontal dividers:
Hoverable Table
Use the :hover selector on <tr> to highlight table rows on mouse over:
Striped Tables
For zebra-striped tables, use the nth-child() selector and add a background-
color to all even (or odd) table rows:
tr:nth-child(even) {background-color: #f2f2f2;}
Add a container element (like <div>) with overflow-x:auto around the <table> element to
make it responsive:
<tr>
<th>First Name</th>
<th>Last Name</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
</tr>
</table>
</div>
CSS Lists
HTML Lists and CSS List Properties
In HTML, there are two main types of lists:
unordered lists (<ul>) - the list items are marked with bullets
ordered lists (<ol>) - the list items are marked with numbers or letters
ul.a {
list-style-type: circle;
}
ul.b {
list-style-type: square;
}
ol.c {
list-style-type: upper-roman;
}
ol.d {
list-style-type: lower-alpha;
}
ul {
list-style-image: url('sqpurple.gif');
}
"list-style-position: outside;" means that the bullet points will be outside the list item. The start
of each line of a list item will be aligned vertically. This is default:
"list-style-position: inside;" means that the bullet points will be inside the list item. As it is part
of the list item, it will be part of the text and push the text at the start:
ul.a {
list-style-position: outside;
}
ul.b {
list-style-position: inside;
}
Remove Default Settings
The list-style-type:none property can also be used to remove the markers/bullets. Note that
the list also has default margin and padding. To remove this, add margin:0 and padding:0 to
<ul> or <ol>:
ul {
list-style-type: none;
margin: 0;
padding: 0;
}
ul {
list-style: square inside url("sqpurple.gif");
}