Should You Learn HTML Before PHP?

Wondering which web development language to start with? We’ve written this no-B.S. guide to help.

Published Categorized as Web & Code

Here’s the situation: You want to become a web developer and you’ve set aside the time to learn HTML/CSS and PHP. But you’re not quite sure where to start.

So you googled the question and stumbled upon this site. Well, it’s good that you stopped by! Because in a moment, we’re about to discuss exactly that.

Let’s get right into it.

What Is HTML/CSS?

HTML and CSS are client-side languages for structuring the information on web pages and giving those web pages a particular look and feel. If you want to have anything to do with web development, you need at least a basic understanding of HTML/CSS.

A client-side language, if you’re coming across the term for the first time, is a language that’s executed on the client side. In the case of HTML/CSS, the client side is the browser on the user’s computer, tablet, or phone.

HTML is a markup language. It works by wrapping regular text into HTML elements, called “tags”, that indicate the parts of a page they belong to (say, an article, a sidebar, a heading, a paragraph, and others).

CSS is a stylesheet language. It targets the HTML elements on a web page with CSS rules that determine their appearance through CSS properties. For example, if you assign the property font-size: 16px to all paragraph tags, they will have a font size of 16 pixels.

Technically, neither HTML nor CSS are programming languages. They tell web browsers important information about the structure and appearance of web pages, but they don’t allow you to develop web apps per see.

In other words, with HTML/CSS you can create static sites. You know, the kind that appears the same to every visitor—and doesn’t change unless you make edits to it.

That doesn’t mean you shouldn’t master these two languages, though, and we’ll get into why that is in a minute or two.

What Is PHP?

Some of the most visited websites in the world, including Etsy and Wikipedia, are written in PHP. The same is true for many of the most popular platforms for building websites and online stores, including WordPress and Magento.

PHP is a server-side scripting language and one of the most widely used programming languages in web development. If you want to become a full-stack web developer or a backend web developer, then you absolutely have to learn PHP.

A server-side language is a language that runs on the web server. When the web server receives an HTTP request, it executes the code and produces an output. In the case of PHP, that output is an HTML document that gets displayed in the website visitor’s browser.

PHP allows you to create dynamic websites and web applications whose content is dynamically generated based on predefined logic.

Which Should You Learn First?

You don’t need to know PHP to learn HTML/CSS, just as you don’t need to know HTML/CSS to learn PHP. So it’s only natural to wonder… which of these languages should you learn first?

Since HTML, CSS, and PHP are all languages used in web development, it’s a good idea to learn HTML/CSS before you learn PHP. This will give you a good foundation because, in a real-world project these, languages can interact in many different ways.

For example, you can use PHP to dynamically generate HTML elements (and their contents) and CSS rules (and the values of their properties). If you already have an understanding of HTML/CSS, you will be able to handle these kinds of tasks more easily.

Don’t miss: How to Use CSS With PHP

What Else Should You Learn?

Knowing Git and the basics of version control is a non-negotiable.

These days, it’s almost impossible to find a website development project that doesn’t require JavaScript.

JavaScript, a client-side scripting language, is useful when you want to create a dynamic web page, but prefer the instructions that make this possible to be executed in the user’s browser rather than on the server.

As you are learning client-side web development, you will probably want to familiarize yourself with the tools of the trade, including the HTML5 boilerplate, reset.css and normalize.css, and one or more of the most popular HTML/CSS/ JS frameworks, be it Bootstrap or Foundation.

When learning server-side development, consider going beyond vanilla PHP and mastering one of the most popular PHP frameworks, such as Zend or Symfony, which can take your work (and your code, and your PHP websites and web applications) to the next level.

In Conclusion

It isn’t really necessary to learn HTML before PHP, and vice versa. That said, we think it makes sense to know the basic client-side languages for building websites before turning to more advanced programming languages for server-side web development.

So if you’re looking for advice, take the time to understand how HTML, CSS, and JavaScript work, then dive deep into server-side development with PHP.

Up next: Check out our tutorials on HTML, CSS, JS, and PHP!

By Dim Nikov

Editor of Maker's Aid. Part programmer, part marketer. Making things on the web and helping others do the same since the 2000s. Yes, I had Friendster and Myspace.

Leave a comment

Your email address will not be published. Required fields are marked *