The first thing you have to understand is that there are 2 sides to any non-trivial web application:
• Client Side.
• Server Side.
The client side stuff is what the server hands to the web browser to display and execute. That is primarily HTML, CSS and JavaScript. (There are other things, such as Flash, Client side Java, and Silverlight. But you can ignore those for now).
One simple way to create a web site is to write an HTML file, a CSS file and a JavaScript file, and simply have the server send the contents of those files to the client. It is very simple: The server reads the files, and sends them to the client (the web browser) byte for byte.
But in the real world, it gets harder than that. Think about the very simple case where you want users to register and log in to your site. And you want to display the users name on the top of the page once they are logged in. Now it isn't so simple. You certainly aren't going to create a brand new HTML page for every user, right?
That is where server side programming comes into play. Instead of sending a simple, static HTML page, you now need to *inject* stuff into the HTML code. Things like the users name. Or in a more complex example, the contents of a user's shopping cart.
There are quite a few programming languages out there that work well for the server side code.
C# (or any other .NET language) is an excellent choice here. But it comes with a cost: It is a Microsoft proprietary language. You may have to pay money to use it on a real web site.
Java is also a viable choice. But it isn't the greatest language for doing this. Java is getting a bit old, a bit behind the times. But it does work here.
Most beginners turn to PHP, because it is free and widely supported. That is sort of unfortunate, because as programming languages go, PHP is just plain gawd-awful. And if you just blindly follow the bazillion and 1 tutorials on the internet, you stand a really good chance of creating a web site with serious security problems. Hackers ***LOVE*** php based sites created by amatuers. Java or .NET based sites, not so much.
For every major web site (sites like Facebook, Yahoo, Amazon, etc.) the HTML/CSS/Javascript code is just a tiny piece of the iceberg. The vast majority of lines of code on any of these sites is the server side stuff.
HTML and CSS are not real programming languages. They are Markup languages...languages that only dictate how content should be displayed. JavaScript is a real programming language. And an interesting, non-trivial one at that. But the server side is where all the interesting stuff happens.