Jump to content

[SOLVED] IE won't put divs on the same line


jordanwb

Recommended Posts

That's probably because you have a lot of margin on the divs. Reduce the margin on the facing sides until the combined total of the margin is equal to the distance you want between them. So, for instance, if you wanted 20px between the divs, your margin structure would be something like this:

#left-col {
  margin: 20px 10px 20px 20px;
}

#center-col {
  margin: 20px 10px;
}

#right-col {
  margin: 20px 20px 20px 10px;
}

 

This way, the total margin between all elements is 20px.

Link to comment
Share on other sites

Well, here's another way to be sure your center one is truly centered:

 

HTML:

<div id="left-col">asdfdf</div>
<div id="right-col">adfasdf</div>
<div id="center-col">asdfsdaf</div>

 

CSS:

#left-col {
  float: left;
  width: 100px;
}

#right-col {
  float: right;
  width: 100px;
}

#center-col {
  margin: 0 110px;
}

 

That way, you float your side columns and just put enough margin on your center content to assure that you clear your sides. Also, this centers your middle column, too.

Link to comment
Share on other sites

You keep saying that these examples won't work, but you aren't sharing any code or examples of your implementation with us. I know for a fact these will work in both FF and IE. In fact, I just put this last example together in a sample layout for you to look at in action. This works as-is in both FF and IE6 (just tested). Feel free to pull it apart and do whatever you want with it:

 

http://code.guahanweb.com/test_layout.html

Link to comment
Share on other sites

You keep saying that these examples won't work, but you aren't sharing any code or examples of your implementation with us.

 

Yes I did, I gave the link, you looked at it yourself. I'll try it again to get the divs to work.

 

A link to code you are currently working on doesn't much aid in the debugging process when it's changing, though ;)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.