P
P
Pinkman2021-12-17 20:12:25
Web servers
Pinkman, 2021-12-17 20:12:25

How to connect css to html page on your Http Server?

I am writing my own http server. I wrote my own get method, but I still don’t understand how to pass css to the html page?
Do I need to send two responses? One with html and one with css? Or somehow differently? If there are two answers, then what should the http-header look like?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wataru, 2021-12-17
@wataru

If the styles are not built directly into the html file, then css is just a resource on the server, like an html page, like pictures or js scripts. The browser itself makes a request to the address specified in the Html tag on the page. The server should only return the correct mime type for the file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question