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

Summary of select option exception_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-24 11:54:021356browse

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>

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 bc2752b74169f27a1fb12a4976198c73 after each option. After looking back at the code, I realized that I wrote bc2752b74169f27a1fb12a4976198c73 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

Statement:
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