Webserver with SD CSS error

Hello everyone, i am building a webserver. Webserver works. It also works with SD card. My problem is when I am trying to connect html with CSS. This is not working.

HTML page does not understand that there is CSS in another file.

I have attached the files.

<html>
<head>
	<title>IEEE Office</title>
	<link rel="stylesheet" type="text/css" href="theme.css">
</head>
<body>
	<h1 align="center">IEEE University of Ioannina Student Branch</h1>
	

	<h3>this page is under construction.</h3>
</body>
</html>
body {
	background-color: black;
	color: green;
}

HTML page does not understand that there is CSS in another file.

Or, more likely, you are not serving up the CSS properly when the client asks for it.

This server code will do what you want. It will serve htm, css, js, jpg, gif, ico, etc.
http://playground.arduino.cc/Code/WebServerST

Here it is in operation.. It’s been running a few days online now. Still has all sockets available.

edit: The main page (index.htm) downloads a css, a js, and a favico.ico file.

The waterfall page (testhtml.htm) downloads a css doc, and a favico.ico file. The css doc downloads the waterfall background image.

The soccer page (soccer.htm) downloads just a jpg image and the favico.ico file.

Which is the easiest way to display values of digital pins that i read with arduino from some sensors? Lets say that i read the temperature and i want to display it in a html website. How can i combine the arduino code and the html code that it saved in the SD card?

tahnk you

xmarkx: Which is the easiest way to display values of digital pins that i read with arduino from some sensors? Lets say that i read the temperature and i want to display it in a html website. How can i combine the arduino code and the html code that it saved in the SD card?

tahnk you

You would need to add a simple version of PHP to that code to add the pin state to your page..

and the html code that it saved in the SD card?

The html data stored on the SD card is NOT code.

You should have two files - one containing the part that goes before the live data and one that goes after. Send the contents of the first file. Send the live data, in html tags. Send the contents of the second file.

After some research I think that the best way of setting up a webserver is by serving a JSON string and the application have some way of decoding the string. Whats your opinion about this?

Whats your opinion about this?

That it's nonsense. I hate JSON. Too hard to format correctly; too hard to parse. XML is a lot simpler, but neither is really appropriate.