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

Styling select, part 2

From the course: Building Great Forms with HTML and CSS

Start my 1-month free trial

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…

Contents