473,327 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Image and Div side by side

Hello,

I have a container div and inside it I have an image and another div
which I want to place side by side:

<div id="container">
<img id="image"/>
<div id="content">
</div>

Is it possible to float the image left and the div right and make them
side by side with CSS?

I know how to do this by placing the image inside another div but I
would like to avoid that.

Thanks,
Miguel

Dec 22 '06 #1
2 9686
Scripsit shapper:
<div id="container">
<img id="image"/>
<div id="content">
</div>
You should have posted a URL and not a fragment of HTML, which isn't even
what you've really got (you hardly have that badly invalid markup).
Is it possible to float the image left and the div right and make them
side by side with CSS?
Yes. What's the problem with that? You need to set the width for the div, of
course. And if they are just floated that way, they might appear rather far
from each other, but that's really what you asking for.

Or maybe you actually want them to appear _near_ to each other, on the left.
Then float both of them left (and set some reasonable margin between them).
I know how to do this by placing the image inside another div but I
would like to avoid that.
Why would you avoid that, and what have you really done? Telling the URL
might reveal what the desired appearance really is.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Dec 22 '06 #2
shapper wrote:
Hello,

I have a container div and inside it I have an image and another div
which I want to place side by side:

<div id="container">
<img id="image"/>
<div id="content">
</div>

Is it possible to float the image left and the div right and make them
side by side with CSS?
Yes, but depending on what you want to do and on dimension requirements,
you may not need to float the div at all since the div will
automatically flow to the right of the image.
I know how to do this by placing the image inside another div but I
would like to avoid that.
I don't understand why you would want to do that. You can float the
image directly without placing it into a div.

--
Gus
Dec 23 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Stanimir Stamenkov | last post by:
I have this kind of construct: http://www.geocities.com/stanio/temp/usemap01.html (an IMG element using MAP described with AREA elements) I'm trying to make it more accessible and currently...
1
by: Hardy Wang | last post by:
Hi, I found a piece of code to add drop shadow to a photo like below, after I save the image, it is actually a BMP file even though I specify a JPG file extension (see...
4
by: shawn | last post by:
I have a simple script located here which loads different images when you click on some links. Everything works fine until you click on the last link which opens a popup window (zoom image). ...
9
by: zacariaz | last post by:
I dont know, and i dont much like javascript, however, i am told that the only way to do want i want to do, is with javascript, so here goes. zoom and cut is the only features i need. 1. the...
3
by: jackiepatti | last post by:
QUESTION: I have a web page containing a form that contains an image instead of a submit button, e.g. <form name='myform' action='get' method='otherpage.asp'> <input type='image'...
9
by: shapper | last post by:
Hello, What is the best way to place an image and a text side by side using CSS? Basicaly what I am trying to do is to make the image and the text to appear as follows: Image My Text......
6
by: nuhura01 | last post by:
Hi all... My system contains an image which I have saved it at client side. Unfortunately, when users want to view the image, the image doesn't loaded. If i'm not mistaken, it is set at the HTML...
3
by: Nebulism | last post by:
Hi everyone, I am working on a module for my GUI that shows one image with an index value below and would use a scrollbar to control which of the images are displayed. The images are stored in a...
32
by: C. (http://symcbean.blogspot.com/) | last post by:
Hi all, I have an application which generates image graphs. These cache nicely at the client, however if the user submits more data, I'd like to force a reload of the image from the server. I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.