2014-07-26 21 views
0

在我的網站上Website我似乎無法得到這些下拉菜單,彼此相鄰,我該怎麼做?我怎樣才能讓這兩個下拉菜單緊挨着?

這是我的代碼...

<html> 
<head> 
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> 
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> 
<title>$MODULE_NAME$ - $SITE_NAME$</title> 
<?$META_DESCRIPTION$?> 

<link type="text/css" rel="StyleSheet" href="/_st/my.css" /> 
</head> 
<body> 
$ADMIN_BAR$ 
$GLOBAL_AHEADER$ 
<!-- <middle> --> 
<div id="maincol"> 
$MODULE_SEARCH_FORM$ 
<!-- <body> --><table border="0" cellpadding="0" cellspacing="0" width="100%"> 
<tr> 
<td width="80%"><a href="$HOME_PAGE_LINK$"><!--<s5176>-->MAIN<!--</s>--></a> &raquo;  <!--<s5208>-->MOVIES<!--</s>--></td> 
<td align="right" style="white-space: nowrap;"><?if($ADD_ENTRY_LINK$)?>[ <a href="$ADD_ENTRY_LINK$"><!--<s5202>-->Add new entry<!--</s>--></a> ]<?endif?></td> 
</tr> 
</table> 
<hr /> 
<table border="0" cellpadding="0" cellspacing="0" width="100%"> 
<div> 
<form name="yearselect">FILTER BY: 
<select name="menu" onChange="window.document.location.href=this.options[this.selectedIndex].value;" value="GO"> 
<option selected="selected">YEAR</option> 
<option value="year/1">2014</option> 
<option value="year/2">2013</option> 
</select> 
</form> 
</div><div> 
<form name="genreselect"> 
<select name="menu" onChange="window.document.location.href=this.options[this.selectedIndex].value;" value="GO"> 
<option selected="selected">GENRE</option> 
<option value="URL">Action</option> 
<option value="URL">Horror</option> 
</select> 
</form> 
</div> 
<td align="right"><?if($PAGE_SELECTOR$)?><!--<s3015>-->Pages<!--</s>-->:   $PAGE_SELECTOR$<?endif?></td> 
</tr> 
</table> 
<hr /> 
$BODY$ 
<?if($PAGE_SELECTOR1$)?><div style="text-align:center;">$PAGE_SELECTOR1$</div><?endif?>  <!-- </body> --> 
</div> 
<div id="sidebar"> 
<div id="soc"> 
<?if($RSS_LINK$)?><a href="$RSS_LINK$" target="_blank" title="RSS" class="soc-rss"></a>  <?endif?> 
<a href="http://del.icio.us/post?url=$HOME_PAGE_LINK$" rel="nofollow" target="_blank" title="Del.icio.us" class="soc-del"></a> 
<a href="http://www.facebook.com/share.php?u=$HOME_PAGE_LINK$" rel="nofollow" target="_blank" title="FaceBook" class="soc-facebook"></a> 
<a href="http://memori.ru/link/?sm=1&u_data[url]=$HOME_PAGE_LINK$" rel="nofollow" target="_blank" title="Memori" class="soc-memori"></a> 
<a href="http://vkontakte.ru/share.php?url=$HOME_PAGE_LINK$" rel="nofollow" target="_blank" title="Vkontakte" class="soc-vkontakte"></a> 
<a href="http://twitter.com/share?url=$HOME_PAGE_LINK$" rel="nofollow" target="_blank" title="Twitter" class="soc-twitter"></a> 
</div> 
$GLOBAL_CLEFTER$ 
</div> 
<div class="clear"></div> 
<!-- </middle> --> 
</div> 
</div> 
$GLOBAL_BFOOTER$ 
</div> 
</div> 
</div> 
</body> 
</html> 

這是代碼的完整的源代碼,但是,我只需要與部分幫助..

+0

什麼下拉菜單旁邊對方的意思,請把你的全SRC。我檢查是否沒有css它ok –

+0

我已經發布完整的來源,@tuanhuynh – Magicskid

回答

0

避免表!請參閱本fiddle

標記:

<div> 
    <form name="yearselect">FILTER BY: 
     <select name="menu" onChange="window.document.location.href=this.options[this.selectedIndex].value;" value="GO"> 
      <option selected="selected">YEAR</option> 
      <option value="year/1">2014</option> 
      <option value="year/2">2013</option> 
     </select> 
    </form> 
</div><div> 
    <form name="genreselect"> 
     <select name="menu" onChange="window.document.location.href=this.options[this.selectedIndex].value;" value="GO"> 
      <option selected="selected">GENRE</option> 
      <option value="URL">Action</option> 
      <option value="URL">Horror</option> 
     </select> 
    </form> 
</div> 

CSS:

div { 
    display: inline-block; 
    width: 50%; 
} 
0

所以,你必須在表跨格一路綿延,每個下拉集中在每列。你需要在桌子的div上設置一個最大寬度,這樣它纔會擴展到一定的寬度,然後這個下拉不會再遠離這個距離。或者,你可以把它們放在同一列(基本上沒有表),並將它們放在一邊。

1

這裏是一個有效的HTML5解決您的問題,fiddle

<form> 
    <table> 
    <tr> 
     <td>FILTER BY: 
     <select name="yearselect"> 
      <option selected="selected">YEAR</option> 
      <option value="year/1">2014</option> 
      <option value="year/2">2013</option> 
     </select> 
     </td> 
     <td> 
     <select name="genreselect"> 
      <option selected="selected">GENRE</option> 
      <option value="URL">Action</option> 
      <option value="URL">Horror</option> 
     </select> 
     </td> 
    </tr> 
    </table> 
</form> 
+0

當我嘗試這個下拉菜單不工作@mdesdev – Magicskid

+0

是啊現在下拉框不起作用@mdesdev – Magicskid

+0

你是什麼意思doesn不工作? – mdesdev

相關問題