-1

I have a dropdown list aligned with textbox and i want to add a div that has a classed called ok , this class adds a backgroundimage to that div.

The problem is that the image is not aligned with the other content.

 <div class="form-group form-inline"  id="divReservaCanchas" runat="server" >

                <asp:DropDownList ID="ddlCanchas" runat="server" CssClass="form-control"Width="175px"
                    DataTextField="16" AutoPostBack="True" 
                    OnSelectedIndexChanged="ddlCanchas_SelectedIndexChanged">
                    <asp:ListItem Selected="True">Canchas</asp:ListItem>
                </asp:DropDownList>
                <div class="ok" ></div>

Here is the css.

.ok
{
background-image: url(../img/Glyphicons/ok.jpg);
background-repeat: no-repeat;    
height: 25px;
width: 25px; 
display:inline; 
}
1
  • What do you mean 'aligned'? Where is the image supposed to sit?
    – Rook
    Jul 23, 2014 at 0:01

1 Answer 1

0

You cannot set width and height to inline elements. To apply width and height, set css property display to inline-block.

Change:

display:inline;

To

display:inline-block; 

JSFiddle Demo

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.