Jump to content

How to resize <img> in <div> with float:left?

Recommended Posts

I've got problem, how to automatic resize height of in . Here I'am trying to make pure css slideshow, and its works, but when I scale browser window widthchanges and height - doesn't. Why? and how to fix this? more of all I'll try to use different hack/advices and use a lot of them here, but it didnt work. When I change width manualy(in css), height changes.I found that problem may be in #slides{width: 500%;...} , but I need it! How to change height dynamic in this examples? p.s. sorry for my bad english...I hope you understand me....p.p.s. what I want Is adopt it for mobile devices. I know about @media but trying to make it without it.. Tnx for any help...

Edited by gorbin
Link to post
Share on other sites

Edit:I see what you're trying to do, I'll have to look into it. ----It is difficult to understand your problem. Try to explain it in short sentences. A percentage width is based on the width of the closest ancestor element that has a width, if there is none then it is based on the width of the windows. Setting width to 500% is most likely making the element 5 times wider than the window. On a separate note: An element that doesn't have height set with CSS will change its height to hold all the text that is inside it. If you make the width smaller, the text will take more vertical space to the height will be bigger.

Link to post
Share on other sites

Join the conversation

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

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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