Jump to content

Recommended Posts

How do I apply a width to a div in firefox

 

I have the following code working fine in IE, but not in firefox

 

<div align=center style="display:inline; width:50%;">No Comments</div>

 

<div align=center style="display:inline; width:50%;"><img src=galcoms.gif style="border-style:none;"></div>

 

Im tryig to make the divs act as 2 TDs, so content next to each other but spaced out on the one line

 

Any ideas

Link to comment
https://forums.phpfreaks.com/topic/65491-solved-div-width/
Share on other sites

use floats instead:

<div align=center style="float:left; width:50%;">No Comments</div>

<div align=center style="float:left; width:50%;"><img src="galcoms.gif" style="border-style:none;"></div>

 

Note after those two divs you'll need to clear the float, by adding clear:both to an element after those two divs.

Link to comment
https://forums.phpfreaks.com/topic/65491-solved-div-width/#findComment-327035
Share on other sites

Isnt there a float:center

 

Im trying to use it with 3 divs, but sometimes the first div has no content in it as the content is provided dynamically

 

If I have 3 divs in a row using float and there is no content in div1 then div2 appears over to the left

Link to comment
https://forums.phpfreaks.com/topic/65491-solved-div-width/#findComment-327084
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.