關閉→
當前位置:趣知常識網>遊戲數碼>IT技術>html下拉選擇框;html下拉框

html下拉選擇框;html下拉框

趣知常識網 人氣:1.17W

在很多網站都有看到下拉框的功能,讓我們一起來看看html如何製作下拉框。

操作方法

新建一個html文件。如圖

html下拉選擇框;html下拉框

在html頁面找打body標籤,在這個標籤裏新建select標籤,在select標籤內創建option標籤並設置內容。如圖

代碼:

<select>

<option>-請選擇-</option>

<option>1111111</option>

<option>2222222</option>

<option>3333333</option>

</select>

html下拉選擇框;html下拉框 第2張

保存好html文件後使用瀏覽器打開,即可看到效果。如圖:

html下拉選擇框;html下拉框 第3張

所有代碼。可直接把所有代碼複製到html文件上運行即可看到效果。如圖:

所有代碼:

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>下拉選擇框</title>

</head>

<body>

<select>

<option>-請選擇-</option>

<option>1111111</option>

<option>2222222</option>

<option>3333333</option>

</select>

</body>

</html>

html下拉選擇框;html下拉框 第4張
TAG標籤:#HTML #下拉框 #下拉 #