php - 如何设置下拉列表的样式?

标签 php html css forms drop-down-menu

<分区>

如何将css 样式添加到此表单的下拉列表中?我在互联网上搜索了很多,但没有找到有用的结果。 谢谢

    echo  "<form method='post' action='advisor.php?view=$view'>
    Select Student: <select name='data'>";
    while($row = mysqli_fetch_array($query))
        {

                    echo "<option value=\"".$row[3] . "\">".$row[0] ." " . $row[1] . " (".$row[3].")".
                    "</option>";
        }
      echo    " </select>
        <input type='submit' name='submit' class='buttonM' value='Show Questions' />
        </form>";
     }

最佳答案

检查一下 - http://bavotasan.com/2011/style-select-box-using-only-css/

html

<div class="styled-select">
   <select>
      <option>Here is the first option</option>
      <option>The second option</option>
   </select>
</div>

CSS

.styled-select select {
   background: transparent;
   width: 268px;
   padding: 5px;
   font-size: 16px;
   line-height: 1;
   border: 0;
   border-radius: 0;
   height: 34px;
   -webkit-appearance: none;
}

要获得更精细的样式,您需要使用 javascript - 像这样 http://tympanus.net/codrops/2012/10/04/custom-drop-down-list-styling/

关于php - 如何设置下拉列表的样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17701093/

上一篇:css - 导航栏当前状态

下一篇:javascript - 如何更改 jquery ui 对话框的背景颜色

相关文章:

css - 将多个类与多个动画组合

jquery - CSS 样式和 Jquery 未应用于 jsp :include file

php - 无法加载 xdebug.so : undefined symbol: gc_globals

HTML "data-attribute"与简单 "custom attribute"

html - 更正网格中内容的语义标签 - html5

html - 甚至带有文本填充的列?

html - 从 Excel Embed iFrame 中删除底部栏

php - 是什么导致了这个 modx 错误?

PHP:exiftool 的基本用法

javascript - Google Contacts API - 如何仅过滤电子邮件联系人