federal24 195 Posted October 30, 2016 Report Share Posted October 30, 2016 Как сделать чтобы переносился логотип (типа для мобильной версии сайта) по центру, без использования медиа запросов. html: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="stylesheet/stylesheet.css"> <title>Document</title> </head> <body> <header> <div class="wrapper"> <div class="logo"> <a href="#"><img src="img/MobileApp.png"></a> <p class="desk">Your Mobile App Slogan</p> </div> <div class="menu"> <ul> <li><a href="#">Home</a></li> <li><a href="#">Features</a></li> <li><a href="#">Support</a></li> <li><a href="#">Download</a></li> <li><a href="#">Contact</a></li> </ul> </div> </div> </header> </body> </html> css: *{ margin: 0; padding: 0; } body{ background-color: #101010; } header{ max-width: 1200px; background-color: #fff; margin: 0 auto; } .wrapper{ height: 138px; max-width: 950px; margin: 0 105px 0 125px; display: -webkit-flex; display: -moz-flex; display: -ms-flex; display: -o-flex; display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; background-color: #ae1; } .menu{ background-color: #e1a; } .menu ul li{ list-style: none; display: inline-block; padding: 0 20px; } .menu ul li a{ font-size: 14px; } .menu ul{ text-decoration: none; color: #0c9bdd; } .desk{ font-size: 11px; } .logo{ background-color: #aaa; } img{ } Если поставить justify-content: space-around, проблема решается, но появляются отступы с лева и с права. Link to post Share on other sites
INWOXER 75 Posted October 30, 2016 Report Share Posted October 30, 2016 Ну так для мобильной версии медиа запрос нужен будет. Если на уровне html - то <center> Link to post Share on other sites
federal24 195 Posted October 30, 2016 Author Report Share Posted October 30, 2016 При уменьшении окна браузера, когда меню сталкивается с лого, меню переносится ниже лого, а лого Остаётся с левой стороны. Если поставить justify-content: space-around, при сталкивании лого переносится по центру, а меню под ним также по центру. Но тогда они изначально стоят с отступами от краёв. Link to post Share on other sites
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now