I am attempting to align the odd-numbered items to the left using float:left
, and the even-numbered items to the right using float:right
. However, it seems like every item is being considered as odd AND element 1 regardless of the actual order in the list. Is there a way to achieve this using CSS? Since each item is labeled as 1
, the usual method utilizing :nth-child(odd)
{float:left;} and :nth-child(even)
{float:right;} is not effective. Are there any alternative ways I can target them?
The structure would look something like this:
<div class="options">
<asp:ListView ID="ListView1" runat="server"
DataSourceID="OptionsObjectDataSource"
EditIndex="-1"
OnPreRender="FabricsListView_PreRender">
<ItemTemplate>
<asp:DropDownList ID="OptionsAltDropDownList" runat="server" style="width:100%"
DataSourceID="OptionsObjectDataSource"
DataTextField="description"
DataValueField="id"
AppendDataBoundItems="true"
OnDataBound="OptionsAltDropDownList_DataBound" >
<asp:ListItem Value="">- Select Alt Option -</asp:ListItem>
</asp:DropDownList>
<asp:ObjectDataSource ID="OptionsObjectDataSource"
runat="server"
SelectMethod="GetOptionList"
TypeName="Data.ProductList" >
</asp:ObjectDataSource>
</ItemTemplate>
</asp:ListView>
<asp:ObjectDataSource ID="OtherObjectDataSource" runat="server"
SelectMethod="GetByProduct"
TypeName="Data.RequirementList"
OldValuesParameterFormatString="original_{0}">
<SelectParameters>
<asp:ControlParameter ControlID="OptionHiddenField" Name="id" PropertyName="Value" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>