cataract777 Posted June 26, 2009 Share Posted June 26, 2009 Hi guys, I'm using HTML, and am not creating a website necessarily on the internet, am just practicing using notepad. Now I have embedded this chat room in the center of the page and wanted to embed another object or picture right next to it on the right, but whenever I try to do that is gos to the next line. You guys may be thinking...well, is the object or photo big enough to fit in that space to the right of the embedded object? Yes, it should fit just fine. but instead the object I want to embed goes beneath it. Can anyone help me? I tried the <align="right"> code and it didn't work, am I putting it in the wrong place?Thanks to whoever helps-Alex Link to comment Share on other sites More sharing options...
Ingolme Posted June 27, 2009 Share Posted June 27, 2009 If the object is a block element then you'll have to use CSS's float property. Link to comment Share on other sites More sharing options...
dsonesuk Posted June 27, 2009 Share Posted June 27, 2009 try this layout <html><head><title>Untitled Document</title><style type="text/css">.outer_container { border: 1px solid #000; text-align:center}.inner_container { width: 960px; border: 1px solid #000; overflow:hidden; margin: 0 auto;}.div_one{ float: left; width: 636px; border: 1px dashed red;}.div_two{ float:left; width: 320px; border: 1px dashed lime;}</style></head><body><div class="outer_container"><div class="inner_container"><div class="div_one">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</div><div class="div_two">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</div></div></div></body></html> Link to comment Share on other sites More sharing options...
mmcspadden Posted June 29, 2009 Share Posted June 29, 2009 For future notice, posting your code would help some. The major problem seems to be that whatever tags you are using are simply by default going below the tag above it. To fix this you have two options. The simplest would be to simply do something like this. <table> <tr> <td>"Chat Room Code"</td> <td>"Picture"</td> </tr></table> That would work to get them on the same line, then simply adjust the width as needed. A more proper way to do it (since tables aren't really supposed to be used for layout, though they are a very simple way to get started), would be to use divs rather than tables. I believe dsonesuk posted a layout using divs and CSS, if you arefamiliar enough with CSS that would be the more proper way to go. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.