• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

esp32 HTML and CSS Basics

Q&A Forum › Category: ESP32 › esp32 HTML and CSS Basics
0 Vote Up Vote Down
x3mvz5pl5g5k asked 6 years ago

I am getting the following error when trying to upload the code for this section:

Arduino: 1.8.10 (Windows 10), Board: "DOIT ESP32 DEVKIT V1, 80MHz, 115200, None"

ESP32_Bluetooth_Classic_with_Arduino_IDE_-_Getting_Started_-_Ra:15:25: error: stray '#' in program
background-color: #4CAF50;
^
ESP32_Bluetooth_Classic_with_Arduino_IDE_-_Getting_Started_-_Ra:25:25: error: stray '#' in program
background-color: #555555;
^
ESP32_Bluetooth_Classic_with_Arduino_IDE_-_Getting_Started_-_Ra:1:1: error: expected unqualified-id before '<' token
<!DOCTYPE html>
^
ESP32_Bluetooth_Classic_with_Arduino_IDE_-_Getting_Started_-_Ra:14:5: error: expected unqualified-id before '.' token
.button {
^
ESP32_Bluetooth_Classic_with_Arduino_IDE_-_Getting_Started_-_Ra:24:5: error: expected unqualified-id before '.' token
.button2 {
^
ESP32_Bluetooth_Classic_with_Arduino_IDE_-_Getting_Started_-_Ra:27:3: error: expected unqualified-id before '<' token
</style>
^
exit status 1
stray '#' in program

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Question Tags: CSS, ESP32, html
2 Answers
0 Vote Up Vote Down
DK answered 6 years ago

hi

is your html code inside?

const char index_html[] PROGMEM = R"rawliteral()rawliteral";

example

const char index_html[] PROGMEM = R"rawliteral(
<!DOCTYPE HTML>
<html>
<head>
  <title>Hello World</title>
  <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body { background-color: #4CAF50; } </style>
  </head>
<body>
</body>
</html>)rawliteral";
0 Vote Up Vote Down
Sara Santos Staff answered 6 years ago

Hi.
Can you share your code with us?
Are you trying to upload the code in that section to Arduino IDE?
The code given in that section is pure HTML. It will not work directly on Arduino IDE.
You need to follow the next unit “HTML in Arduino IDE” to learn how to include the HTML text on Arduino IDE to build the web server.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.