Home > Web Front-end > HTML Tutorial > Summary of select option exception_html/css_WEB-ITnose

Summary of select option exception_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:54:02
Original
1339 people have browsed it

Source: http://www.ido321.com/1189.html

Yesterday, I encountered an abnormal option display in the project. The screenshot is as follows:

The effect after using css control in Firefox


css does not work in chrome and IE

Code:

<div class="controls">         <select name="ksname" id="ksname">             <?php                 while (!!$rowDK = fetchAssoc($resultDK))                  {             ?>             <optgroup label="<?php echo $rowDK['name']; ?>">               <?php                $resultKS = queryDB("select table_dake.id,table_keshi.sid,table_keshi.name from table_dake,table_keshi where table_dake.name='{$rowDK['name']}' and table_keshi.sid=table_dake.id");                 while(!!$rowKS = fetchAssoc($resultKS))                 {               ?>                 <option  value ="<?php echo $rowKS['name']; ?>"><?php echo $rowKS['name']; ?></option>                                  <?php                     </optgroup>                   }                 }                 free($resultDK);                 free($resultKS);             ?>         </select>     </div>
Copy after login

After debugging for a long time, I also looked for methods on the Internet, but in the end to no avail, I just asked the experts for advice. Daniel suggested that I check the source code. Has the style changed? The select part of this code does not have any style, how come there are so many? After reading the source code, there are indeed not many styles, but there is an extra after each option. After looking back at the code, I realized that I wrote in the inner loop. According to my The logic should be placed in the outer loop. After adjustment, everything is normal.

So, there is another way to debug the code: view the original code


Next article: 90 IT communities are waiting for you to choose! !

Summary of select option exceptions

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