2011-05-21 74 views
0
<input type="checkbox" ID="RecquireFacebookInvitesCB" />Require 
    <select> 
    {section name=foo start=5 loop=50 step=1} 
     <option value="{$smarty.section.foo.index}">{$smarty.section.foo.index}</option> 
    {/section} 
    </select> 
    this many Facebook invites before entering sweepstakes 

enter image description here正確的CSS以某種順序顯示html表單元素?

我有產生兩個表單元素和顯示在我的屏幕截圖一些文字上的HTML(使用Smarty的PHP格式標記)。我想使這個顯示爲:

[CHECKBOX] Require [SELECTION LIST] Facebook invites before entering sweepstakes 

我有我自己對如何實現這一想法,但我想知道最好的辦法是什麼。謝謝!

+0

在屏幕截圖,選擇列表是第一,而在顯示要選擇列表是第三? (1)把它放在div中,改變標記順序,向左浮動。 (2)把它放在div中,相對位置,並且每個項目的位置絕對爲 – Jawad 2011-05-21 17:46:25

+0

@ JAA149,我嘗試過 - 但是將每個元素的位置絕對放置在相對定位的div內似乎會使所有元素重疊在一起。 – 2011-05-21 17:57:35

+0

是什麼給?訂單已經在那裏!檢查某個CSS代碼是否影響訂單。 – Jawad 2011-05-21 18:22:30

回答

1

試着改變你的代碼如下:

<input type="checkbox" ID="RecquireFacebookInvitesCB" /><label for="RecquireFacebookInvitesCB">Require</label> 
<select> 
{section name=foo start=5 loop=50 step=1} 
    <option value="{$smarty.section.foo.index}">{$smarty.section.foo.index}</option> 
{/section} 
</select> 
this many Facebook invites before entering sweepstakes 
+0

正確的CSS?不是HTML! – Jawad 2011-05-21 17:49:22