What is the different between HTML CSS PHP and JavaScript?

What is the different between HTML CSS PHP and JavaScript?
That's a good question. It's very important to understand this different before starting to develop any website. So let's dive in:

HTML - it's like bones for your site. It says what to display on the user's browser: Tables, titles, paragraphs, lists, links etc. It is client-side language which is understood by browsers like Google Chrome, FireFox, Safari.







CSS - these are design rules. It says to the browser how to display HTML elements. Defines font size, color, table's border, link's color etc. It is client-side language which is understood by browsers like Google Chrome, FireFox, Safari

JavaScript - these are dynamics of the web. Javascript can change HTML/CSS accordingly to user's actions. Some of dynamics can be done with CSS too, but generally all dynamics are done in JavaScript. JavaScript can make alert boxes, confirm boxes, reloading pages, redirect user to another page, add or remove some HTML elements, change CSS rules etc. It is client-side language which is understood by browsers like Google Chrome, FireFox, Safari.

PHP - this code stays in the server and is compiled by server, then sent to user like HTML/CSS/Javascript. It is used for any logic, which you do not want to show to every user of the site. It takes action for files uploading, creating logged in sessions, connecting to databases and fetching data from there and many many other server-side things. This is server-side language which is understood by php server, browsers do not know anything about PHP, that's why it lays in server and server gives the response to the browser in HTML/CSS/JavaScript. This can be replaced by JavaScript while JavaScript is so much faster for I/O based backends where I/O is main lag, not CPU.

Please ask your IT question in comments!

1 comment:

You can ask IT questions in comments!