From the course: Building Great Forms with HTML and CSS
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Styling select, part 2
From the course: Building Great Forms with HTML and CSS
Styling select, part 2
- [Instructor] We're going to be looking at a way that we can fully customize our select box. This is going to require that we use both CSS and JavaScript. So let's go ahead and dive into the code. The code is very similar to what we looked at in some of our previous exercises. I have a select element with a class of Fancy Select and it contains a number of options. So in order for us to style this, we're going to have to add some JavaScript first because we are going to have JavaScript dynamically create an unordered list which is much more flexible in regards to CSS styling, so that we can style this exactly how we want it to look. I'll jump in to my code snippets and I'm going to scroll down to the bottom section of the page where I have this custom JavaScript code. I'll select all of this code and copy it and I'm just going to create an embedded style at the bottom of my document. This particular script that I'm using…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Form layout tips7m 51s
-
(Locked)
Styling labels and inputs8m 19s
-
(Locked)
Focus styles4m 23s
-
(Locked)
Using pseudo-classes to be more specific7m 46s
-
(Locked)
Custom checkboxes6m 51s
-
(Locked)
Radio buttons6m 16s
-
(Locked)
Toggle switch8m 20s
-
(Locked)
Styling select, part 17m 29s
-
(Locked)
Styling select, part 29m 9s
-
(Locked)
Float labels6m 57s
-
(Locked)
-
-
-
-
-
-
-