2011-10-26 88 views
1

我已經設置了單選按鈕以在聯繫表單上內聯顯示。它們可以在除IE7以外的所有測試瀏覽器中正確顯示,它們不會以內聯方式顯示。他們使用ul和li來設置。單選按鈕不會在IE7中內聯顯示

CSS單選按鈕

fieldset div ul { 
    margin: 5px 0 0 0; 
    list-style:none; 
    display:block; 
    float:left; 
} 

fieldset div ul li { 
    margin: 0 15px 0 0; 
    padding: 0; 
    list-style:none; 
    display:inline; 
    float:none; 
} 

fieldset div ul li label { 
    display: inline; 
    float: none; 
    font-size: 1em; 
    font-weight: normal; 
    margin: 0; 
    padding: 0; 
} 

fieldset div ul li input { 
    background: none; 
    border: none; 
    display: inline; 
    margin: 0 5px 0 0; 
    padding: 0; 
    width: auto; 
    float:none; 
} 

HTML表單

<fieldset> 
    <!-- Your Name --> 
    <div> 
    <label for="name">Name</label> 
    <input type="text" name="name" id="name" class="required"/> 
    </div> 

    <!-- Email --> 
    <div> 
    <label for="emailAddress">Email</label> 
    <input type="text" name="emailAddress" id="emailAddress" class="required email"/> 
    </div> 

    <!-- Phone --> 
    <div> 
    <label for="phone">Phone</label> 
    <input type="text" name="phone" id="phone" /> 
    </div> 

    <!-- Contact Time --> 
    <div> 
    <label for="contactTime">Best Time to Contact</label> 
    <ul> 
    <li><input type="radio" name="contactTime" value="morning" /><label for="morning">Morning</label></li> 
    <li><input type="radio" name="contactTime" value="day" /><label for="day">Day</label></li> 
    <li><input type="radio" name="contactTime" value="evening" /><label for="evening">Evening</label></li> 
    </ul> 
    </div> 



    <!-- Contact Method --> 
    <div> 
    <label for="contactMethod" style="margin:15px 0 0 0;">Best Method of Contact</label> 
    <ul> 
    <li><input type="radio" name="contactMethod" value="phone" /><label for="phone">Phone</label></li> 
    <li><input type="radio" name="contactMethod" value="email" /><label for="email">Email</label></li> 
    </ul> 
    </div> 


    <!-- Coments --> 
    <div class="floatLeft" style="margin:10px 0 0 0;"> 
    <label for="mess">Message</label> 
    <textarea name="mess" id="mess" rows="15" cols="5"></textarea> 
    </div> 

    <!-- Controls --> 
    <div class="controls"> 
    <input id="submit" name="submit" type="submit" value="Contact Us" class="button"/> 
    </div> 
    </fieldset> 
<input name="url" type="hidden" value="" class="noDisplay"/> 

回答

0

嘗試設置他們左浮動 -

fieldset div ul li { 
    margin: 0 15px 0 0; 
    padding: 0; 
    list-style:none; 
    display:inline; 
    float:left; 
} 

應該不會影響任何其他瀏覽器,和sh應該整理IE7。不要忘記clear: left;