Home > Web Front-end > HTML Tutorial > How to implement html without displaying the arrow of the drop-down list

How to implement html without displaying the arrow of the drop-down list

醉折花枝作酒筹
Release: 2023-01-05 16:10:32
Original
3932 people have browsed it

How to not display the drop-down list arrow: first set the width of the select element and the div element, where the width of the div element is 20px greater than the width of the select element; then set "overflow:hidden" in the select element to achieve this Effect.

How to implement html without displaying the arrow of the drop-down list

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

html select drop-down arrow hide

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style type="text/css">
        .width5 {
            width: 122px;
        }
        .width7
        {
            width: 142px;
        }
        /*设置Select样式*/
        .SelectList
        {
            height: 32px;
            line-height: 32px;
            overflow:hidden;
        }
    </style>
</head>
<body>
<div class="DivSelect width5">
    <select  class="SelectList width7">
        <option>双铜纸</option>
        <option>双胶纸</option>
    </select>
</div>
</body>
</html>
Copy after login

This is the effect in normal state, with arrow:

How to implement html without displaying the arrow of the drop-down list

We only need Set overflow: hidden; in the outer div to hide the arrow.

.DivSelect
        {
            overflow: hidden; /* 隐藏了小三角,宽度为比select宽度少20px */
        }
Copy after login

The effect is as shown:

How to implement html without displaying the arrow of the drop-down list

Due to this situation, some parts have no borders, so when hiding the arrow, for the sake of beauty, it will be set to borderless .

Recommended learning: html video tutorial

The above is the detailed content of How to implement html without displaying the arrow of the drop-down list. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template