Вы находитесь на странице: 1из 5

The difference between HTML, CSS,

JavaScript and PHP languages


Posted on February 19, 2015

HTML

HTML was invented in 1990 by a scientist called Tim Berners-Lee. The purpose was to make it
easier for scientists at different universities to gain access to each other’s research documents.
The project became a bigger success than Tim Berners-Lee had ever imagined. By inventing
HTML he laid the foundation for the web as we know it today.

HTML is constantly undergoing revision and evolution to meet the demands and requirements
of the growing Internet audience under the direction of the W3C, the organisation charged with
designing and maintaining the language.

THEN, WHAT IS HTML? It is a markup language for describing web documents (web pages).
HTML stands for Hyper Text Markup Language. A markup language is a set of markup tags.
HTML documents are described by HTML tags. Each HTML tag describes different document
content. You use HTML to create the actual content of the page, this means in HTML you
define the basic structure and the contents of a website. It is simply a format that allows you to
specify certain ways to display information on a page.

HTML consists of a series of short codes written in “tags” into a text-file by the site author,
which are types of a structure that are written between opening and closing brackets. The tags
are what separate normal text from HTML code. You might know them as the words between
the <angle-brackets>. Tags can be used to make links, format text, build the page layout and
more. For instance this bold link is made of HTML code that looks like this: <strong>this bold
link</strong> is made of HTML code. Different tags will perform different functions. The tags
themselves don’t appear when you view your page through a browser, but their effects do. The
text is then saved as a html file, and viewed through a browser. You can use anything from a
rudimentary text-editor to a powerful graphical editor to create HTML pages.

If you want to make websites, there is no way around HTML. Even if you’re using a program to
create websites, such as Dreamweaver, a basic knowledge of HTML can make life a lot simpler
and your website a lot better. The good news is that HTML is easy to learn and use. In just two
lessons from now you will have learned how to make your first website. Complete websites can
be built out of pure HTML and text, but they wouldn’t be very attractive looking, so we use CSS
to style them.

HTML and JavaScript are two completely different things. HTML is a markup language
designed for defining static web page content. JavaScript is a programming language designed
for performing dynamic tasks. Sometimes the distinction is confusing because JavaScript code
can go in the same file as HTML.

CSS

CSS was first developed in 1997, as a way for Web developers to define the look and feel of
their Web pages. It was intended to allow developers to separate content from design so that
HTML could perform more of the function that it was originally based on – the markup of
content, without worry about the design and layout. CSS didn’t gain in popularity until around
2000, when Web browsers began using more than the basic font and color aspects of CSS.
Web Designers that don’t use CSS for their design and development of Web sites are rapidly
becoming a thing of the past.

THEN, WHAT IS CSS? Cascading Style Sheets, or CSS, allow you to specify things like the
font you want on your page, the size of your text, whether the page is to have 2 columns,
whether your text is to be in bold or italics, and so on. In other words, it is the part that lets you
control the appearance of your web page. CSS is responsible for the Design of the Webpage,
how every thing looks, and where it is on the page. (CSS) dictate your website’s look and feel.
Font size, font color, font type, styling around images, page layout, mouse-over effects, colors,
margins, lines, height, width, background images, advanced positions and many other things
are all determined by CSS.
If HTML is a house, with the structure (walls, roof, etc) and contents, like furniture, CSS is the
color of the paint, the size of the rooms and the ornamentation. CSS is used on a website to
make the design. Ok, so with HTML we make our webpage and CSS allows us to style it. CSS
revolutioned the world of web design!

JAVASCRIPT

JAVASCRIPT is a scripting language and was first implemented by Netscape Communications


Corp. in Netscape Navigator 2 beta (1995).

THEN, WHAT IS JAVASCRIPT? JavaScript is the most popular programming language in the
world, used to make web pages interactive. JavaScript support is built right into all the major
web browsers, including Internet Explorer, Firefox and Safari. So, it runs on your visitor’s
computer and doesn’t require constant downloads from your website. Provided that the visitors
to your site are using web browsers that support JavaScript (most do) and have JavaScript
enabled (it is by default), then your JavaScript will run when they visit the page.

JavaScript is not a programming language in strict sense, is most commonly used as a client
side scripting language, that is, a lightweight programming language that is interpreted by the
browser engine when the web page is loaded (JavaScript codes are written into an HTML
page.) When a user requests an HTML page with JavaScript in it, the script is sent to the
browser and it’s up to the browser to do something with it. Javascript can dramatically improve
the content of a website. There are a number of different places where JavaScript can be used
but the most common place to use it is in a web page. In fact for most people using JavaScript,
in a web page is the only place where they use it.

Creating a clock using Javascript: javascript clock

1 <!doctype html>
2 <html>
3 <head>
4 <meta charset=”utf-8″>
5 <title>Untitled Document</title>
6 <script type=”text/javascript”>
7 // 1. Created the function
8 function updateClock ( )
9{
10 // 2. Created some variables
11 var Time = new Date ( );
12 var Hours = Time.getHours ( );
13 var Minutes = Time.getMinutes ( );
14 var Seconds = Time.getSeconds ( );
15
16 //3. If needed, add Zeros to single intergers
17 Minutes = ( Minutes < 10 ? “0” : “” ) + Minutes;
18 Seconds = ( Seconds < 10 ? “0” : “” ) + Seconds;
19
20 //4. IF Else logic for choosing “AM” or “PM”
21 var timeOfDay = ( Hours < 12 ) ? “AM” : “PM”;
22
23 //5. Change from Military time to 12-hour format
24 Hours = ( Hours > 12 ) ? Hours – 12 : Hours;
25
26 //6. If Hour time is 0, change it to 12
27 Hours = ( Hours == 0 ) ? 12 : Hours;
28
29 //7. Final Clock output
30 var currentTimeString = Hours + “:” + Minutes + “:” + Seconds + ” ” + timeOfDay;
31
32 //8. Function to display current time
33 document.getElementById(“clock”).firstChild.nodeValue = currentTimeString;
34 }
35 </script>
36 </head>
37 </head>
38 <!—9. Update clock every 1000ms or one second—>
39 <body onload=”updateClock(); setInterval(‘updateClock()’, 1000 )”>
40 <span id=”clock”>&nbsp;</span>
41 </body>
42 </html>

JavaScript adds interactivity to Web pages and creating Web applications.It is often used to
create polls and quizzes, and if you command an image to be replaced by another one,
JavaScript tells the browser to go do it. Because the browser actually does the work, you only
need to pull some strings by writing some relatively easy lines of code. Do you need a clock or
date on your site? Dancing bears and hula girls? That’s what makes JavaScript an easy
language to start with.

PHP

PHP was originally an acronym for Personal Home Pages, but is now a recursive acronym for
PHP: Hypertext Preprocessor. Originally developed by the Danish Greenlander Rasmus
Lerdorf, and was subsequently developed as open source. PHP is not a proper web standard –
but an open-source technology. PHP is neither real programming language – but PHP lets you
use so-called scripting in your documents. To describe what a PHP page is, you could say that
it is a file with the extension .php that contains a combination of HTML tags and scripts that run
on a web server.

On a server side and just before a page is delivered to the client browser, PHP makes it
possible to create pages that changes depending on the data given to PHP, for example you
can show a different page to people from different countries or you can show a different page
depending on what was posted recently on the page. PHP is a server-side scripting language
designed for web development but also used as a general-purpose programming language.
PHP is what makes your website do stuff and works like this: A PHP script runs on the server
and can alter or generate HTML code at will. An HTML web page is still delivered to the
browser, which doesn’t know or care that PHP is involved in tweaking the HTML on the server.
PHP is the code that is used to interface with the database. The power of having all of the
content stored in a database means that you can switch out themes and code to radically
change the design of a website while maintaining the same content. PHP gives you the
freedom to add advanced features to your website. PHP can be used in many contexts –
discussion forums, polls, shops, SMS gateways, mailing lists, etc. The only limitation with what
you choose to do with PHP is your imagination.

Вам также может понравиться