Read a css file on my webServer

Hi !

Firstly, I’m using a FezHydra device.

I created a web serveur based on an idea derived from this project:

My server run my html page.
but the line:

doesn't work :(

I don’t know how my html can read my css.

I read in many subject that I need to place my css file in MicroSdCard.

I did it. I can read file but I don’t know what to do after…

I looked for answers in this project but it’s very difficult for me. I didn’t find what I want.

exactly I’m not sure that my line <link href … send a request to load the project css

When I click on my link I have a web page with HTTP/1.0 404 Page introuvable
source is

You can open “Developer Tool” F12 in IE or Chrome and monitor all the request that are done behind the scene. I am sure there is 404 for css.

As andre.m said your server has to serve that resources when it asked for it. Means you have to include the css file in one form or another to your device and return it when the server is asked for it.

For me css on EMX work ok(On NET 4.1 FW). I have files(css and images) on SD card in folder:

In HTML(loaded from Resources) I use next code:

		<link rel="stylesheet" href="/css/style.css" type="text/css">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">



To start WEBServer you just simply add virtual directory and load pages like this:

web_server = new WEBServer(http_port);
web_server.AddVirtualDirectory("/", _root_directory + "\\http", true);
//Load pages

I think that your problem is missing / in href to css :slight_smile:

this is my error:

La feuille de style n’a pas été chargée car son type MIME, << text/html>>, n’est pas <<texte/css>>

fr > eng translation …

style sheet didin’t be loaded because it’s type MIME, << text/html>>, is not <<texte/css>>

Interesting article descripting use of css in Web server :