scrimba
Code with AI
Games, Apps and more
Smart home mobile interface - part 2
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Smart home mobile interface - part 2
AboutCommentsNotes
Smart home mobile interface - part 2
Expand for more info
styles.css
run
preview
console
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
background-color: #28074a;
color: white;
}

header {
text-align: center;
padding: 20px;
}

main {
padding: 20px;
}

/*
Challenge: UI adjustments
* Center align the content inside each section
and add more spacing around the content
* Adjust the space between the buttons
*/

section {
background: linear-gradient(to bottom, #491088, #6c1dd0);
border-radius: 10px;
padding: 20px;
margin-bottom: 20px;
text-align: center;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

h2 {
margin-top: 0;
font-size: 24px;
}

button {
background-color: #bd4de5;
color: white;
border: none;
border-radius: 5px;
padding: 10px 15px;
margin: 5px;
font-size: 16px;
cursor: pointer;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
}

button:hover {
background-color: #ff19db;
}

button:active {
outline: none;
box-shadow: 0px 0px 10px rgba(255, 25, 219, 0.8);
}

button i {
margin-right: 5px;
}

/* Toggle Switch Styles */
.switch {
position: relative;
display: inline-block;
width: 120px;
height: 34px;
}

.switch input {
display: none;
}

.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #bd4de5;
transition: 0.4s;
border-radius: 34px;
}

.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
transition: 0.4s;
border-radius: 50%;
}

input:checked + .slider {
background-color: #ff19db;
}

input:checked + .slider:before {
transform: translateX(85px);
}

@media screen and (max-width: 600px) {
main {
padding: 10px;
}
}
Console
/index.html
-6:20