freeek Posted December 11, 2010 Report Share Posted December 11, 2010 решил написать резиновое меню с простым концептом:<div id="menu"><span>menu element 1</span><span>menu element 2</span><span>menu element 3</span></div>на div решил указать text-align: justify и на кажды span небольшие горизонтальные padding'и. тоесть весь мой css выглядит так:#menu {text-align: justify;}#menu span {padding: 0 5px;}но текст не тянется на ширину div'a и располагается слева. нужен совет по исправлению или новый концепт (желательно первое). Quote Link to comment Share on other sites More sharing options...
0 Great Rash Posted December 11, 2010 Report Share Posted December 11, 2010 http://forum.htmlbook.ru/index.php?showtopic=20735 Quote Link to comment Share on other sites More sharing options...
0 freeek Posted December 11, 2010 Author Report Share Posted December 11, 2010 турбоспасибо. применю данный способ обязательно, но был бы ещё благодарен если б мне пояснили что не так с моим концептом. Quote Link to comment Share on other sites More sharing options...
0 Great Rash Posted December 11, 2010 Report Share Posted December 11, 2010 Первая строка текста не растягивается согласно спецификации CSS2:In the case of 'justify', this property specifies that the inline-level boxes are to be made flush with both sides of the block container if possible, by expanding or contracting the contents of inline boxes, else aligned as for the initial value.По этому нужно использовать либо CSS3 свойства, в частности text-align-last или различные ухищрения типа дополнительных блоков, растянутых на ширину контента. Quote Link to comment Share on other sites More sharing options...
Question
freeek
решил написать резиновое меню с простым концептом:
на div решил указать text-align: justify и на кажды span небольшие горизонтальные padding'и. тоесть весь мой css выглядит так:
но текст не тянется на ширину div'a и располагается слева. нужен совет по исправлению или новый концепт (желательно первое).
Link to comment
Share on other sites
3 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.