Hi guys,
I managed to style a dropbox that works cross-browser. However, I can't solve the following issue:
When the name of a selection is short, it displays fine when it's selected. When the name of a
selection is long, it superimposes itself over the dropdown arrow image. See attached images.
Can you suggest a way to alter the css so that the width of long selected names are prevented from
reaching the dropdown arrow, say by maybe 3 or four pixels?
Thanks,
Kenny
The website
Code:
#mySelect {
position: relative;
top: 0px;
left: 0px;
}
.styled {
color:#E3B172;
width: 185px;
height: 26px;
overflow: hidden;
background: url(/images/dropdown-arrow.png) no-repeat 100% #37271A;
border: 1px solid #4C3726;
-webkit-border-radius: 6px 6px 6px 6px;
-moz-border-radius: 6px 6px 6px 6px;
border-radius: 6px 6px 6px 6px;
-webkit-box-shadow: 1px 1px 2px 1px rgba(0,0,0,0.5);
-pie-box-shadow: 1px 1px 2px 1px rgba(0,0,0,0.5);
-moz-box-shadow: 1px 1px 2px 1px rgba(0,0,0,0.5);
box-shadow: 1px 1px 2px 1px rgba(0,0,0,0.5);
cursor:hand;
}
.styled:hover {
border: 1px solid #4C3726;
}
.styled select {
color:#E3B172;
position: relative;
background: transparent;
top: 01px;
left: 0px;
width: 214px;
height: 24px;
padding: 2px 0px 3px 3px;
font-size: 16px;
-webkit-appearance: none;
}
Code:
<form action="<? bloginfo('url'); ?>" method="get">
<div id="mySelect" class="styled">
<select name="page_id" id="page_id">
<?php
global $post;
$args = array( 'numberposts' => -1);
$posts = get_posts($args);
foreach( $posts as $post ) : setup_postdata($post); ?>
<option style="border:1px solid #3d2a1b;color:#E3B172;background:#37271A;z-index:-2;" value="<? echo $post->ID; ?>"><?php the_title(); ?></option>
<?php endforeach; ?>
</select></div>
Bookmarks