Jump to content

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


gorbin

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 comment
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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...