-->
Page 1 of 1

ESP8266 HTML works ok - cant CSS inline

PostPosted: Wed Sep 23, 2015 1:37 am
by Gallup
This works in the Arduino (IDE) in a web page for ESP8266

String form =
"<p>"
"<CENTER>"
"<H1> This is my web page title <h1>"
"<HR>"
"<HR>"
"<H2> Smaller text <h2>"
"</CENTER>";
Here is a sample of inline CSS:
"<H2 style="color:red;background:black;">This is a red heading with a black background<H2>"
I am unable to make the C++ IDE interpret that line like it is. Is there a solution?

Re: ESP8266 HTML works ok - cant CSS inline

PostPosted: Wed Sep 23, 2015 12:37 pm
by martinayotte
Gallup wrote:"<H2 style="color:red;background:black;">This is a red heading with a black background<H2>"

You need to escape the dougle-quote inside the string ...
it should be :
Code: Select all"<H2 style=\"color:red;background:black;\">This is a red heading with a black background<H2>"