Websites are coded in html, styled with css, and made dynamic/interactive with javascript.
When you right click on a Web page, such as the one you are reading now, and select View Source you can see the html, css and javscript that your browser reads in order to display the page.
Anyone can learn about these technologies and a good starting point would be Mozilla Developer Network (MDN for short) where they have all sorts of documentation on how to get started and what is the state of the art.
Of course, there is a lot more to it but if you just copied/pasted some files on a Web server and it worked this is all you need to know for now.