Расположение блоков новостей, с помощью html и css
Здравствуйте.
Подскажите пожалуйста как можно расположить div блок справо от превью новостей? Пример изобразил на картинке. ![]() |
Не список конечно... Но как вариант.
<!DOCTYPE html> <html> <head> <meta http-equiv='Content-Type' content='text/html; charset=windows-1251' /> <!-- <script src='http://code.jquery.com/jquery-latest.js'></script> <script src="https://code.angularjs.org/1.3.9/angular.min.js"></script> <script src="https://code.angularjs.org/1.3.9/angular-route.js"></script> --> <style type='text/css'> * { margin: 5px; } #container { width: 345px; border: 1px solid; } #right { float: right; width: 100px; height: 215px; border: 1px solid; } .item { display: inline-block; width: 100px; height: 100px; border: 1px solid; } </style> <script type='text/javascript'> </script> </head> <body> <div id='container'> <div id='right'></div> <div class='item'></div> <div class='item'></div> <div class='item'></div> <div class='item'></div> <div class='item'></div> <div class='item'></div> <div class='item'></div> </div> </body> </html> |
Вот и со списком... Т.с. частный случай.
<!DOCTYPE html> <html> <head> <meta http-equiv='Content-Type' content='text/html; charset=windows-1251' /> <!-- <script src='http://code.jquery.com/jquery-latest.js'></script> <script src="https://code.angularjs.org/1.3.9/angular.min.js"></script> <script src="https://code.angularjs.org/1.3.9/angular-route.js"></script> --> <style type='text/css'> * { margin: 5px; } #container { position: relative; width: 330px; overflow: hidden; border: 1px solid; } #right { position: absolute; top: 0; right: 0; width: 100px; height: 210px; background-color: red; } ul { margin: 0; padding: 0; overflow: hidden; } li { float: left; width: 100px; height: 100px; list-style-position: inside; list-style-type: none; background-color: green; } li:nth-child(3), li:nth-child(5) { clear: left; } </style> <script type='text/javascript'> </script> </head> <body> <div id='container'> <div id='right'></div> <ul> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> </div> </body> </html> |
Спасибо. Красиво отображается, только ищу вариант без использования дополнительных js https://i.imgur.com/micpyaL.png
Кстати мне еще подсказывали люди masonry.desandro.com |
Цитата:
|
Часовой пояс GMT +3, время: 09:50. |