Jump to content

[SOLVED] div width


jaymc

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.