Question: I am new to css and need your guidance. I have a an image background and 2 test lines needs to be placed in that.The top distance between text and image top border should be 50 px. Below to this text there is another text. The distance between these 2 text is 10px. And the distance between the second text(lower text) and the lower end of the image should be 40 px.
I have come up with the below code. Do I need to hardcode height for the first class to be 100px? If I do that the two text becomes too congested. Please let me know if the below code is correct

**HMTL**

```
<div class="header1">
    <div class="header2" >
        The first text goes here
    </div>
    <div class ="header3">
        The second small tesxt goes here
    </div>
</div>

```

**CSS**

```
.header1{
    display: block;
    background-image: url("1.jpg");
    background-repeat:no-repeat;  
}
.header2{
    font-family: Arial;
    font-size:42px;
    color:#FFFFFF;
    height:50px;
    margin-top:50px;
    margin-left: 170px;
    margin-bottom:10px;
}
.header3{
    font-family: Arial;
    font-size:16px;
    color:#FFFFFF;
    height:40px;
    margin-left: 170px;
    margin-top:10px;
    margin-bottom:40px;
}

```

Answer: 
Your grid doesn't set the DataKeyNames property, so this grid isn't tracking any datakeys. Probably thats why you are getting an index error.

You should set the DataKeyNames property. In your code you also need to check to make sure the collection contains elements.The datakeys collection itself may not be null, but it can contain zero elements.
Your forgot to add DataKeyNames to your gridview

```
DataKeyNames="Valid Column Name" //Column name here instead of Valid Column name

```

Full Code below :

```
<asp:GridView ID="GridView1" DataKeyNames="Valid Column Name"  CssClass="HeaderTables" runat="server" AllowPaging="True" 
    EmptyDataText="There is no data record to display"
    AllowSorting="True" AutoGenerateColumns="false"
    CellPadding="0" Height="0px" Width="800px"
    onpageindexchanging="GridView1_PageIndexChanging" 
    onsorting="GridView1_Sorting" onrowdeleting="GridView1_RowDeleting">
    <Columns>
        <asp:BoundField DataField="first_name" HeaderText="First name"/>
        <asp:BoundField DataField="last_name" HeaderText="Last name"/>
        <asp:BoundField DataField="mobile_phone" HeaderText="Mobile number"/>
        <asp:BoundField DataField="email" HeaderText="Email"/>
        <asp:BoundField DataField="city" HeaderText="City"/>
        <asp:BoundField DataField="street_number" HeaderText="Street number"/>

        <asp:CommandField ShowEditButton="True" ButtonType="Button" />
        <asp:CommandField ShowDeleteButton="True" ButtonType="Button" />
    </Columns>
    <HeaderStyle HorizontalAlign="Left" />
    <RowStyle HorizontalAlign="Left" />
</asp:GridView>  

```