2014-10-06 77 views
0

我正在調試我的應用程序,因爲某些原因,下拉列表有垂直顯示而不是水平顯示的趨勢。在Internet Explorer中垂直顯示下拉列表

說我有幾行代碼:

@model MagicAdmin2.Utility.PageFilters.CardSetFilter 

@using (Html.BeginForm()) 
{ 
    <div id="filters" class="blackBorder defaultBaseStyle whiteField" style="margin-top: 20px"> 
     <h3 style="background: white; margin-top: -20px; margin-left: 10px; padding: 0 10px; width: 50px;">Filters</h3> 
     Category: @Html.DropDownListFor(_item => _item.mCategory, Model.mCategoryList, new { disabled = "disabled", @id = "setCategory"}) 
     Block: @Html.DropDownListFor(_item => _item.mBlock, Model.mBlockList, "All", new {@id = "setBlock"}) 
     Cards Loaded:@Html.DropDownListFor(_item => _item.mHasCards, Model.mHasCardsList, new {@id = "setLoaded"}) 
     <input type="button" value="Search" id="fetchButton" onclick="needToConfirm=false"/> 
    </div> 
} 

我會告訴股利的三個主要類別,以避免在CSS的困惑:

.blackBorder { 
    border: 2px solid black; 
} 

.defaultBaseStyle { 
    -ms-border-radius: 10px; 
    border-radius: 10px; 
    padding: 5px; 
} 

.whiteField { 
    background-color: white; 
} 

而且在Internet Explorer中的腳本我已經嘗試了以下內容:

#filters ul li { 
    display: inline-block; 
    float: left 
} 

基於幾個答案我在這裏和那裏找到堆棧verflow。不過,目前我沒有任何運氣。下面是我如何檢查Internet Explorer瀏覽器:

<!--[if IE]> 
      <link rel="stylesheet" title="text/css" href="/Content/IEStyle.css"/> 
     <![endif]--> 

**編輯**

這裏的局部視圖的快速HTML輸出呈現:

<h2>Cards Display Results</h2> 
<br/> 

<form action="/Card/DisplayCardsResults" method="post"> <div id="filters"class="blackBorder defaultBaseStyle whiteField" style="margin-top: 20px"> 
     <h3 style="background: white; margin-top: -20px; margin-left: 10px; padding: 0 10px; width: 50px;">Filters</h3> 
     Filter by card name: <input id="cardNameFilter" name="mCardName" type="text" value="" /> 
     set: <select class="dropdownList" id="cardSetFilter" name="CardSet"><option value="All">All</option> 
<option value="Khans of Tarkir">Khans of Tarkir</option> 
<option value="Magic 2015 Core Set">Magic 2015 Core Set</option> 
<option value="Magic: The Gathering—Conspiracy">Magic: The Gathering—Conspiracy</option> 
<option value="Journey into Nyx">Journey into Nyx</option> 
<option value="Born of the Gods">Born of the Gods</option> 
<option value="Commander 2013 Edition">Commander 2013 Edition</option> 
<option value="Theros">Theros</option> 
<option value="Magic 2014 Core Set">Magic 2014 Core Set</option> 
<option value="Modern Masters">Modern Masters</option> 
<option value="Dragon&#39;s Maze">Dragon&#39;s Maze</option> 
<option value="Gatecrash">Gatecrash</option> 
<option value="Commander&#39;s Arsenal">Commander&#39;s Arsenal</option> 
<option value="Return to Ravnica">Return to Ravnica</option> 
<option value="Magic 2013">Magic 2013</option> 
<option value="Planechase 2012 Edition">Planechase 2012 Edition</option> 
<option value="Avacyn Restored">Avacyn Restored</option> 
<option value="Dark Ascension">Dark Ascension</option> 
<option value="Innistrad">Innistrad</option> 
<option value="Magic 2012">Magic 2012</option> 
<option value="New Phyrexia">New Phyrexia</option> 
<option value="Mirrodin Besieged">Mirrodin Besieged</option> 
<option value="Scars of Mirrodin">Scars of Mirrodin</option> 
<option value="Magic 2011">Magic 2011</option> 
<option value="Rise of the Eldrazi">Rise of the Eldrazi</option> 
<option value="Worldwake">Worldwake</option> 
<option value="Zendikar">Zendikar</option> 
<option value="Planechase">Planechase</option> 
<option value="Magic 2010">Magic 2010</option> 
<option value="Alara Reborn">Alara Reborn</option> 
<option value="Conflux">Conflux</option> 
<option value="Shards of Alara">Shards of Alara</option> 
<option value="Eventide">Eventide</option> 
<option value="Shadowmoor">Shadowmoor</option> 
<option value="Morningtide">Morningtide</option> 
<option value="Lorwyn">Lorwyn</option> 
<option value="Tenth Edition">Tenth Edition</option> 
<option value="Future Sight">Future Sight</option> 
<option value="Planar Chaos">Planar Chaos</option> 
<option value="Time Spiral">Time Spiral</option> 
<option value="Coldsnap">Coldsnap</option> 
<option value="Dissension">Dissension</option> 
<option value="Guildpact">Guildpact</option> 
<option value="Ravnica: City of Guilds">Ravnica: City of Guilds</option> 
<option value="Ninth Edition">Ninth Edition</option> 
<option value="Saviors of Kamigawa">Saviors of Kamigawa</option> 
<option value="Betrayers of Kamigawa">Betrayers of Kamigawa</option> 
<option value="Champions of Kamigawa">Champions of Kamigawa</option> 
<option value="Fifth Dawn">Fifth Dawn</option> 
<option value="Mirrodin">Mirrodin</option> 
<option value="Eighth Edition">Eighth Edition</option> 
<option value="Scourge">Scourge</option> 
<option value="Legions">Legions</option> 
<option value="Darksteel">Darksteel</option> 
<option value="Onslaught">Onslaught</option> 
<option value="Judgment">Judgment</option> 
<option value="Torment">Torment</option> 
<option value="Odyssey">Odyssey</option> 
<option value="Apocalypse">Apocalypse</option> 
<option value="Seventh Edition">Seventh Edition</option> 
<option value="Planeshift">Planeshift</option> 
<option value="Invasion">Invasion</option> 
<option value="Prophecy">Prophecy</option> 
<option value="Nemesis">Nemesis</option> 
<option value="Mercadian Masques">Mercadian Masques</option> 
<option value="Urza&#39;s Destiny">Urza&#39;s Destiny</option> 
<option value="Classic Sixth Edition">Classic Sixth Edition</option> 
<option value="Urza&#39;s Legacy">Urza&#39;s Legacy</option> 
<option value="Urza&#39;s Saga">Urza&#39;s Saga</option> 
<option value="Exodus">Exodus</option> 
<option value="Stronghold">Stronghold</option> 
<option value="Tempest">Tempest</option> 
<option value="Weatherlight">Weatherlight</option> 
<option value="Fifth Edition">Fifth Edition</option> 
<option value="Visions">Visions</option> 
<option value="Mirage">Mirage</option> 
<option value="Alliances">Alliances</option> 
<option value="Homelands">Homelands</option> 
<option value="Ice Age">Ice Age</option> 
<option value="Fourth Edition">Fourth Edition</option> 
<option value="Fallen Empires">Fallen Empires</option> 
<option value="The Dark">The Dark</option> 
<option value="Legends">Legends</option> 
<option value="Revised Edition">Revised Edition</option> 
<option value="Antiquities">Antiquities</option> 
<option value="Unlimited Edition">Unlimited Edition</option> 
<option value="Arabian Nights">Arabian Nights</option> 
<option value="Limited Edition Beta">Limited Edition Beta</option> 
<option value="Limited Edition Alpha">Limited Edition Alpha</option> 
</select> 
     rarity: <select class="dropdownList" id="cardRarityFilter" name="mRarity"><option value="All">All</option> 
<option value="L">Land</option> 
<option value="C">Common</option> 
<option value="U">Uncommon</option> 
<option value="R">Rare</option> 
<option value="M">Mythic Rare</option> 
</select> 
     type: <select class="dropdownList" id="cardTypeFilter" name="mType"><option value="All">All</option> 
<option value="Artifact">Artifact</option> 
<option value="Instant">Instant</option> 
<option value="Creature">Creature</option> 
<option value="Land">Land</option> 
<option value="Planeswalker">Planeswalker</option> 
<option value="Enchantment">Enchantment</option> 
<option value="Sorcery">Sorcery</option> 
</select> 
     color: <select class="dropdownList" id="cardColorFilter" name="mColor"><option value="All">All</option> 
<option value="W">White</option> 
<option value="R">Red</option> 
<option value="G">Green</option> 
<option value="U">Blue</option> 
<option value="B">Black</option> 
<option value="O">Gold</option> 
<option value="N">Colorless</option> 
</select> 
     <input type="button" value="Search" id="fetchButton" onclick="needToConfirm=false"/> 
     <div class="clear"></div> 
    </div> 
</form> 
+0

表單元素是否足夠容納'select'元素? (*用控制檯檢查*) – 2014-10-06 20:50:01

+0

他們不需要在這裏製作IE特定的樣式表。你能爲我們發佈實際的html輸出以更好地理解發生了什麼嗎? – Oneezy 2014-10-06 20:52:46

+0

我已經開始了一個特定的IE工作表,以防我必須做特定的CSS樣式,因爲IE不像其他瀏覽器那樣「妥協」。至於HTML輸出,我會挖掘它,並在一分鐘內愉快地放置它。 – hsim 2014-10-06 20:54:06

回答

1

我沒有實際測試這還沒有在IE11中,但我認爲主要問題是你的CSS這裏並沒有實際針對任何東西,

#filters ul li { 
    display: inline-block; 
    float: left 
} 

我認爲*你的意思做的是這樣的:

#filters select { 
    display: inline-block; 
    float: left 
} 

我參加了一個稍微不同的方法對HTML/CSS,所以我可以讓事情更簡單:http://jsfiddle.net/oneeezy/L8wvcppb/1/

讓我知道如果有效的話。

+0

我已經嘗試了您的建議,但可惜它不起作用。 – hsim 2014-10-07 12:32:48

+1

您可能會有更多的衝突風格影響您的佈局。我檢查了IE11,在我的js小提琴中一切看起來都很好。你有任何地方的代碼的現場版本? – Oneezy 2014-10-07 21:32:43

+1

你是對的,我經歷了代碼,並最終找到了一個地方,那些下拉列表的顯示在TABLE上顯示......談論某種方式來解決問題。非常感謝! :) – hsim 2014-10-08 12:39:31

相關問題