Hi Jimmo,
I don't use a web server just html code see below :
Code: Select all
html = """
<!DOCTYPE html>
<html>
<head>
<title>Phlox Web Server</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="data:,">
<style>html{font-family: Helvetica; display:inline-block; margin: 0px auto; text-align: center;}
img{margin-bottom:40px;}
h1{color: #0F3376; padding: 2vh;margin-top:40px;margin-bottom:40px;}
h2{margin-top:40px;margin-bottom:40px;}
li{margin-top:40px;margin-bottom:40px;}
p{font-size: 1.5rem;}
.button{display: inline-block; background-color: #e7bd3b; border: none; border-radius: 4px; color: white; padding: 16px 40px; text-decoration: none; font-size: 30px; margin: 2px; cursor: pointer;}
.button2{background-color: #4286f4;}</style>
</head>
<body>
<h1>PHLOX Web Server</h1>
<img src="logo.jpg" alt="logo Phlox">
<li><a href="#Res">RESEAU</a> ;</li>
<br>
<li><a href="#Lum">GESTION DES ECLAIRAGES</a> ;</li>
<br>
<hr>
<h2 id="Res">RESEAU</h2>
<br>
<hr>
<h2 id="Lum">GESTION DES ECLAIRAGES</h2>
<br>
<p>ECLAIRAGES: <strong>""" + gpio_state + """</strong></p>
<br>
<p><a href="/?led=on"><button class="button">ON</button></a></p>
<p><a href="/?led=off"><button class="button button2">OFF</button></a></p>
</body>
</html>"""
return html
In html to display an image, you are supposed to use <img src="image"> if the image is the same folder than the code.
Here they are in the same place but not in a folder see below
iMac-4:~ Chris$ ampy ls
/boot.py
/logo.jpg
/main.py
Thanks
Chris