Absinthe Posted July 20, 2012 Report Share Posted July 20, 2012 Есть блок parent шириной 600 пикселей.В нем может быть блок right и блок mainА может быть только main.Ширина блока right 100 пикселей.Как сделать ширину блока main такой, чтобы она занимала все оставшееся пространство parent?Т.е. либо 500, либо 600 пикселей. Quote Link to comment Share on other sites More sharing options...
0 USF Posted July 20, 2012 Report Share Posted July 20, 2012 (edited) http://jsfiddle.net/ZmyDa/1/в общем не нужно задвать main ширины. блочный и так занимает все доступное пространство по ширине. Edited July 20, 2012 by USF Quote Link to comment Share on other sites More sharing options...
0 Absinthe Posted July 21, 2012 Author Report Share Posted July 21, 2012 А как оно работает?Почему overflow: hidden убирает обтекаемость? Quote Link to comment Share on other sites More sharing options...
0 USF Posted July 21, 2012 Report Share Posted July 21, 2012 оно и без overflow: hidden будет работать, просто если высота обтекаемого блока станет выше, то он будет обтекать(простите за тавтологию) плавающий блок. Поэтому мы с помощью трюка с overflow отменяем обтекание. Quote Link to comment Share on other sites More sharing options...
0 Absinthe Posted July 22, 2012 Author Report Share Posted July 22, 2012 Спасибо Quote Link to comment Share on other sites More sharing options...
Question
Absinthe
Есть блок parent шириной 600 пикселей.
В нем может быть блок right и блок main
А может быть только main.
Ширина блока right 100 пикселей.
Как сделать ширину блока main такой, чтобы она занимала все оставшееся пространство parent?
Т.е. либо 500, либо 600 пикселей.
Link to comment
Share on other sites
4 answers to this question
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.
Note: Your post will require moderator approval before it will be visible.