RKh
RKh

Reputation: 14159

Input Boxes not aligning even after setting padding and margins

I am using following CSS code to align Input Boxes, but still nothing seems to work:

.EntryFormDiv.input
{
 padding-left: 100px;
 margin-left: 100px;
 left: 50px;
 width: 80px;
 text-transform: capitalize; 
}

What is the problem? I have added this class name on all the Input definitions.

Edited **

<div id="divBooksEntryForm" class="EntryFormDiv" runat="server">
    <label id="lblBookName" class="label" runat="server">Title of the Book: </label>
    <input id="inpBookName" class="input" runat="server" /><br />
    <label id="lblAuthor" class="label" runat="server">Author: </label>
    <input id="inpAuthor" class="input" runat="server" /><br />
    <label id="lblPublisher" class="label" runat="server">Publisher: </label>
    <input id="inpPublisher" class="input" runat="server" /><br />        
    <label id="lblCategory" class="label" runat="server">Category: </label>
    <input id="inpCategory" class="input" runat="server" /><br />
    <label id="lblSubCategory" class="label" runat="server">Sub-category: </label>
    <input id="inpSubCategory" class="input" runat="server" /><br />
    <label id="lblPurchaseDate" class="label" runat="server">Dt. of Purchase: </label><br />

Upvotes: 0

Views: 198

Answers (1)

kapa
kapa

Reputation: 78741

1 - Put a space between these:

.EntryFormDiv .input

What you wrote means: items that has both the classes .EntryFormDiv and .input. But with the space, it means items with class .input inside items with class .EntryFormDiv.

2 - Left can only be applied if position is other than static.

Upvotes: 2

Related Questions