Professional Documents
Culture Documents
In this task I will investigate clientside customisation of web pages, which will
include the three assignments in which I will be creating informative documentation
of the features of cascading style sheets, I will also create informative
documentation on the feature of scripting languages, and finally plan and design a
website on a scenario set by my tutor.
Features of CSS
In this assignment I will be explaining, the features of CSS, why we use it, and
different ways it can be used. CSS is an acronym for Cascading Style Sheets. CSS is
a stylesheet language which describes the presentation of documentation which
can be in HTML or XML formats. It describes how web elements can be rendered on
screen. CSS was first released in 1996, as a product of the W3C; Which is the source
of all web design and the standards used globally. Since the original CSS1 was
published there have been two more updates provided by W3C, CSS2 which was
released in 1998 and CSS3 released in 1999. CSS is commonly used more than
other languages as it allows you to choose specific styles for visual web elements.
Unlike HTML, CSS offers unique advantages in making a website look more
professional and better. There are 3 Stylesheets which are used in CSS; External,
Internal and Inline/Embedded. They are explained below. Other than this different
selectors, and the box model are also explain.
External Stylesheet
The external stylesheet is a .css format file which you are able to link your file to. Whatever you
write in your stylesheet will affect every page in your website. The external stylesheet is used
when all pages need to be the same colour, or all font needs to be the same colour on separate
pages, instead of making code changes on each page. An example of how External CSS is
used is shown below.
<head>
<link rel=stylesheet type=text/css
href=mystyle.css>
</head>
The page must link to the stylesheet using the <link> tag
body {
background-color:grey;
}
h1 {
color:navy;
margin-left:20px;
}
Some advantages of External Stylesheets include you can control the look of
multiple documents at once, rather than flipping through it to make small changes
such as font size and colour. You can also group styles, which provides more control
and flexibility.
Internal Stylesheet
This stylesheet holds the CSS code for the web page in the head section of the code, which
then makes it a lot easier to apply styles. In internal the code is easily reusable. An example of
how Internal CSS is used is shown below.
<head>
hr {color:black;}
p {margin-left:20px;}
body {background-color:lightblue;}
</style>
</head>
The advantages of using internal CSS, are that it is useful for small style definitions which are
for a single document, thus making it simpler as you don't need to worry about styles applied to
wrong pages. Another advantage is that if you design a large system, you can use the internal
stylesheet as a testing perspective, you can also include the CSS code in the head section and
test it on a trial and error basis.
Inline Stylesheet
The inline stylesheet uses the HTML style attribute to style a specific tag, to use the attribute
you can contain any CSS properties. An example of how Inline CSS is used is shown below.
<p style =color:red;margin-left:20px> This is a paragraph.</p>
is shown as This is a paragraph.
Advantages of Inline Stylesheets are that they can be applied quickly, there isn't an addition file
which needs to be created, therefore you can manage styles within a single document.
The CSS Box Model
The box model consists of 4 parts.
- The content
- The padding
- The border
- The margin
The content of the box is where the text and images are placed, whilst the padding is the
transparent area around the content of the box, the border is the part which goes around the
padding and content, the margin is the other transparent area which is around the border. The
code which would be used to make a box model is shown below.
<style>
div {
background-color: grey;
width: 300px;
padding: 25px;
border: 25px solid navy;
margin: 25px;
}
</style>
</head>
<body>
<h2>The Box Model</h2>
<p>The Box Model consists of 4 parts</p>
<div>My name is Uzair Siddiqui</div>
</body>
This would be shown as:
Selectors
Type Selector
type selector selects the type of element which matches the selector, e.g.
em {color: blue; }
will select all em elements and change their color to blue
ID Selector
ID selectors use an element based on the ID attribute to select a specific element, e.g.
<style>
#para1 {
text-align: center;
color: red;
}
</style>
</head>
<body>
<p id="para1">Hello World!</p>
<p>This paragraph is not affected by the style.</p>
Class Selector
The selector selects all elements with the class attribute, e.g.
.center {
text-align: center;
color: green;
}
</style>
</head>
<body>
<h1 class="center">Green and center-aligned heading</h1>
<p class="center">Green and center-aligned paragraph.</p>
Will be shown as
Using Scripting
In this report, I will be explaining what scripting languages are, how it works in a
webpage, which types of scripting languages are available; The main features of
that particular scripting language, and three of the typical uses of the specific
scripting language. Last but not least, without a scripting language how a HTML
would look; and finally, how websites that use scripts would be implemented by two
different browsers.
Scripting Languages
easy to learn and understand especially for those with experience in C, HTML and
JavaScript. The language is very similar to Perl and C, therefore anyone with
experience in the following, will feel comfortable understand PHP. PHP runs all
platforms such as UNIX, Macintosh, Windows, etc. Another main feature of PHP is its
connective abilities; It uses a modular extension system which can interface with a
range of XML, graphics, encryption, etc. in its library. Programmers can then
extended PHP by creating their own executables and load them with PHPs dynamic
loading mechanisms or compile them into the executable. For malicious attacks,
PHP has many levels of security to make viruses as preventable as possible. The
levels can also be adjusted in the .ini format file.
JavaScript
JavaScript can be used in many different ways, I will describe of the features which
are available with JavaScript, which wont be available with others. One of the
features I will be reviewing the hover feature; if you hover over an element
whether it be a paragraph, a heading, or a different element, you can hover over it
with the cursor, and can program it to change colour/dim/change the image, etc. To
hover over an element and for everything else to be dimmed, you would add this
code:
$('.link').hover(function(){
$('.dim').fadeIn(200);
},function(){
$('.dim').fadeOut(200);
});
This feature is clearly shown in this website: http://mikekus.com/
Another feature I will be explaining is the animation feature, unlike other scripting
languages with JavaScript you can add animations, a framework usually handles
the animation, the animation is implemented as changing of the Document Object
Model (DOM) styles or objects. The process is split into segments, and each
segment is timed, due to the interval being very short, the animation gives the
illusion of repeatedly playing. The pseudo code is:
var id = setInterval (function()
/* show the current frame */
if (/* finished */) clearInterval (id)
}, 10)
#draggable { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px
10px 10px 0; }
#droppable { width: 150px; height: 150px; padding: 0.5em; float: left; margin:
10px; }
</style>
<script>
$(function() {
$( "#draggable" ).draggable();
$( "#droppable" ).droppable({
drop: function( event, ui ) {
$( this )
.addClass( "ui-state-highlight" )
.find( "p" )
.html( "Dropped!" );
The best websites are best due to the type of scripting language they use. If there is
no scripting language the functionality of the website would be very bad, a typical
website has 3 clicks to get from the homepage to the homepage the user needs to
get to, an example of this is the JD Sports website (Home>Mens Shoes>The shoe
you need).
Without JavaScript on a website the website would be testing the limits of HTML,
and wouldnt be very static.
A great example of this is http://tyrocleaners.co.uk/. If only HTML wasnt used, and
JavaScript was added the features of the website could increase drastically. The
home page could have animated icons, videos, animations, etc. The images on the
header could be re-sized, or better yet changed. The font could also be changed,
through google fonts, the navigation bar could also be a lot more static. My
conclusion is that without JavaScript the website would not be very well presented,
and would look very cheap.
References:
Unknown. (Unknown). CSS How to. Available: http://www.w3schools.com/css/css_howto.asp.
Last accessed 3rd Oct 2015.
Unknown. (Unknown). HTML Styles. Available:
http://www.peoi.org/Courses/Coursesen/html/html16.html. Last accessed 3rd Oct 2015.
Raad. (2013). Explain the features of the box model for CSS.Available: http://raadassignment2.blogspot.co.uk/2013/06/unit-20-p2-explain-features-of-box.html. Last accessed
3rd Oct 2015.
Jai Pearce. (Unknown). Features. Available: http://ictjaicss.weebly.com/p2---css-boxmodel.html. Last accessed 3rd Oct 2015.