網站首頁 健康小知識 母嬰教育 起名 運動知識 職場理財 情感生活 綠色生活 遊戲數碼 美容 特色美食 愛好

html下拉選擇框;html下拉框

欄目: IT技術 / 發佈於: / 人氣:1.31W

在很多網站都有看到下拉框的功能,讓我們一起來看看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張