-
Adding an Image to a Web Page
-
The role of images in a webpage
-
Specifying locations in web pages
-
Customizing Links
-
Exploring link options
-
Basic links
-
Why links?
-
Submit and Reset buttons
-
Multiline text boxes
-
Drop-down list fields
-
File upload fields
-
Hidden fields
-
Checkboxes and radio buttons
-
Password fields
-
Text fields
-
Input tags
-
Creating forms
-
How a form looks like?
-
Adding Headers Cells
-
Creating a Basic Table
-
Description list
-
Unordered list
-
Ordered list
-
Lists
-
More formatting elements
-
Other text elements
-
Working with language elements
-
Abbreviations, Definitions, Quotations and Citations
-
Creating Breaks
-
Basic text formatting elements
-
Creating a page from scratch using VS Code
-
Creating a page from scratch using Notepad
-
Setting Up the Basic Document Structure
-
Parents, Children, Descendants and Siblings
-
The Outer Structure of an HTML Document
-
Element Attributes
-
HTML elements
-
How HTML creates a website
-
Creating HTML markup
-
How a website works
-
Web Browsers vs Web Servers and Internet/HTTP
-
Webpage vs Website
Drop-down list fields
Drop-down lists are a great way to give users lots of options in a small amount of screen space.
You use two tags to create a drop-down list:
- <select> creates the list. Use a name attribute with the <select> element to name your list.
- A collection of <option> elements identifies individual list options. The value attribute assigns a unique value for each <option> element.
Here’s a markup example for a drop-down list:https://stackblitz.com/edit/web-platform-mhujpo?embed=1&file=index.html&hideDevTools=1&hideExplorer=1&hideNavigation=1
The browser turns this markup into a drop-down list with three items.
You can also enable users to select more than one item from a drop-down list by changing the default settings of your list:
- If you want your users to be able to choose more than one option (by holding down the Ctrl [Windows] or ⌘ [Mac] key while clicking options in the list), add the multiple attribute to the <select> tag. The value of multiple is multiple. If you give a stand-alone attribute a value, that value must be the same as the name for the attribute itself (that is, both multiple and multiple=”multiple” are legal).
- By default, the browser displays only one option until the user clicks the drop-down menu arrow to display the rest of the list. Use the size attribute with the <select> tag to specify how many options to show. If you specify fewer than the total number of options, the browser includes a scroll bar with the drop-down list.
You can specify that one of the options in the drop-down list be already selected when the browser loads the page, just as you can specify a check box or radio button to be selected. Simply add the selected attribute for the <option> tag you want as the default. Use this when one choice is very likely, knowing that users can override your default selection quickly and easily.