what CSS style am I missing here?

J

Jeff

hi

asp.net 3.5

I want the first 2 divs to be displayed on the same row, but when I run this
in IE7 each div has it's own line:

example of how it's displayed:
dd.mm.yyyy
HelloWorld

example of how I want it to look:
dd.mm.yyyy HelloWorld

(the max width is 369px, so more than enough to have 2 divs on the same
line)

<td valign="top" style =" background-color:Yellow;">
<div style="background-color:Green; width:120px;"> <<<----- div #1
<asp:Literal ID="litDate1" runat="server" ></asp:Literal>
</div>
<div style="background-color:purple; width:120px;"> <<<------ div #2
<asp:Literal ID="litTitle1" runat="server"></asp:Literal>
</div>
<div style="background-color:Aqua;">
<asp:Literal ID="litContent1" runat="server"></asp:Literal>
</div>
</td>

any ideas?
 
G

Guest

hi

asp.net 3.5

I want the first 2 divs to be displayed on the same row, but when I run this
in IE7 each div has it's own line:

example of how it's displayed:
dd.mm.yyyy
HelloWorld

example of how I want it to look:
dd.mm.yyyy   HelloWorld

(the max width is 369px, so more than enough to have 2 divs on the same
line)

<td valign="top" style =" background-color:Yellow;">
 <div style="background-color:Green; width:120px;">  <<<----- div #1
     <asp:Literal ID="litDate1" runat="server" ></asp:Literal>
 </div>
 <div style="background-color:purple; width:120px;">    <<<------ div #2
     <asp:Literal ID="litTitle1" runat="server"></asp:Literal>
 </div>
 <div style="background-color:Aqua;">
     <asp:Literal ID="litContent1" runat="server"></asp:Literal>
 </div>
</td>

any ideas?

Hi Jeff

try

<td valign="top" style =" background-color:Yellow;">
<div style="background-color:Green; width:120px;float:left">
<<<----- div #1
<asp:Literal ID="litDate1" runat="server" ></asp:Literal>
</div>
<div style="background-color:purple; width:120px;float:right">
<<<------ div #2
<asp:Literal ID="litTitle1" runat="server"></asp:Literal>
</div>
<div style="background-color:Aqua;">
<asp:Literal ID="litContent1" runat="server"></asp:Literal>
</div>
</td>

Hope this helps
 
H

Hal Rosser

I want the first 2 divs to be displayed on the same row, but when I run
this in IE7 each div has it's own line:

example of how it's displayed:
dd.mm.yyyy
HelloWorld

example of how I want it to look:
dd.mm.yyyy HelloWorld

(the max width is 369px, so more than enough to have 2 divs on the same
line)

<td valign="top" style =" background-color:Yellow;">
<div style="background-color:Green; width:120px;"> <<<----- div #1
<asp:Literal ID="litDate1" runat="server" ></asp:Literal>
</div>
<div style="background-color:purple; width:120px;"> <<<------ div #2
<asp:Literal ID="litTitle1" runat="server"></asp:Literal>
</div>
<div style="background-color:Aqua;">
<asp:Literal ID="litContent1" runat="server"></asp:Literal>
</div>
</td>
Use the Display property and put it inline instead of block
Look at this site:
http://www.w3schools.com/css/pr_class_display.asp
W3Schools has some good tutorials.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top