0

Hey guys.

I have a code that i'm trying to build with 2 nested divs that i want to align beside each other. i'm not sure if the below is the best way to go about it but it's the only way i could think of. only thing is that the div always just ends up under the one above it (in the nest).

So please, any guidance is UBER-appreciated.

Thanx
(i don't mind... let me know what i'm doing wrong.)

<div id="main" style="width: 1265px; height: 560px; overflow: auto;"> <!-- Middle -->
    <div id="leftmain" align="left" style="width: 705px; height: 560px; ">
        <table>
            <tr id="row">
                <td>
                    <img src="church.jpg" /></td>
                <td>
                    <img src="church.jpg" /></td>
                <td>
                    <img src="church.jpg" /></td>
             </tr>
        </table>
    </div>

	<div id="rightmain" align="right" style="width: 560px; height: 560px; ">
        <table>
            <tr id="row">
                <td>
                    1<img src="1.jpg" /></td>
                <td>
                    2<img src="2.jpg" /></td>
                <td>
                    3<img src="3.jpg" /></td>
                
            </tr>
        </table>
    </div>
	
	
	    <script type="text/javascript">
     var td = row.firstChild;
     function animate() {

         someID.scrollLeft = td.offsetLeft;
         if (td == row.lastChild)
             td = row.firstChild;
             else
                 td = td.nextSibling;
             setTimeout("animate()", 8000);
         }
         animate();
    </script>
	
</div>
2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by leroi green
0

By default, divs are block level elements, and won't allow other elements to lay next to them. You can fix this by setting the inner divs style to either float:left and float:right, or you can use display:inline for both. If you use display:inline, make sure that the sum of the width of your inner divs is slightly less than your main div.

0

Thanx a lot! I knew it could be done but I just needed a lil guidance. Really helps!


Peace!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.