CSS- UI Element States Pseudo-Classes
How do I make an css- ui element states pseudo-classes?
CSS- UI Element States Pseudo-Classes covered::enabled :disabled :checked. What is a css- ui element states pseudo-classes? How do you make a css- ui element states pseudo-classes? This script and codes were developed by Anthony Albertorio on 24 September 2022, Saturday.
CSS- UI Element States Pseudo-Classes - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CSS- UI Element States Pseudo-Classes</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <form> <input type="text" name="name" placeholder="name" /> <input type="text" name="email" placeholder="email" disabled/> <div> <input name="radio" id="radio1" type="radio" /><label for="radio1">Option 1</label> <input name="radio" id="radio2" type="radio" /><label for="radio2">Option 2</label> <input name="radio" id="radio3" type="radio" /><label for="radio3">Option 3</label> </div> <input type="submit" name="submit" />
</form>
</body>
</html>
CSS- UI Element States Pseudo-Classes - Script Codes CSS Codes
/* UI state pseudo classes, let us state CSS based on certain use interaction states.
They are most commonly used for styling form elements.
*/
/*General Styling*/
body { background-color: #e8f3f8; font: 1em/1.5 sans-serif;
}
form { margin: 80px auto; width: 320px; color: steelblue;
}
input { padding: 10px; border-radius: 5px; font-size: inherit;
}
input[type="text"] { display: block; margin-bottom: 25px; width: 100%; border: 2px solid steelblue;
}
input[type="radio"] { margin: 0 8px 25px 18px;
}
input[type="radio"]:first-child{ margin-left: 20px;
}
input[type="submit"] { width: 344px; height: 45px; border: none; background: steelblue; color: white; cursor: pointer;
}
/* UI Element States Pseudo Classes*/
/* :enabled - selects UI elements that are in an enabled state, such as a button or a text field. When a form element is enabled, it can become active and gain focus.*/
/*Targeting text boxes.*/
input[type="text"]:enabled { background: lightyellow;
}
/* :disabled{} selects form elements like button and fields that are in a disabled state.*/
:disabled { background: #ddd;
}
/*:checked{}, targets elements that are selected or checked, like radio or checkboxes
In this example we use the (+) adjected sibling combinator to select label that is an immediate sibling of the radio button. */
input[type="radio"]:checked + label { font-size: 22px; font-weight: bold;
}

Developer | Anthony Albertorio |
Username | tesla809 |
Uploaded | September 24, 2022 |
Rating | 3 |
Size | 2,206 Kb |
Views | 16,184 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Weather App | 2,717 Kb |
Random Quote Machine | 7,062 Kb |
CSS Combinators | 1,957 Kb |
FreeCodeCamp-Tribute Page on Ethereum | 2,809 Kb |
Million-token-HomePage-initial-mockup | 9,938 Kb |
Famo.us test | 1,753 Kb |
A Pen by Anthony Albertorio | 23,123 Kb |
Pomodoro Clock | 1,901 Kb |
SAMPLE FORM | 1,424 Kb |
CSS- Additional Pseudo-Classes | 2,690 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Rotate Demo | Agelber | 3,061 Kb |
Growing Root - Scroll control - CANVAS | Cjonasw | 2,342 Kb |
A Pen by Jess | Jessamyne | 5,100 Kb |
Save for later... | Victorfreire | 1,359 Kb |
Boxes | H3l1um | 2,563 Kb |
Vanilla modal window | Jasonhowmans | 3,554 Kb |
RollOver Effect 2 | Lmack90 | 2,162 Kb |
Konami Code Easter Egg | Teolitto | 3,051 Kb |
Simple blog concept | Drew_mc | 2,666 Kb |
Count up | Alanshortis | 2,391 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!