N3lson Posted August 30, 2014 at 08:33 AM Report Share #565709 Posted August 30, 2014 at 08:33 AM Bom dia, estou a ter aqui um quebra cabeças que não consigo resolver, O problema é o seguinte, tenho uma select box com as jornadas e gostaria de alinhar á direita. No Firefox funciona bem mas no Chrome e IE não Aqui está http://www.sccabecudense.com css .styled-select { width: 220px; height: 30px; overflow: hidden; background: url('../images/seta.jpg') no-repeat right #ddd; border: 1px solid #ccc; z-index: 999; } .styled-select select { background: transparent; width: 240px; padding: 5px; font-size: 12px; line-height: 1; border: 0; border-radius: 0; height: 34px; -webkit-appearance: none; -moz-appearance: none; appearance: none; } select::-ms-expand { display: none; } .styled-select select option { background: transparent; float:left; position:relative; width: 200px; padding:3px 1px; text-align:right !important; font-size:11px } You can't do it, kid. But don't worry, my boy. You're not the only one. No one else can do it. Link to comment Share on other sites More sharing options...
KTachyon Posted August 30, 2014 at 08:41 AM Report Share #565710 Posted August 30, 2014 at 08:41 AM Eu diria para transformares o select nativo num elemento HTML utilizando, por exemplo, o selectmenu do JQuery UI. Assim passas a ter controlo sobre o CSS do select. “There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.” -- Tony Hoare Link to comment Share on other sites More sharing options...
N3lson Posted August 30, 2014 at 08:55 AM Author Report Share #565711 Posted August 30, 2014 at 08:55 AM Eu diria para transformares o select nativo num elemento HTML utilizando, por exemplo, o selectmenu do JQuery UI. Assim passas a ter controlo sobre o CSS do select. Obrigado pela sua resposta, vou tentar, embora tenha preferencia no nativo. You can't do it, kid. But don't worry, my boy. You're not the only one. No one else can do it. Link to comment Share on other sites More sharing options...
KTachyon Posted August 30, 2014 at 08:58 AM Report Share #565712 Posted August 30, 2014 at 08:58 AM O nativo vai ter um estilo diferente para cada browser e sistema operativo. Se queres ter consistência no layout de uma página web não deves utilizar componentes nativas. 1 Report “There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.” -- Tony Hoare Link to comment Share on other sites More sharing options...
N3lson Posted August 30, 2014 at 09:05 AM Author Report Share #565714 Posted August 30, 2014 at 09:05 AM Entendo mas não percebo muito de jquery. Esta select box provem de criação via php, o processo para adaptar é apenas trabalhando no css ou tem-se de efectuar alterações do js para trabalhar com o php ? echo '<div class="styled-select"> <select> <option selected disabled>JORNADAS E RESULTADOS</option>'; echo '<option disabled>1ª VOLTA</option>'; while($t = $res->fetch_object()) { if($r == $segunda + 1){ echo '<option disabled>2ª VOLTA </option>'; } echo '<option>'. $t->equipa1.' - '.$t->equipa2.' [ '.sprintf('%02d',$t->resultado1) .'-'.sprintf('%02d',$t->resultado2).' ] </option>'; $r++; } echo '</select> </div>'; $res->free_result(); You can't do it, kid. But don't worry, my boy. You're not the only one. No one else can do it. Link to comment Share on other sites More sharing options...
KTachyon Posted August 30, 2014 at 09:10 AM Report Share #565715 Posted August 30, 2014 at 09:10 AM Já tens o jQuery na tua página. Só precisas de adicionar o jQuery UI (tal como fizeste para o jQuery), atribuir uma classe ao select e fazer a chamada para transformar o teu select: <select class="mySelect"> $(document).ready(function () { $("#foo0").carouFredSel(); $("#foo1").carouFredSel(); $(".mySelect").selectmenu(); // adicionas esta linha }); “There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.” -- Tony Hoare Link to comment Share on other sites More sharing options...
N3lson Posted August 30, 2014 at 10:50 AM Author Report Share #565716 Posted August 30, 2014 at 10:50 AM (edited) Obrigado, coloquei mas não deu Edited August 30, 2014 at 11:07 AM by N3lson You can't do it, kid. But don't worry, my boy. You're not the only one. No one else can do it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now