Search code examples
htmlasp.netcssvisual-studio-2012content-pages

How to display images vertically


I have an ASP.NET Website Content Page that uses a Master Page, in Visual Studio.
There are images displayed horizontally, but I want them to be vertical, like in a column.

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        <img alt="" class="auto-style2" src="Images/0cropped.jpg" id="0" />
        <img alt="" class="auto-style3" src="Images/1bCropped.jpg" id="1" />
        <img alt="" class="auto-style4" src="Images/2cropped.jpg" id="2" />
        <img alt="" class="auto-style5" src="Images/5cropped.jpg" id="5" /></p>
</asp:Content>

CSS:

img
{
float:left;
}  

Solution

  • I arranged them in a GridView. The images are populated from "ObjectDataSourceDoctor".

            </ItemTemplate>
            </asp:TemplateField>
            <asp:ButtonField AccessibleHeaderText="Save Rating" HeaderText="Save Rating" Text="Save" />
            <asp:CheckBoxField DataField="fave" HeaderText="Favorite" SortExpression="fave" InsertVisible="False" Visible="True" />
        </Columns>
    </asp:GridView>