HTML select tag rendering issue
Asked Answered
U

2

8

Currently, I am facing the rendering problem in html select tag. I have few select tag, in that one select tag's option is static but another select tag's option is dynamic, which populate using jQuery.

I am using the internet explorer 6 mobile browser in the Motorola ES400 device.

When my web page is loaded on the screen than it display like this:

Here my first select tag is static and another three select tag's option tag is generating using the jQuery.

I personally feel that it may be happen due to the re-rendering problem.

If i scroll the web page that it display okay:

I am using the following CSS for the select tag:

    width               : 240px;
    height              : 24px;
    border              : 1px solid #cccccc;
    vertical-align      : middle;

Please click here for the JSFiddle

Understudy answered 8/8, 2016 at 5:33 Comment(3)
please post your code or fiddle link.Neckwear
@Neckwear Thanks for your reply, 2 min please.Understudy
@Jainam, sorry for taking time. my fiddle URL is here: jsfiddle.net/3tj4wn74/1Understudy
S
1

Try this is uses :after and :before to do the trick

body, html {background:#444; text-align:center; padding:50px 0;}

/* The CSS */
select {
    padding:3px;
    margin: 0;
    -webkit-border-radius:4px;
    -moz-border-radius:4px;
    border-radius:4px;
    -webkit-box-shadow: 0 3px 0 #ccc, 0 -1px #fff inset;
    -moz-box-shadow: 0 3px 0 #ccc, 0 -1px #fff inset;
    box-shadow: 0 3px 0 #ccc, 0 -1px #fff inset;
    background: #f8f8f8;
    color:#888;
    border:none;
    outline:none;
    display: inline-block;
    -webkit-appearance:none;
    -moz-appearance:none;
    appearance:none;
    cursor:pointer;
}

/* Targetting Webkit browsers only. FF will show the dropdown arrow with so much padding. */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    select {padding-right:18px}
}

label {position:relative}
label:after {
    content:'<>';
    font:11px "Consolas", monospace;
    color:#aaa;
    -webkit-transform:rotate(90deg);
    -moz-transform:rotate(90deg);
    -ms-transform:rotate(90deg);
    transform:rotate(90deg);
    right:8px; top:2px;
    padding:0 0 2px;
    border-bottom:1px solid #ddd;
    position:absolute;
    pointer-events:none;
}
label:before {
    content:'';
    right:6px; top:0px;
    width:20px; height:20px;
    background:#f8f8f8;
    position:absolute;
    pointer-events:none;
    display:block;
}
<label>
    <select>
        <option selected> Select Box </option>
        <option>Short Option</option>
        <option>This Is A Longer Option</option>
    </select>
</label>
Scape answered 8/8, 2016 at 10:26 Comment(1)
Thanks @Abhishek, :before and :after is not supported in IE6 Please check here: caniuse.com/#search=%3Abefore , But thanks for your help, can you please explain what is going on in your above css ?Understudy
M
0

Refreshing the page may fix the problem :) (clear cache too)

Masjid answered 8/8, 2016 at 5:52 Comment(1)
Yeah, I know that, I also wrote in my question, When I scroll the page than it fix automatically, There is no need to refresh the page, and What I say to my client "Please first scroll the page little bit for the fix this issue" ?Understudy

© 2022 - 2024 — McMap. All rights reserved.