• 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

How does this CSS styling does?

Q&A Forum › Category: ESP32 › How does this CSS styling does?
0 Vote Up Vote Down
wu.ginnan asked 4 years ago

please explain the code, thanks!

<style>body {max-width: 300px;margin: 0pxauto;}
.switch {position:relative;display:inline-block;width:120px;height:68px}
.switchinput { display:none }
.slider {position:absolute;top:0;left:0;right:0;bottom:0;background-color:#ccc;border-radius:34px}
.slider:before {position:absolute;content:"";height:52px;width:52px;left:8px;bottom:8px;background-color:#fff;-webkit-transition:.4s;transition:.4s;border-radius:68px}
input:checked+.slider{ background-color:#2196F3 }input:checked+.slider:before {-webkit-transform:translateX(52px);-ms-transform:translateX(52px);transform:translateX(52px)}</style>
1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi.

That part of “code” is called CSS.

CSS is used to style HTML pages. In this case, that CSS is responsible for defining the width of the web page, placing the switch button in the desired position. And then, it also styles the color of the button, the size, etc…

However, creating HTML with CSS pages goes beyond the scope of the course. That could be an entire course.

Nonetheless, if you have a specific question, we might be able to help.

Just for a reference, this is the link for the code: https://github.com/RuiSantosdotme/ESP-MicroPython/tree/master/code/WiFi/Web_Server_Output

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] SMART HOME with RPi, ESP32, and ESP8266 (version 1.2) March 8, 2023
  • [eBook Updated] ESP32-CAM Projects (version 1.3) January 7, 2023

You must be logged in to view this content.

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

Copyright © 2013-2023 · 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.