Click here to Skip to main content
15,889,096 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have been using two div.

but, first div overriding with second screen. it is not proper.

Also, first screen displaying in the center with overriding the second screen.

what is the problem..

ASPX Code
---------
<div class="divbody">
<div id="left" class="leftdiv">
<table>
<tr>
<td class="Labels">1.Employee</td >
</tr>
<tr>
<td class="Labels">Select Emp :
<asp:DropDownList ID="drpEmp" runat="server" class="controltext" Width="250px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True">Select Project</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="Labels">
From Wk:
<asp:DropDownList ID="drpFrmWk" runat="server" class="controltext" Width="40px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><--></asp:ListItem>
</asp:DropDownList>
From Year:
<asp:DropDownList ID="drpFrmYr" runat="server" class="controltext" Width="70px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><--></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="Labels">&nbsp;&nbsp;&nbsp;
To Wk:
<asp:DropDownList ID="drpToWk" runat="server" class="controltext" Width="40px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><--></asp:ListItem>
</asp:DropDownList>
To Year:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:DropDownList ID="drpToYr" runat="server" class="controltext" Width="70px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><--></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr align="center">
<td class="Labels">
<asp:Button ID="btnResult1" CssClass="Btn" runat="server" Text="View Chart" ToolTip="Click Here to Get Chart" width="80px"/>
</td>
</tr>
</table>
</div>
<div id="right" class="rightdiv">
<asp:Chart ID="Chart1" runat="server" TextAntiAliasingQuality="High" ImageType="Jpeg" Visible="false" Width="1200px"
BackColor="CornflowerBlue" BackSecondaryColor="FloralWhite" BackGradientStyle="TopBottom">
<Titles>
<asp:Title Name="ChartTitle" Font="Arial, 8pt" ></asp:Title>
</Titles>
<borderskin SkinStyle="Emboss">
</borderskin>
<Series>
<asp:Series Name="ColChart" ChartType="Column" IsValueShownAsLabel="True">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1" BorderColor="64, 64, 64, 64" BorderDashStyle="Solid" BackSecondaryColor="White" BackColor="AntiqueWhite"
ShadowColor="Transparent" BackGradientStyle="TopBottom" >
<area3dstyle Enable3D="True" />
<axisx LineColor="64, 64, 64, 64" Title="Week-Year" IsLabelAutoFit="true" >
<LabelStyle Font="Arial, 8pt" />
<MajorGrid LineColor="64, 64, 64, 64" />
</axisx>
<axisy LineColor="64, 64, 64, 64" Title="Allocation Value" >
<LabelStyle Font="Arial, 8pt" />
<MajorGrid LineColor="64, 64, 64, 64" />
</axisy>
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
</div>
</div>
CSS Code
--------
.divbody
{
position: relative;
margin: 2px 0px 2px 0px;
padding: 2px 5px 2px 5px;
height: auto;
width: 100%;
}
#left
{
position: relative;
height: 480px;
border: 2px, solid, #000000;
width: 30%;
}

#right
{
position: absolute;
height: 480px;
border: 2px, solid, #000000;
width: 70%;
left: 400px;
top: 0px;
overflow: scroll;
}
Posted
Updated 16-Jan-12 0:53am
v2
Comments
Tejas Vaishnav 16-Jan-12 23:14pm    
you need to remove the position from your css, you give it relative and absolute, that's why your screens are over lapping....
Tejas Vaishnav 16-Jan-12 23:20pm    
use this class...

.divbody
{
position: relative;
margin: 2px 0px 2px 0px;
padding: 2px 5px 2px 5px;
height: auto;
width: 100%;
}
.leftdiv
{
float: left;
height: 480px;
border: 2px, solid, #000000;
width: 30%;
}

.rightdiv
{
float: right;
height: 480px;
border: 2px, solid, #000000;
width: 70%;
left: 400px;
top: 0px;
overflow: scroll;
}
gani7787 17-Jan-12 0:30am    
While loading left div values showing in the mid of the screen with overlapping div2.
Why...?
see my code
-----------
<div class="divbody">
<div id="div1" class="leftdiv">
<table>
<tr>
<td class="Labels">1.Employee</td >
</tr>
<tr>
<td class="Labels">Select Emp :
<asp:DropDownList ID="drpEmp" runat="server" class="controltext" Width="250px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True">Select Project

</td>
</tr>
<tr>
<td class="Labels">
From Wk:
<asp:DropDownList ID="drpFrmWk" runat="server" class="controltext" Width="40px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><-->

From Year:
<asp:DropDownList ID="drpFrmYr" runat="server" class="controltext" Width="70px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><-->

</td>
</tr>
<tr>
<td class="Labels">   
To Wk:
<asp:DropDownList ID="drpToWk" runat="server" class="controltext" Width="40px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><-->

To Year:     
<asp:DropDownList ID="drpToYr" runat="server" class="controltext" Width="70px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><-->

</td>
</tr>
<tr align="center">
<td class="Labels">
<asp:Button ID="btnResult1" CssClass="Btn" runat="server" Text="View Chart" ToolTip="Click Here to Get Chart" width="80px"/>
</td>
</tr>
</table>
</div>
<div id="div2" class="rightdiv">
<asp:Chart ID="Chart1" runat="server" TextAntiAliasingQuality="High" ImageType="Jpeg" Visible="True"
BackColor="CornflowerBlue" BackSecondaryColor="FloralWhite" BackGradientStyle="TopBottom">
<Titles>
<asp:Title Name="ChartTitle" Font="Arial, 8pt" >
</Titles>
<borderskin skinstyle="Emboss">

<series>
<asp:Series Name="ColChart" ChartType="Column" IsValueShownAsLabel="True">


<chartareas>
<asp:ChartArea Name="ChartArea1" BorderColor="64, 64, 64, 64" BorderDashStyle="Solid" BackSecondaryColor="White" BackColor="AntiqueWhite"
ShadowColor="Transparent" BackGradientStyle="TopBottom" >
<area3dstyle Enable3D="True" />
Tejas Vaishnav 16-Jan-12 23:22pm    
and here also you use the #righ and #left its apply css on id and you do not specify the class here... and also use the css class rightdiv and leftdiv

 
Share this answer
 
CSS
.MainScreen
{
    background-color: #FFAAFF;
    width: 100%;
    height: 100%;
}
.LeftScreen
{
    float: left;
    width: 50%;
    height: 100%;
   /* white-space: nowrap;
    overflow-y: hidden; /* used to remove scroll  virtically*/
  /*  overflow-x: scroll; /* used to apply scroll  Horizontally*/
    background-color: #C1DCF3;
}
.RigthScreen
{
    float: right;
    width: 50%;
    height: 100%;
    white-space: nowrap;
    overflow-y: hidden; /* used to remove scroll  virtically*/
    overflow-x: scroll; /* used to apply scroll  Horizontally*/
    background-color: #B9FFC6;
}


HTML
<div id="divMainScreen" class="MainScreen">
        <div id="divLeftScreen" class="LeftScreen">
        <p>In object-oriented programming, a class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects</p>
        </div>
        <div id="divRightScreen" class="RigthScreen">
        <p>In object-oriented programming, a class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects</p>
        </div>
    </div>
 
Share this answer
 
If you working on a web application, this option suite your need.
Create two div, one for the left and second for the right.
See code below

--This is the HTML Code---
<div class="divbody">
<div id="left" class="leftdiv">
</div>

<div id="right" class="rightdiv">
</div>
</div>

--This is the CSS code--
.divbody
{
position: relative;
margin: 2px 0px 2px 200px;
padding: 2px 5px 2px 5px;
height: auto;
width: 100%;
}
#left
{
position: relative;
height: 800px;
border: 2px, solid, #000000;
width: 50%;
}

#right
{
position: absolute;
height: 800px;
border: 2px, solid, #000000;
width: 50%;
left: 430px;
top: 0px;
overflow: scroll;
}
 
Share this answer
 
Comments
gani7787 16-Jan-12 6:51am    
Thanks for your code..
But, my left screen position overriding with right screen.
Also, left screen displaying in center position. so right screen overriding with left screen.
what is the problem in below code.

ASPX Code
---------
<div class="divbody">
<div id="left" class="leftdiv">
<table>
<tr>
<td class="Labels">1.Employee</td >
</tr>
<tr>
<td class="Labels">Select Emp :
<asp:DropDownList ID="drpEmp" runat="server" class="controltext" Width="250px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True">Select Project

</td>
</tr>
<tr>
<td class="Labels">
From Wk:
<asp:DropDownList ID="drpFrmWk" runat="server" class="controltext" Width="40px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><-->

From Year:
<asp:DropDownList ID="drpFrmYr" runat="server" class="controltext" Width="70px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><-->

</td>
</tr>
<tr>
<td class="Labels">   
To Wk:
<asp:DropDownList ID="drpToWk" runat="server" class="controltext" Width="40px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><-->

To Year:     
<asp:DropDownList ID="drpToYr" runat="server" class="controltext" Width="70px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><-->

</td>
</tr>
<tr align="center">
<td class="Labels">
<asp:Button ID="btnResult1" CssClass="Btn" runat="server" Text="View Chart" ToolTip="Click Here to Get Chart" width="80px"/>
</td>
</tr>
</table>
</div>

<div id="right" class="rightdiv">
<asp:Chart ID="Chart1" runat="server" TextAntiAliasingQuality="High" ImageType="Jpeg" Visible="false" Width="1200px"
BackColor="CornflowerBlue" BackSecondaryColor="FloralWhite" BackGradientStyle="TopBottom">
<Titles>
<asp:Title Name="ChartTitle" Font="Arial, 8pt" >
</Titles>
<borderskin skinstyle="Emboss">

<series>
<asp:Series Name="ColChart" ChartType="Column" IsValueShownAsLabel="True">


<chartareas>
<asp:ChartArea Name="ChartArea1" BorderColor="64, 64, 64, 64" BorderDashStyle="Solid" BackSecondaryColor="White" BackColor="AntiqueWhite"
ShadowColor="Transparent" BackGradientStyle="TopBottom" >
<area3dstyle Enable3D="True" />
<axisx linecolor="64, 64, 64, 64" title="Week-Year" islabelautofit="true">
<LabelStyle Font="Arial, 8pt" />
<majorgrid linecolor="64, 64, 64, 64">

<axisy linecolor="64, 64, 64, 64" title="Allocation Value">
<LabelStyle Font="Arial, 8pt" />
<majorgrid linecolor="64, 64, 64, 64">
ahmedfaruk88 16-Jan-12 7:17am    
Post your CSS code and let me review it. And also i cant see the closing tag of your second div control <div id="right" class="rightdiv">

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900