Hello, I was wondering if I could put html and css in a Ethernet web server page? Everything I have found online has an external html page in an SD card. I can not find an example of something like this to get me started. I’m asking the community to help me to find an example like this if there is one? I honestly through a while ago I saw one. I can not find it again , or maybe I’m phrasing it wrong in online search. Thank you for any help.
it's build on the IDE Example but checks the incoming request and serves the right side.
So it should be easy to add a separate resource which serves another HTML page (or CSS, or JS...).
Thank you very mcuh @horace and @noiasca This will help me a lot. I don't know why I could not find this online. I'm not sure if I'm phrasing it wrong or what. I do have one last Question. Is it possible to add a some CSS and javascript to the page in this way to get things lined up on the page the way I like?
Hello, I have added html to my project in the webserver. Everything is great. I even did a background color change. However When I try to load some css say for the hr to break line there that works. But I can not add no width or height for the thickness to it. So I decided to leave that out. It would of been nice to add the hr break lin to it. Thank you again.
I put it the css style all in one line.
client.println("hr.new5 {border: 10px solid green;border-radius: 5px;}");
That seems to be okay. what is not okay is this one.
client.print("<hr class="new5">"); I now get an error from this one.
unable to find string literal operator 'operator""new5' with 'const char [12]', 'unsigned int' arguments
client.print("<hr class="new5">");
PS the html structure of your output is not correct.
For example you start the body before you have closed the head.
Further more you define "HTTP/1.1" but you don't provide a content-length - so it is HTTP/1.0 only
fix your HTML, copy paste the generated HTML with an HTML checker.
For example with Ready to check - Nu Html Checker you can just upload ("text input") your generated HTML and will get tons of advices how it improve the HTML.
I got it. I have been reading onthe site. A lot I don't understand and some I do. I will try to keep an eye on what I'm adding or taking out. But you are right the more you add the slower it will get.