Help with Positioning

Hello Sitepoint fellows,

I am trying to position and image on the left side of the page, and have written work beside it, on the right. I tried using overflow:hidden, along with setting the two divs(one for the image, one for the written work). Any suggestions? Thank you!

<html lang = "en">
  <meta charset = "utf-8"/>
  <link href = "style1.css" rel = "stylesheet" type = "text/css"/>
<div id = "header">
  <div id = "title">
  </div> <!-- end of title -->
  <div id = "login">
    <p>User name : XXXXXX</p>
    <p>Password : XXXXX</p>
  </div> <!-- end of login -->
</div> <!-- end of header -->
<div id = "mid">
<div id = "navigation">
  <li><a href = "main.html">Main</a></li>
  <li><a href = "about.html">About</a></li>
</div> <!-- end of navigation -->

  <div id = "paragraph">
      <div id = "image">
    <img src = "bobby.jpg" width = "160" height = "320" alt = "This is Bobby's face!"/>
  </div> <!-- end of image -->
  </div> <!-- end of paragraph -->
</div> <!-- end of mid -->
/* CSS for folder "Bobby" */

body {
  background-color: blue;

#header { overflow: hidden; }

#title {
  font-size: 130%;
  float: left; }

#login {
  float: right; }

#mid { overflow: hidden; }

#image { float: left;

#paragraph { float: right; }

Just create one div

remove #image from your css


create in your css

#paragraph img {

<div id=“paragraph”>
some text you want
<img src = “bobby.jpg” width = “160” height = “320” alt = “This is Bobby’s face!”/>

or just do the following, either way you still want to remove #image from your css

<div id=“paragraph”>
some text you want
<img style=“float:left” src = “bobby.jpg” width = “160” height = “320” alt = “This is Bobby’s face!”/>

I would also suggest using classes instead of id’s this way you can use the styling across mutlple pages easier…


Plz i gat a question?
How do i place some text beside an image? Whenever i try it, the text goes to the lower part of the image.

Do you mean you want the text aligned at the top of the image, rather than the bottom? Or do you want the text aligned vertically to the middle of the image?

Show us the HTML and CSS you’re using, and we’ll have a better idea of what you’re trying to achieve and how to help.

I was able to place the image and the text side-by-side by using the method you (TechnoBear) gave me when i needed help for tables. What i want to know now is how to align the image to the center and let the text be below the image in another line.
I can’t drop the html and css now, cos am on mobile. TIA.

Hey Black Max

Why did you edit my post… I have no signature, haven’t created one. Are you saying what I end every post with is a fake sig?

Please respond…

Never mind I re-read the rules and I understand why you think it’s a fake. Sorry, but it’s just what I normally add to my post. I will withhold posting it in the future…

But for the record, It was never intended to be a signature… I even told Sarah in the greeting email I use it on every post and nothing was said about it. Does that make a difference…

Well, without the code I’m still guessing at what you’re trying to achieve. If it’s something like an image with a caption, so you want the caption centred, too, you could use:

<div id="whatever">
<img src="foo" width="x" height="y" alt="description">
<p>Your text goes here</p>


#whatever {text-align: center;}

Okies, Thanks. I’ll try it and get back to you.