How to move third element in block down with flexbox? - html

How move third element down, that first block with logo, and second other full width contain another panel,and down will be another panel?
this block (pastenow.ru/57IX6) need to move and it must be like this : pastenow.ru/57IXE
<nav class="navbar">
<!--start of top_panel-->
<div class="logo"><img src="img/logo.png" alt=""> </div>
<div class="panel">
<div class="nav_title">С нами ловят все!</div>
<div class="phone">8 800 553535</div>
<div class="address_wrapper">
<div class="address">Павлодар, ул. Мира 7</div>
<div class="address">Павлодар, ул. Мира 8</div>
</div>
<div class="call_btn def_btn">Заказать звонок</div>
</div>
<!--end of top_panel-->
<!--start of bottom_panel-->
<div class="bottom_panel">
<div class="main">Главная</div>
<div class="about_us">компании</div>
<div class="tournament">Турниры</div>
<div class="goods">Товары</div>
<div class="news">Новости</div>
<div class="photo">Фото</div>
<div class="video">Видео</div>
<div class="contact">Контакты</div>
<div class="social_icons_wrapper">
<div ><i class="fa fa-youtube icon_size" aria-hidden="true"></i></div>
<div ><i class="fa fa-instagram icon_size" aria-hidden="true"></i></div>
<div ><i class="fa fa-vk icon_size" aria-hidden="true"></i></div>
<div ><i class="fa fa-whatsapp icon_size" aria-hidden="true"></i></div>
<div><i class="fa fa-telegram icon_size" aria-hidden="true"></i></div>
</div>
</div>
<!--end of bottom_panel-->
if add flex-wrap: wrap; so all goes down, but i need only one.
css
.container{
width: 1170px;
height: auto;
min-height: 100vh;
display: flex;
flex-wrap: wrap;
justify-content: center;
margin: auto;
font-family: "Museo Cyrl 900";
}
.header_line{
width: 100%;
height: 122px;
background-color: #fff;
}
.navbar{
width: 100%;
display: inline-flex;
justify-content: space-between;
}
.logo{
width: 200px;
height: auto;
}
.panel{
width: 100%;
display: inline-flex;
justify-content: space-between;
}
.bootom_panel{
width: 100%;
display:inline-flex;
justify-content: flex-end;
}

I have made a codepen demo with slight adjustments in the layout which you have provided. Please click on this link: https://codepen.io/ArunK_UI/pen/qwbXLm?editors=1100
Major change here is I have wrapped upper panel and lower panel in one wrapper and then gave them respective properties.
<div class="panel-wrap">
<div class="panel"></div>
<div class="bottom_panel"></div>
</div>

Related

How to display items aligned?

this is for sure a common question but text-align and display properties are not solving it, so i must have some mistake.
What should i do to display the 3 items in the same horizontal line?
.contact__information {
vertical-align: middle;
margin-bottom: var(--mb-1);
padding-right: var(--mb-.75);
align-items: right;
text-align: center;
display: inline-flex;
margin-left: auto;
margin-right: auto;
}
<section class="contact section" id="contact">
<h2 class="section__title">Contacte</h2>
<span class="section__subtitle">Contacte para mais informações</span>
<div class="contact__information">
<i class="uil uil-phone contact__icon"></i>
<div>
<h3 class="contact__title">Telemóvel</h3>
<span class="contact__subtitle">999-777-666</span>
</div>
</div>
<div class="contact__information">
<i class="uil uil-envelope contact__icon"></i>
<div>
<h3 class="contact__title">Email</h3>
<span class="contact__subtitle">email.com</span>
</div>
</div>
<div class="contact__information">
<i class="uil uil-map-marker contact__icon"></i>
<div>
<h3 class="contact__title">Morada</h3>
<span class="contact__subtitle">Portugal</span>
</div>
</div>
</section>
Step 1: Define width
Step 2: Locate parent to flex - #contact
Step 3: align-items: center; makes all elements inline (aligned)
Step 4: justify-content: space-evenly; spaces all elements evenly. Using up extra space.
#contact {
width: 100%;
display: flex;
align-items: center;
justify-content: space-evenly;
}
<section class="contact section" id="contact">
<h2 class="section__title">Contacte</h2>
<span class="section__subtitle">Contacte para mais informações</span>
<div class="contact__information">
<i class="uil uil-phone contact__icon"></i>
<div>
<h3 class="contact__title">Telemóvel</h3>
<span class="contact__subtitle">999-777-666</span>
</div>
</div>
<div class="contact__information">
<i class="uil uil-envelope contact__icon"></i>
<div>
<h3 class="contact__title">Email</h3>
<span class="contact__subtitle">email.com</span>
</div>
</div>
<div class="contact__information">
<i class="uil uil-map-marker contact__icon"></i>
<div>
<h3 class="contact__title">Morada</h3>
<span class="contact__subtitle">Portugal</span>
</div>
</div>
</section>
Feels like an opportunity for flex. I added borders and padding just to make it obvious what was where and did some alignment you can customize as needed
.contact.section {
display: flex;
flex-direction: row;/* or column if you want the first two on top */
justify-content: flex-start;
align-items: center;
}
.contact__information,
.contact__information div { /*probably need a class for the div */
display: flex;
flex-direction: row;
justify-content: center;
border: solid 1px lime;
padding:0.25rem;
}
.contact__information div {
display: flex;
flex-direction: column;/* or row if titles are in line with data */
border: solid 1px pink;
}
.contact__title {
border: solid blue 1px;
padding: 0.5rem;
align-self: center;
}
.contact__subtitle {
border: solid #8d8dff 1px;
padding: 0.5rem;
align-self: center;
}
<section class="contact section" id="contact">
<h2 class="section__title">Contacte</h2>
<span class="section__subtitle">Contacte para mais informações</span>
<div class="contact__information">
<i class="uil uil-phone contact__icon"></i>
<div>
<h3 class="contact__title">Telemóvel</h3>
<span class="contact__subtitle">999-777-666</span>
</div>
</div>
<div class="contact__information">
<i class="uil uil-envelope contact__icon"></i>
<div>
<h3 class="contact__title">Email</h3>
<span class="contact__subtitle">email.com</span>
</div>
</div>
<div class="contact__information">
<i class="uil uil-map-marker contact__icon"></i>
<div>
<h3 class="contact__title">Morada</h3>
<span class="contact__subtitle">Portugal</span>
</div>
</div>
</section>

Flex Box Menu Alignment Issue

Been researching and adjusting the following code, but aligning the text with even spacing is eluding me. I am able to accomplish this easily with a table element, but I want to master Flex Box methods. Any help appreciated.
Screen Shot of text-alignment issue:
#navbar-menu-button-mobile,
#navbar-container-mobile {
display: flex !important;
}
/* === Navigation Drop-down Menu === */
#navbar-container-mobile {
margin-top: 74px;
padding: 0 1%;
background: white;
}
.navbar-menu-item-mobile {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
<div id="navbar-container-mobile" class="container">
<div id="navbar-collapse-mobile" class="collapse w-100">
<div class="navbar-menu-item-mobile">
<div class="fa fa-calendar"></div><div class="pr-2"></div><div>Calendar</div>
</div>
<div class="navbar-menu-item-mobile">
<div class="fa fa-compass"></div><div class="pr-2"></div><div>Locations</div>
</div>
<div class="navbar-menu-item-mobile">
<div class="fa fa-heartbeat"></div><div class="pr-2"></div><div>Physicians</div>
</div>
<div class="navbar-menu-item-mobile">
<div class="fa fa-random"></div><div class="pr-2"></div><div>Trades</div>
</div>
<div class="navbar-menu-item-mobile">
<div class="fa fa-user"></div><div class="pr-2"></div><div>Personal</div>
</div>
<div class="navbar-menu-item-mobile">
<div class="fa fa-cog"></div><div class="pr-2"></div><div>Settings</div>
</div>
<div class="dropdown-divider"></div>
<div class="navbar-menu-item-mobile">
<div class="fa fa-sign-out"></div><div class="pr-2"></div><div>Sign Out</div>
</div>
</div>
</div>
Example below assuming that you're using FontAweosme v4, Please follow this Markup:
<div class="navbar-menu-item-mobile">
<i class="menu icons"></i>
<div>Menu label</div>
</div>
And you need to set width, margin to the icons:
.navbar-menu-item-mobile .fa {
width: 15px;
margin-right: 10px;
}
Example:
#navbar-menu-button-mobile,
#navbar-container-mobile {
display: flex !important;
}
/* Add this */
.navbar-menu-item-mobile .fa {
width: 15px;
margin-right: 10px;
}
/* === Navigation Drop-down Menu === */
#navbar-container-mobile {
margin-top: 74px;
padding: 0 1%;
background: white;
}
.navbar-menu-item-mobile {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<div id="navbar-container-mobile" class="container">
<!-- Removed collapse class for testing -->
<div id="navbar-collapse-mobile" class="w-100">
<div class="navbar-menu-item-mobile">
<i class="fa fa-calendar"></i>
<div>Calendar</div>
</div>
<div class="navbar-menu-item-mobile">
<i class="fa fa-compass"></i>
<div>Locations</div>
</div>
<div class="navbar-menu-item-mobile">
<i class="fa fa-heartbeat"></i>
<div>Physicians</div>
</div>
<div class="navbar-menu-item-mobile">
<i class="fa fa-random"></i>
<div>Trades</div>
</div>
<div class="navbar-menu-item-mobile">
<i class="fa fa-user"></i>
<div>Personal</div>
</div>
<div class="navbar-menu-item-mobile">
<div class="fa fa-cog"></div>
<div>Settings</div>
</div>
<div class="dropdown-divider"></div>
<div class="navbar-menu-item-mobile">
<i class="fa fa-sign-out "></i>
<div>Sign Out</div>
</div>
</div>
</div>
You need to give a min-width to your icons

How to get this effect?

I try to reach one point using div's and bootstrap. It should be in one line number of points and smaller information about points and in second area should be bootstrap icon and again information about icon.
My code:
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row center-block">
<div class="col-md-5" style="padding: 0px; padding-left: 10px; ">
<i class="pull-left h2"><h2>72</h2></i> TWOJE PUNKTY
</div>
<div class="col-md-7" style="padding: 0px">
<i class="fa fa-trophy fa-2x pull-left"></i> WYRÓZNIENIE SZYBKI BILL
</div>
<br>
<table class="table">
<tr>
<th><h2>72</h2></th>
<th>you points</th>
<th><i class="fa fa-trophy fa-2x pull-left"></i></th>
<th>fastL</th>
</tr>
</table>
</div>
</div>
Try below code and you can adjust col- class according to you
.flex-div {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
align-items: center;
}
.icon-text {
float: left;
margin-right: 10px;
font-size: 34px;
}
.icon-text h2 {
margin: 0;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row center-block row-eq-height">
<div class="col-xs-6 flex-div">
<div class="icon-text">
<h2>72</h2>
</div>
<div class="info-text">
TWOJE PUNKTY<br/>
WYRÓZNIENIE SZYBKI BILL
</div>
</div>
<div class="col-xs-6 flex-div ">
<div class="icon-text">
<i class="glyphicon glyphicon-certificate"></i>
</div>
<div class="info-text">
Your Achivement Reached
</div>
</div>
</div>
</div>
You can achieve that effect using something like this.
HTML:
<div class="points"> 72 </div>
<div class="points-details">
Your
points
</div>
<div class="icon">+</div>
<div class="icon-details">
Your
Achievment
Reached
</div>
CSS:
.points{
display: inline-block;
}
.points-details{
display: inline-block;
}
.icon{
margin-left: 20px;
display: inline-block;
}
.icon-details{
display: inline-block;
}

Bootstrap columns not floating/wrapping onto next row with flex-box

I am trying to make the bootstrap columns of same height using several approaches that I found over here. Everywhere it is working perfectly except the safari on mac, where all the columns stack up in the first row instead of floating to the next one.
here is the HTML:
<div class="row">
<div class="col-md-4 col-sm-4 col-xs-6 text-center">
<div class="product_card">
<a href="/buy/handsome-cream-3-pc-jodhpuri-suit"><img alt="Handsome Cream 3 Pc Jodhpuri Suit"
src="/system/images/attachments/000/000/174/normal/open-uri20160927-22035-h7grcj?1474996752"></a>
<div data-target="#loginSignUpModal" data-toggle="modal" onclick="return false;">
<i class="fa fa-star-o" aria-hidden="true"></i> Shortlist
</div>
<a class="caption" href="/buy/handsome-cream-3-pc-jodhpuri-suit">
<h3>Handsome Cream 3 Pc Jodhpuri Suit</h3>
<span class="price">$380.00</span>
</a></div>
</div>
</div>
here is the CSS that is being used:
.row {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
&> [class*='col-'] {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
}
here is the screenshots on MAC SAFARI:
here is the screenshots on Ubuntu Chrome:
Why is safari goofing up with my col-mds? How to fix this without using JS?
I think the easier way to do it is by setter the height you want in CSS, remove the img tag, and add a background cover image on your first a tag:
.product_card {
height: 300px;
width: 190px;
float: left;
margin: 4px;
}
.product_card a:first-child {
display: block;
height: 100%;
background-image: url('http://i.imgur.com/8YsAmq3.gif');
background-position: center center;
-webkit-background-size: cover;
background-size: cover;
}
.product_card:first-child {
margin-left: 0px;
}
.product_card:last-child {
margin-right: 0px;
}
<div class="row">
<div class="col-md-4 col-sm-4 col-xs-6 text-center">
<div class="product_card">
<div data-target="#loginSignUpModal" data-toggle="modal" onclick="return false;">
<i class="fa fa-star-o" aria-hidden="true"></i> Shortlist
</div>
<a class="caption" href="/buy/pork">
<h3>Porks</h3>
<span class="price">$380.00</span>
</a></div>
<div class="product_card">
<div data-target="#loginSignUpModal" data-toggle="modal" onclick="return false;">
<i class="fa fa-star-o" aria-hidden="true"></i> Shortlist
</div>
<a class="caption" href="/buy/rhinoceros">
<h3>Rhinoceros</h3>
<span class="price">$8 000.00</span>
</a></div>
<div class="product_card">
<div data-target="#loginSignUpModal" data-toggle="modal" onclick="return false;">
<i class="fa fa-star-o" aria-hidden="true"></i> Shortlist
</div>
<a class="caption" href="/buy/dog">
<h3>Dogs</h3>
<span class="price">$380.00</span>
</a></div>
</div>
</div>

how do I make multiple divs width change dynamically with out overlapping when window size changes

I have a div with three divs inside of different width. when my window size changes it is overlapping each other.How do I make content remain without overlapping when window size changes.
Here is my code.
#topBarContainer{
background-color: blue;
}
#topBarLeft{
width: 14%;
text-align: center;
}
#topBarMiddle{
width: 26%;
text-align: center;
}
#topBarRight{
width: 60%;
text-align: right;
}
.topBar {
margin-right: -4px;
text-align: center;
display: inline-block;
padding-top: 5px;
padding-bottom: 3px;
}
<div id="topBarContainer">
<!--TopBar-->
<div id="topBarLeft" class="topBar">
<input type="button" ng-click="newMenuType('message')" value="New" id="newButton">
</div>
<!--Top Bar Middle-->
<div id="topBarMiddle" class="topBar">
<div class="searchBoxContainer">
<i class="fa fa-search fa-flip-horizontal" id="searchBoxIcon"> </i>
<input type="text" placeholder="Search Inbox" class="searchBox" ng-model="searchEmail" />
</div>
</div>
<!--Top Bar Right-->
<div id="topBarRight" class="topBar">
<div>
<div class="loginRow">Hi{{loginName()}}</div>
<div ng-if="emailIcon()" class="iconRow">
<i class="fa fa-reply"></i>
</div>
<div ng-if="emailIcon()" class="iconRow">
<i class="fa fa-reply-all"></i>
</div>
<div ng-if="emailIcon()" class="iconRow" >
<i class="fa fa-reply fa-flip-horizontal"></i>
</div>
<div ng-if="!isDeletedView() && emailIcon()" class="iconRow">
<i class="fa fa-trash"></i>
</div>
</div>
</div>
</div>
It is looking good with normal window when I resize window it is overlapping all.leftBar takes 14%and middle bar takes 26% and rest for the right container.
I am spenting days to fix this. I need to align all so that all 3 sections display in the same line.
you can use display:flex from flexbox
body {
margin: 0
}
#topBarContainer {
background-color: blue;
display: flex;
}
#topBarLeft {
width: 14%;
text-align: center;
}
#topBarMiddle {
text-align: center;
background: red;
width: 35%
}
#topBarRight {
text-align: right;
background: green;
flex: 1
}
#topBarRight > div {
display: inline-flex
}
.topBar {
text-align: center;
padding-top: 5px;
padding-bottom: 3px;
}
#topBarRight >div:last-of-type {
text-align: center
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" />
<div id="topBarContainer">
<!--TopBar-->
<div id="topBarLeft" class="topBar">
<input type="button" ng-click="newMenuType('message')" value="New" id="newButton">
</div>
<!--Top Bar Middle-->
<div id="topBarMiddle" class="topBar">
<div class="searchBoxContainer">
<i class="fa fa-search fa-flip-horizontal" id="searchBoxIcon"> </i>
<input type="text" placeholder="Search Inbox" class="searchBox" ng-model="searchEmail" />
</div>
</div>
<!--Top Bar Right-->
<div id="topBarRight" class="topBar">
<div>
<div class="loginRow">Hi{{loginName()}}</div>
<div ng-if="emailIcon()" class="iconRow">
<i class="fa fa-reply"></i>
</div>
<div ng-if="emailIcon()" class="iconRow">
<i class="fa fa-reply-all"></i>
</div>
<div ng-if="emailIcon()" class="iconRow">
<i class="fa fa-reply fa-flip-horizontal"></i>
</div>
<div ng-if="!isDeletedView() && emailIcon()" class="iconRow">
<i class="fa fa-trash"></i>
</div>
<div ng-show="canMoveToFolder()" class="iconRow" ng-mouseover="newIcon = true" ng-mouseleave="newIcon = false"> <i class="fa fa-folder-o"> </i>
<div ng-if="newIcon" id="newItemOptions">
<label class='newItemLabel' ng-click="moveMessageToFolder(3)">Inbox</label>
<label class='newItemLabel' ng-click="moveMessageToFolder(4)">Sent</label>
</div>
</div>
</div>
</div>
</div>
I'm not sure if it is what you are looking for but if you put your searchBoxContainer in display:flex; it shud solwe the problem cause it puts your searchBoxIcon in front of the searchBox it self
you have to pu in your css
.searchBoxContainer{
display:flex;
}
#topBarContainer{
background-color: blue;
}
#topBarLeft{
width: 14%;
text-align: center;
}
#topBarMiddle{
width: 26%;
text-align: center;
}
#topBarRight{
width: 60%;
text-align: right;
}
.topBar {
margin-right: -4px;
text-align: center;
display: inline-block;
padding-top: 5px;
padding-bottom: 3px;
}
.searchBoxContainer{
display:flex;
}
<div id="topBarContainer">
<!--TopBar-->
<div id="topBarLeft" class="topBar">
<input type="button" ng-click="newMenuType('message')" value="New" id="newButton">
</div>
<!--Top Bar Middle-->
<div id="topBarMiddle" class="topBar">
<div class="searchBoxContainer">
<i class="fa fa-search fa-flip-horizontal" id="searchBoxIcon"> </i>
<input type="text" placeholder="Search Inbox" class="searchBox" ng-model="searchEmail" />
</div>
</div>
<!--Top Bar Right-->
<div id="topBarRight" class="topBar">
<div>
<div class="loginRow">Hi{{loginName()}}</div>
<div ng-if="emailIcon()" class="iconRow">
<i class="fa fa-reply"></i>
</div>
<div ng-if="emailIcon()" class="iconRow">
<i class="fa fa-reply-all"></i>
</div>
<div ng-if="emailIcon()" class="iconRow" >
<i class="fa fa-reply fa-flip-horizontal"></i>
</div>
<div ng-if="!isDeletedView() && emailIcon()" class="iconRow">
<i class="fa fa-trash"></i>
</div>
</div>
</div>
</div>
Why are all elements moved right with that negative margin on the .topBar class? I would just erase that, and add box-sizing: border-box; to .topBar (just to be on the safe side for percentage widths and heights).
So you'd have
.topBar {
box-sizing: border-box;
text-align: center;
display: inline-block;
padding-top: 5px;
padding-bottom: 3px;
}