I am creating a website, where users can upload their own videos. So far I am just building the main structure with HTML and CSS. Is it a better practice to write server-side code before the site layout is finished? Does it not make a difference?
Designing the client side first with mocking can give you a strong advantage in knowing your website's functionality. You can keep redesigning with minimal waste until you reach a good workflow for your product. However, you should keep a rough sketch of server side requirements for each bit of functionality you'll need from the design so that you don't create a cool concept that is really hard or impossible to implement.
Also, I would keep small details in the website design flexible so that they can be adjusted to make the backend easier, more scalable or the whole website more testable.
In practice as a sole developer, I tend towards simultaneous implementation, working on the project feature by feature. I'll design a feature in the backend and then tie it into the front end UI. I then receive feedback on the work thus far before rolling onto the next feature, although there tends to be way more focus on various UI concerns over functionality.
This is where working with a Web designer can come in really handy. With a good design, you can start working on the server-side code without having any client side code written. Having a visual aid -- the design -- can give you a strong idea of what the server-side code will need to do, and most importantly, it can help you implement the server-side code in a manner that doesn't tightly couple it to the front-end.
There is a technique that is gaining popularity where developers use JSON and RESTful Web services as a way to separate the front-end and back-end code in a manner where one could develop a completely separate user interface that uses the same exact stable, tried and tested back-end.
However, I don't think it makes a difference whether you start with a top down approach where you build all of the HTML/CSS first and then work on the server-side code or whether you start with the server-side code and then work on the client-side, as long as you have a clear vision for what the application will look like and what it will need to do.
Having a clear vision will help you make sure to code out the server-side in a manner that makes it easier to maintain the code and easier to build something that's extensible.