Dathremar Posted December 25, 2011 Share Posted December 25, 2011 I will try to explain the problem as much as I can before posting the code. I have a div which's width is determined by the size of the content. It contains two div's, one is the div which contains the picture and the second one is the div that has the description of the picture: date of upload and name of the file (this needs to be glued to the right side of the div). Here is the html code for it: <div class="box"> <div class="picture"> <img src="path/to/img" alt="" /> </div> <div class="description"> <span id="date">date of upload</span> <span id="picture_name">picture_name</span> </div> </div> And the problem here is when I have small pictures the "description" row can't get the width I need without breaking (because I am putting float right on the picture name). The file name goes on other row. The question is how to stretch the row, so the date and picture name are on the same row? Quote Link to comment https://forums.phpfreaks.com/topic/253821-stretching-divs-width/ Share on other sites More sharing options...
sunfighter Posted December 25, 2011 Share Posted December 25, 2011 I'm sure your not giving us all the info we need. The widest div : either the picture div or the description div will determine the width of the box div. Nothing should break. Picture on top date and name on the bottom. (because I am putting float right on the picture name) Kinda tells me you have given the box div dimensions. Lets see the whole code, please. Or remove the width of the box div. Quote Link to comment https://forums.phpfreaks.com/topic/253821-stretching-divs-width/#findComment-1301266 Share on other sites More sharing options...
Dathremar Posted December 25, 2011 Author Share Posted December 25, 2011 True what You say that the widest div gives the width of the box. The problem is (and I think it is only in IE9) that when the width of the div should be determined by the width of the description row, it pushes the floated span in the next row. There is nothing more to the code because this is a absolute positioned div on the screen (like a lightbox) Quote Link to comment https://forums.phpfreaks.com/topic/253821-stretching-divs-width/#findComment-1301268 Share on other sites More sharing options...
sunfighter Posted December 26, 2011 Share Posted December 26, 2011 Let me rephrase that: You say "I am putting float right on the picture name" but you do not give us that code. you say "because this is a absolute positioned div" but you do not give us that code. PLEASE give us the ENTIRE code for this. Quote Link to comment https://forums.phpfreaks.com/topic/253821-stretching-divs-width/#findComment-1301404 Share on other sites More sharing options...
deathadder Posted January 10, 2012 Share Posted January 10, 2012 we need the css file i think because we cant do anything with the code you supplied it it looks like its all linked through your css file Quote Link to comment https://forums.phpfreaks.com/topic/253821-stretching-divs-width/#findComment-1306091 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.