Div move vertically after window resize - html

How do i make these divs to move down when window resizes and on mobile devices to be a width of 100%; Subject class = "project-cards"
Heres the Code...
Resize window.
Theres alot of things going on here, first when the window resizes i want the three divs to move down into a vertical row. When the window gets to about the size of a mobile phone i want the three divs to still be vertical with a width of 100%; so that it is covering the the whole page width wise. You can see alot of things going wrong with the content inside the divs when it resizes. For example the text and button overlap. I know i cant ask two questions but if you could help me get the three divs to be responsive, that will help me so much. Visit site Xlaeo.tk
.mainCenter{
width:100%;
padding-right:100px;
padding-left:100px;
padding-top: 50px;
height:700px;
}
.project-wrapper{
margin-top: 420px;
}
.headerProjects{
font-size: 25px;
font-weight: BOLD;
margin-left: 52px;
margin-bottom: 20px;
color: #d80068;
}
.projectholders{
height:auto;
width:100%;
margin:0 auto;
display: flex;
justify-content: center;
margin-bottom: 100px;
min-width: 200px;
}
.projects-cards{
border:.9px solid #f7f7f7;
border-radius: 2rem;
display: block;
width: 30%;
margin-left:25px;
}
.projects-cards:hover{
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
transition-delay: 1s;
transition-duration: .5s;
}
.media-top{
width:100%;
height:300px;
border-bottom: 1.9px solid gray;
position: relative;
}
.media-top img{
border-top-left-radius: 2rem;
border-top-right-radius: 2rem;
}
.project-info{
width:100%;
}
.progress-left{
float: left;
width: 150px;
height: 150px;
}
.project-money{
float: right;
width: 170px;
border-bottom: 1px solid #c7c8c9;
}
.project-money h1{
font-size: 16.9px;
color: gray;
font-weight: bold;
width:900%;
}
.visitProject-button-H{
padding: 20px;
float:right;
}
.visi-project{
height:50px;
width:135px;
background-color: #ff0043;
font-size: 20px;
font-weight: bold;
border:none;
border-top-left-radius: 1rem;
border-bottom-left-radius: 1rem;
}
.under{
display: flex;
margin:0 auto;
justify-content: center;
font-size: 60px;
color: #ff0043;
}
<div class="projectholders">
<div class="projects-cards">
<div class="media-top" >
<img src="http://cdn.pcwallart.com/images/mercedes-benz-biome-seed-wallpaper-1.jpg" width="100%" height="100%" />
</div>
<div class="project-info">
<div class="progress-left">
<img src="https://camo.githubusercontent.com/40a03a2e27517edee74b177b7d48f1632b31c693/687474703a2f2f692e696d6775722e636f6d2f414a30364157452e706e67"
width="100%" height="100%;" />
</div>
<div class="project-money">
<h1>Backed by $102,323 </h1>
</div>
<div class="visitProject-button-H">
<button class="visi-project" type="button">Visit</button>
</div>
</div>
</div>
<div class="projects-cards">
<div class="media-top">
<img src="https://cdn.dribbble.com/users/149817/screenshots/1436337/speedcam.gif" width="100%" height="100%" />
</div>
<div class="project-info">
<div class="progress-left">
<img src="https://camo.githubusercontent.com/40a03a2e27517edee74b177b7d48f1632b31c693/687474703a2f2f692e696d6775722e636f6d2f414a30364157452e706e67"
width="100%" height="100%;" />
</div>
<div class="project-money">
<h1>Backed by $9,564 </h1>
</div>
<div class="visitProject-button-H">
<button class="visi-project" type="button">Visit</button>
</div>
</div>
</div>
<div class="projects-cards">
<div class="media-top">
<img src="http://coolwallpaperz.info/user-content/uploads/wall/o/27/girl-motorcycle-streamlined-cool-sumer-370761.jpg" width="100%" height="100%" />
</div>
<div class="project-info">
<div class="progress-left">
<img src="https://camo.githubusercontent.com/40a03a2e27517edee74b177b7d48f1632b31c693/687474703a2f2f692e696d6775722e636f6d2f414a30364157452e706e67"
width="100%" height="100%;" />
</div>
<div class="project-money">
<h1>Backed by $23,324 </h1>
</div>
<div class="visitProject-button-H">
<button class="visi-project" type="button">Visit</button>
</div>
</div>
</div>
</div>

If you really don't want to use any libraries,
Please go with CSS Media Query
<div>
<div class="block">
<p>Hello</p>
</div>
<div class="block">
<p>Hello</p>
</div>
<div class="block">
<p>Hello</p>
</div>
<div>
CSS
.block{
display: inline-block;
width: 30%;
}
#media screen and (max-width: 480px) {
.block{
display: inline-block;
width: 100%;
}
}
DEMO: https://codepen.io/mkarrfan/pen/WEOWpG

You can try this I have added bootstrap to your code and your can define your css accordingly.
Firstly add bootstrap CDN to your code and define each section with the columns size you want I have added col-sm-4 to the class.
Note : sm is for small screen similarly we have md, xs, lg for medium extra-small and large screen, you can define all at same time also depending how you want your view to look on different size of screen, you can devide screen into 12 parts so range will be from col-sm-1 to col-sm-12.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/css/bootstrap.min.css" >
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container-fluid">
<div class="projectholders row">
<div class="projects-cards col-sm-4">
<div class="media-top" >
<img src="http://cdn.pcwallart.com/images/mercedes-benz-biome-seed-wallpaper-1.jpg" width="100%" height="100%" />
</div>
<div class="project-info">
<div class="progress-left">
<img src="https://camo.githubusercontent.com/40a03a2e27517edee74b177b7d48f1632b31c693/687474703a2f2f692e696d6775722e636f6d2f414a30364157452e706e67"
width="100%" height="100%;" />
</div>
<div class="project-money">
<h1>Backed by $102,323 </h1>
</div>
<div class="visitProject-button-H">
<button class="visi-project" type="button">Visit</button>
</div>
</div>
</div>
<div class="projects-cards col-sm-4">
<div class="media-top">
<img src="https://cdn.dribbble.com/users/149817/screenshots/1436337/speedcam.gif" width="100%" height="100%" />
</div>
<div class="project-info">
<div class="progress-left">
<img src="https://camo.githubusercontent.com/40a03a2e27517edee74b177b7d48f1632b31c693/687474703a2f2f692e696d6775722e636f6d2f414a30364157452e706e67"
width="100%" height="100%;" />
</div>
<div class="project-money">
<h1>Backed by $9,564 </h1>
</div>
<div class="visitProject-button-H">
<button class="visi-project" type="button">Visit</button>
</div>
</div>
</div>
<div class="projects-cards col-sm-4">
<div class="media-top">
<img src="http://coolwallpaperz.info/user-content/uploads/wall/o/27/girl-motorcycle-streamlined-cool-sumer-370761.jpg" width="100%" height="100%" />
</div>
<div class="project-info">
<div class="progress-left">
<img src="https://camo.githubusercontent.com/40a03a2e27517edee74b177b7d48f1632b31c693/687474703a2f2f692e696d6775722e636f6d2f414a30364157452e706e67"
width="100%" height="100%;" />
</div>
<div class="project-money">
<h1>Backed by $23,324 </h1>
</div>
<div class="visitProject-button-H">
<button class="visi-project" type="button">Visit</button>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
you can find the working fiddle https://jsfiddle.net/rhmasm3t/
I hope this will help. and this does not change any thing to your css.

I have made few adjustments in your code, such as widths of some divs. You can play around and see what works best.
You have used 900% on width of project-money h1 thats why your overflow-x is so much.
.project-money h1{
font-size: 16.9px;
color: gray;
font-weight: bold;
width:900%;
}
Also I have used media queries, so that when the width gets smaller the content will be below each other. Read w3 queries.
#media screen and (max-width:500px) {
.projectholders {
flex-direction: column;
}
Code
.mainCenter {
width: 100%;
padding-right: 100px;
padding-left: 100px;
padding-top: 50px;
height: 700px;
}
.project-wrapper {
margin-top: 420px;
}
.headerProjects {
font-size: 25px;
font-weight: BOLD;
margin-left: 52px;
margin-bottom: 20px;
color: #d80068;
}
.projectholders {
height: auto;
width: 100%;
margin: 0 auto;
display: inline-flex;
justify-content: center;
margin-bottom: 100px;
min-width: 200px;
}
.projects-cards {
border: .9px solid #f7f7f7;
border-radius: 2rem;
display: block;
width: 150px;
margin-left: 25px;
}
.projects-cards:hover {
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
transition-delay: 1s;
transition-duration: .5s;
}
.media-top {
width: 100%;
height: 300px;
border-bottom: 1.9px solid gray;
position: relative;
}
.media-top img {
border-top-left-radius: 2rem;
border-top-right-radius: 2rem;
}
.project-info {
width: 100%;
}
.progress-left {
float: left;
width: 150px;
height: 150px;
}
.project-money {
float: right;
width: 150px;
border-bottom: 1px solid #c7c8c9;
}
.project-money h1 {
font-size: 16.9px;
color: gray;
font-weight: bold;
width: 900%;
}
.visitProject-button-H {
padding: 20px;
float: right;
}
.visi-project {
height: 50px;
width: 125px;
background-color: #ff0043;
font-size: 20px;
font-weight: bold;
text-align: center;
border: none;
border-top-left-radius: 1rem;
border-bottom-left-radius: 1rem;
}
.under {
display: flex;
margin: 0 auto;
justify-content: center;
font-size: 60px;
color: #ff0043;
}
#media screen and (max-width:500px) {
.projectholders {
flex-direction: column;
}
<div class="projectholders">
<div class="projects-cards">
<div class="media-top">
<img src="http://cdn.pcwallart.com/images/mercedes-benz-biome-seed-wallpaper-1.jpg" width="100%" height="100%" />
</div>
<div class="project-info">
<div class="progress-left">
<img src="https://camo.githubusercontent.com/40a03a2e27517edee74b177b7d48f1632b31c693/687474703a2f2f692e696d6775722e636f6d2f414a30364157452e706e67" width="100%" height="100%;" />
</div>
<div class="project-money">
<h1>Backed by $102,323 </h1>
</div>
<div class="visitProject-button-H">
<button class="visi-project" type="button">Visit</button>
</div>
</div>
</div>
<div class="projects-cards">
<div class="media-top">
<img src="https://cdn.dribbble.com/users/149817/screenshots/1436337/speedcam.gif" width="100%" height="100%" />
</div>
<div class="project-info">
<div class="progress-left">
<img src="https://camo.githubusercontent.com/40a03a2e27517edee74b177b7d48f1632b31c693/687474703a2f2f692e696d6775722e636f6d2f414a30364157452e706e67" width="100%" height="100%;" />
</div>
<div class="project-money">
<h1>Backed by $9,564 </h1>
</div>
<div class="visitProject-button-H">
<button class="visi-project" type="button">Visit</button>
</div>
</div>
</div>
<div class="projects-cards">
<div class="media-top">
<img src="http://coolwallpaperz.info/user-content/uploads/wall/o/27/girl-motorcycle-streamlined-cool-sumer-370761.jpg" width="100%" height="100%" />
</div>
<div class="project-info">
<div class="progress-left">
<img src="https://camo.githubusercontent.com/40a03a2e27517edee74b177b7d48f1632b31c693/687474703a2f2f692e696d6775722e636f6d2f414a30364157452e706e67" width="100%" height="100%;" />
</div>
<div class="project-money">
<h1>Backed by $23,324 </h1>
</div>
<div class="visitProject-button-H">
<button class="visi-project" type="button">Visit</button>
</div>
</div>
</div>
</div>

For the resizing functionality you should use bootstrap
It's simple and easy to use and provide responsiveness to your site.

Related

I need help sort my images properly in CSS, HTML

I am new to web development and I am trying to make a website for sorting my pictures in CSS, HTML5. What I want the sorting to look like the text separates the images like a new paragraph.how it looks I tried to add
<br />
but that did not work as I expected. Thanks for any help I can get :)
#pics {
margin-top: 10px;
max-width: 1500px;
margin-left: auto;
margin-right: auto;
}
.pics-text {
font-family: 'Roboto', sans-serif;
font-size: 36px;
color: #ffffff;
opacity: 87%;
}
.pic-item {
float: left;
position: relative;
width: 20%;
padding-top: 5px;
padding-right: 7px;
}
.pic-item a img {
width: 100%;
border-radius: 5px;
}
<div id="pics">
<h2 class="pics-text">some text</h2>
<div class="pic-item">
<img src="./imgs/123-vertical/1.jpg" />
</div>
<div class="pic-item">
<img src="./imgs/123-vertical/2.jpg" />
</div>
<div class="pic-item">
<img src="./imgs/123-vertical/3.jpg" />
</div>
</div>
<div id="pics">
<h2 class="pics-text">some text</h2>
<div class="pic-item">
<img src="./imgs/123-vertical/1.jpg" />
</div>
<div class="pic-item">
<img src="./imgs/123-vertical/2.jpg" />
</div>
<div class="pic-item">
<img src="./imgs/123-vertical/3.jpg" />
</div>
</div>
So you want one image and a text below it or image and text beside?
If you want to some image and then some text then put all your Items in a div and make your container div flex with direction: column.
.first{
display: flex;
flex-direction:row;
}
img{
width: 50%
}
and the HTML would be
<h1>Some Text</h1>
<div class="first">
<img src="https://img.favpng.com/20/20/8/football-sport-ball-game-png-favpng-8PPaPFsNEixHevLDVTnWJTegN.jpg" alt="football"/>
<img src="https://img.favpng.com/20/20/8/football-sport-ball-game-png-favpng-8PPaPFsNEixHevLDVTnWJTegN.jpg" alt="football"/>
<img src="https://img.favpng.com/20/20/8/football-sport-ball-game-png-favpng-8PPaPFsNEixHevLDVTnWJTegN.jpg" alt="football"/>
</div>
<h1>Some Text</h1>
<div class="first">
<img src="https://img.favpng.com/20/20/8/football-sport-ball-game-png-favpng-8PPaPFsNEixHevLDVTnWJTegN.jpg" alt="football"/>
<img src="https://img.favpng.com/20/20/8/football-sport-ball-game-png-favpng-8PPaPFsNEixHevLDVTnWJTegN.jpg" alt="football"/>
<img src="https://img.favpng.com/20/20/8/football-sport-ball-game-png-favpng-8PPaPFsNEixHevLDVTnWJTegN.jpg" alt="football"/>
</div>
-You need to put all your Items in a div and make your container div flex with column direction.
- IDs must be unic, so You are not allowed to use one id for multiple elements in your HTML Code.
body{
background-color:red;
}
.container{
display:flex;
flex-direction:column;
}
#first, #second{
margin-top: 10px;
max-width: 1500px;
margin-left: auto;
margin-right: auto;
}
.pics-text{
font-family: 'Roboto', sans-serif;
display:flex;
font-size: 36px;
color: #ffffff;
opacity: 87%;
}
.pic-item {
float: left;
position: relative;
width: 20%;
padding-top: 5px;
padding-right: 7px;
}
.pic-item a img {
width: 100%;
border-radius: 5px;
}
<div class="container">
<div id="first">
<h2 class="pics-text">some text</h2>
<div class="pic-item">
<img src="https://images.redbullshop.com/is/image/RedBullSalzburg/RB-product-detail/RBS19168_3H_1/RBS-Champions-League-Ball.jpg" />
</div>
<div class="pic-item">
<img src="https://images.redbullshop.com/is/image/RedBullSalzburg/RB-product-detail/RBS19168_3H_1/RBS-Champions-League-Ball.jpg" />
</div>
<div class="pic-item">
<img src="https://images.redbullshop.com/is/image/RedBullSalzburg/RB-product-detail/RBS19168_3H_1/RBS-Champions-League-Ball.jpg" />
</div>
</div>
<div id="second">
<h2 class="pics-text">some text</h2>
<div class="pic-item">
<img src="https://images.redbullshop.com/is/image/RedBullSalzburg/RB-product-detail/RBS19168_3H_1/RBS-Champions-League-Ball.jpg" />
</div>
<div class="pic-item">
<img src="https://images.redbullshop.com/is/image/RedBullSalzburg/RB-product-detail/RBS19168_3H_1/RBS-Champions-League-Ball.jpg" />
</div>
<div class="pic-item">
<img src="https://images.redbullshop.com/is/image/RedBullSalzburg/RB-product-detail/RBS19168_3H_1/RBS-Champions-League-Ball.jpg" />
</div>
</div>
</div>

Split a div into four separate divs

(source: kheper.net)
The effect I'm going for is the whole square being one div, with each square being a smaller div within the bigger div, correctly aligned, to take up the entire viewport.
Similar to montere.it minus the JavaScript.
I've tried to highlight the problematic bits of code, the corresponding CSS isn't formatting correctly but I've linked a JS bin below.
Apologies if my code is spaghetti code, it's less my code and more a copy and paste session gone wild.
#bodyHobbies {
width: 100%;
height: 500px;
}
.intbox1 {
height: 25%;
width: 100%;
background-color: #009900;
margin: auto;
text-align: center;
}
.intbox2 {
height: 25%;
width: 100%;
background-color: #990000;
margin: auto;
text-align: center;
color: #FFFFFF;
}
.intbox3 {
height: 25%;
width: 100%;
background-color: #000000;
margin: auto;
text-align: center;
color: #FFFFFF;
}
.intbox4 {
height: 25%;
width: 100%;
background-color: #990000;
margin: auto;
text-align: center;
color: #FFFFFF;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div id="bodyHobbies">
<div class="intbox1">
<p>1</p>
<img src="foobar1.jpg" border="0" />
</div>
<div class="intbox2">
<p>2</p>
<img src="foobar.jpg" border="0" />
</div>
<div class="intbox3">
<p>3</p>
<img src="foobar.jpg" border="0" />
</div>
<div class="intbox4">
<p>4</p>
<img src="foobar.jpg" border="0" />
</div>
</div>
https://jsbin.com/heyibe/edit?html,css,output
you can done that using css3 flexbox concept
html,body{
margin:0;
padding:0;
width:100%;
height:100%;
}
img{
width:100%;
}
#bodyHobbies{
display:flex;
flex-flow: row wrap;
}
.item{
flex-basis:50%;
}
<div id="bodyHobbies">
<div class="intbox1 item"><p>1</p>
<img src="https://i.stack.imgur.com/GSqmw.jpg" border="0" />
</div>
<div class="intbox2 item"><p>2</p>
<img src="https://i.stack.imgur.com/GSqmw.jpg" border="0" />
</div>
<div class="intbox3 item"><p>3</p>
<img src="https://i.stack.imgur.com/GSqmw.jpg" border="0" />
</div>
<div class="intbox4 item"><p>4</p>
<img src="https://i.stack.imgur.com/GSqmw.jpg" border="0" />
</div>
</div>
Just added display: inline-table to you #bodyHobbies and added a common class to the intbox divs. Removed the individual intbox stylings related to width and heights.
#bodyHobbies {
width: 100%;
height: 500px;
display: inline-table;
}
.intbox {
width: 50%;
height: 50%;
display: inline-block;
}
.intbox img {
width: 100%;
}
.intbox1 {
background-color:#009900;
margin:auto;
text-align:center;
}
.intbox2 {
background-color:#990000;
margin:auto;
text-align:center;
color:#FFFFFF;
}
.intbox3 {
background-color:#000000;
margin:auto;
text-align:center;
color:#FFFFFF;
}
.intbox4 {
background-color:#933230;
margin:auto;
text-align:center;
color:#FFFFFF;
}
<div id="bodyHobbies">
<div class="intbox intbox1"><p>1</p>
<img src="http://lorempixel.com/900/700/sports/1/" border="0" />
</div>
<div class="intbox intbox2"><p>2</p>
<img src="http://lorempixel.com/900/700/sports/1/" border="0" />
</div>
<div class="intbox intbox3"><p>3</p>
<img src="http://lorempixel.com/900/700/sports/1/" border="0" />
</div>
<div class="intbox intbox4"><p>4</p>
<img src="http://lorempixel.com/900/700/sports/1/" border="0" />
</div>
</div>
Try this
<div id="bodyHobbies">
<div class="intbox1"><p>1</p>
<img src="foobar1.jpg" border="0" />
</div>
<div class="intbox2"><p>2</p>
<img src="foobar.jpg" border="0" />
</div>
<div class="intbox3"><p>3</p>
<img src="foobar.jpg" border="0" />
</div>
<div class="intbox4"><p>4</p>
<img src="foobar.jpg" border="0" />
</div>
CSS
#bodyHobbies div{
float: left;
width: 50%;
}
<div id="bodyHobbies">
<div class="box">
<p>1</p>
<img src="foobar1.jpg" border="0" />
</div>
<div class="box">
<p>2</p>
<img src="foobar.jpg" border="0" />
</div>
<div class="box">
<p>3</p>
<img src="foobar.jpg" border="0" />
</div>
<div class="box">
<p>4</p>
<img src="foobar.jpg" border="0" />
</div>
</div>
<style>
.box{width:calc(50% - 2px); margin:2px; float:left; min-height:100px;}
</style>
At css use vw, vh units to set body, parent element width, height to 100vw, 100vh. Set [class=^"int"] selector position to absolute. Set element left and top properties corresponding to the four positions within the viewport using :nth-of-type() pseudo class. left:0vw, top:0vh; left:50vw, top:0vh; left:0vw, top:50vh, left:50vw, top:50vh.
body {
width: 100vw;
height: 100vh;
}
#bodyHobbies {
width: 100vw;
height: 100vh;
display: block;
position: relative;
border: 2px solid sienna;
}
[class^="int"] {
width: 50vw;
height: 50vh;
display: block;
position: absolute;
border: 2px solid gold;
}
[class^="int"]:nth-of-type(1) {
left: 0vw;
top: 0vw;
background: blue;
}
[class^="int"]:nth-of-type(2) {
left: 50vw;
top: 0vh;
background: green
}
[class^="int"]:nth-of-type(3) {
left: 0vw;
top: 50vh;
background: red;
}
[class^="int"]:nth-of-type(4) {
left: 50vw;
top: 50vh;
background: tan;
}
<div id="bodyHobbies">
<div class="intbox1">
<p>1</p>
<img src="foobar1.jpg" border="0" alt="foobar1" />
</div>
<div class="intbox2">
<p>2</p>
<img src="foobar.jpg" border="0" alt="foobar2" />
</div>
<div class="intbox3">
<p>3</p>
<img src="foobar.jpg" border="0" alt="foobar3" />
</div>
<div class="intbox4">
<p>4</p>
<img src="foobar.jpg" border="0" alt="foobar4" />
</div>
</div>
jsfiddle https://jsfiddle.net/69zkbjgw/

How can I horizontally align these divs?

I have 7 divs in a row on and I can't get the arrows in the middle to be horizontally in the centre of the outer div.
I've tried
top: 50%;
text-align: centre:
margin: 0 auto;
But none of them seem to work. How can I correct this?
HTML:
<div id="instruct">
<div align="center" class="category">
<img src="http://www.devo.co.uk/wp-content/uploads/2016/07/1-DEVO.png" width="150" height="auto"/>
<p class="ititle">1. You Order</p>
<p class="itext">Shop and browse your favorite<br>brands from your local shops</p>
</div>
<div align="center" class="arrow">
<img src="http://www.devo.co.uk/wp-content/uploads/2016/08/rightgreyarrow.png" width="50" height="auto"/>
</div>
<div align="center" class="category">
<img src="http://www.devo.co.uk/wp-content/uploads/2016/07/2-DEVOnewblue.png" width="175" height="auto"/>
<p class="ititle">2. We Collect</p>
<p class="itext">Our drivers make their way to your<br>local shop</p>
</div>
<div align="center" class="arrow">
<img src="http://www.devo.co.uk/wp-content/uploads/2016/08/rightgreyarrow.png" width="50" height="auto"/>
</div>
<div align="center" class="category">
<img src="http://www.devo.co.uk/wp-content/uploads/2016/07/3-DEVOcolour.png" width="95" height="auto"/>
<p class="ititle">3. We Deliver</p>
<p class="itext">Our drivers make their way to<br>your location</p>
</div>
<div align="center" class="arrow">
<img src="http://www.devo.co.uk/wp-content/uploads/2016/08/rightgreyarrow.png" width="50" height="auto"/>
</div>
<div align="center" class="category">
<img src="http://www.devo.co.uk/wp-content/uploads/2016/07/4-DEVO.png" width="65" height="auto"/>
<p class="ititle">4. You Enjoy</p>
<p class="itext">Track and receive your order<br>in as little as 30 minutes</p>
</div>
</div>
CSS:
#instruct {
height: auto;
width: 100%;
background-color: transparent;
border-bottom: 3px solid #fd0e35;
}
.category {
padding: 40px 50px 10px 50px;
display: inline-block;
}
.arrow {
padding: 0px;
display: inline-block;
border: 1px solid pink;
}
.ititle {
margin-top: 20px;
margin-bottom: 0;
text-transform: uppercase;
font-weight: bold;
font-size: 14px;
color: #a6a6a6;
}
.itext {
font-size: 13px;
}
The simplest solution is the use of vertical-align: middle; on the children of the container:
#instruct > div { vertical-align: middle; }
See this fiddle.
You need to relatively position the element in order for the 'top' property to take effect:
.arrow {
padding: 0px;
display: inline-block;
border: 1px solid pink;
position:relative;
top:-50px; // <---- change this value to suit your preferred positioning.
}

How can I align logos horizontally with the respective text underneath the logos?

I am trying to align logos horizontally with the respective text underneath them so they look nice and in order. Currently, they are just vertical. I have searched this site and many others, and tried different solutions but nothing seems to work. Here is my code.
.intro-text {
color: #000000;
display: block;
width: 100%;
margin: 50px 0 0 0;
text-align: justify;
line-height: 1.8em;
}
.intro-text-3d {
color: #000000;
display: block;
width: 100%;
text-align: center;
line-height: 1.8em;
}
.intro-text-process {
color: #000000;
display: block;
width: 100%;
text-align: center;
line-height: 1.8em;
}
.intro-text-toolset {
color: #000000;
display: block;
width: 100%;
text-align: center;
line-height: 1.8em;
}
/** Logos **/
.logos-all {
display: block;
text-align: center;
margin: 0 auto;
}
img {
display: inline-block;
margin: 0 auto;
vertical-align: middle;
border: 0;
line-height: 50px;
max-width: 100%;
width: 5%;
height: auto;
margin-bottom: .95em;
}
strong {
display: block;
font-weight: 700;
text-align: center;
}
section h4 {
text-align: center;
}
<article>
<section>
<p class="intro-text">
Some text goes here.
</p></div>
<div>
<img src="http://lorempixel.com/80/79" alt="CSS3" height="80" width="79"/>
<strong>CSS3</strong>
</div>
<div>
<img src="http://lorempixel.com/80/79" alt="Javascript" height="80" width="79"/>
<strong>Javascript</strong>
</div>
<div>
<img src="http://lorempixel.com/80/79" alt="Wordpress" height="80" width="79"/>
<strong>Wordpress</strong>
</div>
<div>
<img src="http://lorempixel.com/80/79" alt="PhP" height="80" width="79"/>
<strong>PhP</strong>
</div>
</div>
</section>
<section>
<p class="intro-text-3d">
Some text goes here
</p>
<div class="logos-all">
<div>
<img src="img/3ds max-logo.png" alt="3ds Max" height="80" width="79"/>
<strong>3DS MAX</strong>
</div>
<div>
<img src="img/c4d-logo.png" alt="Cinema 4D" height="80" width="79"/>
<strong>Cinema 4D</strong>
</div>
<div>
<img src="img/blender-logo.png" alt="Blender 3D" height="80" width="79"/>
<strong>Blender</strong>
</div>
</div>
</section>
<section>
<h4>How the process works</h4>
<p class="intro-text-process">Some text goes here </p>
</section>
<section>
<h4>Design Toolset</h4>
<p class="intro-text-toolset">Some text goes here.</p>
<div class="logos-all">
<div>
<img src="img/photoshop-logo.png" alt="Photoshop" height="80" width="79"/>
<strong>Photoshop</strong>
</div>
<div>
<img src="img/illustrator-logo.png" alt="Illustrator" height="80" width="79"/>
<strong>Illustrator</strong>
</div>
<div>
<img src="img/gimp-logo.png" alt="Gimp" height="80" width="79"/>
<strong>Gimp</strong>
</div>
<div>
<img src="img/inkscape-logo.png" alt="Inkscape"/>
<strong>Inkscape</strong>
</div>
</div>
</article>
</section>
Because your images are inline-block, you need to put text-align: center on the parent (the <div>).
Alternatively:
You could also make your images display: block
Or using flexbox:
Make your <div> display: flex; flex-direction: column and your image width: auto;
You can use floats to align blocks with images and text horizontally and text-align to align images and text inside them.
Overflow hidden inside section clears floats inside them, in case you'd want to have background on it and it wouldn't display properly.
.intro-text {
color: #000000;
display: block;
width: 100%;
margin: 50px 0 0 0;
text-align: justify;
line-height: 1.8em;
}
.intro-text-3d {
color: #000000;
display: block;
width: 100%;
text-align: center;
line-height: 1.8em;
}
.intro-text-process {
color: #000000;
display: block;
width: 100%;
text-align: center;
line-height: 1.8em;
}
.intro-text-toolset {
color: #000000;
display: block;
width: 100%;
text-align: center;
line-height: 1.8em;
}
/** Logos **/
.logos-all {
display: block;
text-align: center;
margin: 0 auto;
}
img {
display: inline-block;
margin: 0 auto;
vertical-align: middle;
border: 0;
line-height: 50px;
max-width: 100%;
width: 5%;
height: auto;
margin-bottom: .95em;
}
strong {
display: block;
font-weight: 700;
text-align: center;
}
section h4 {
text-align: center;
}
section {
overflow: hidden;
}
section > div {
text-align: center;
float: left;
width: 25%; /* 1/logos in row */
}
<article>
<section>
<p class="intro-text">
Some text goes here.
</p></div>
<div>
<img src="http://lorempixel.com/80/79" alt="CSS3" height="80" width="79"/>
<strong>CSS3</strong>
</div>
<div>
<img src="http://lorempixel.com/80/79" alt="Javascript" height="80" width="79"/>
<strong>Javascript</strong>
</div>
<div>
<img src="http://lorempixel.com/80/79" alt="Wordpress" height="80" width="79"/>
<strong>Wordpress</strong>
</div>
<div>
<img src="http://lorempixel.com/80/79" alt="PhP" height="80" width="79"/>
<strong>PhP</strong>
</div>
</div>
</section>
<section>
<p class="intro-text-3d">
Some text goes here
</p>
<div class="logos-all">
<div>
<img src="img/3ds max-logo.png" alt="3ds Max" height="80" width="79"/>
<strong>3DS MAX</strong>
</div>
<div>
<img src="img/c4d-logo.png" alt="Cinema 4D" height="80" width="79"/>
<strong>Cinema 4D</strong>
</div>
<div>
<img src="img/blender-logo.png" alt="Blender 3D" height="80" width="79"/>
<strong>Blender</strong>
</div>
</div>
</section>
<section>
<h4>How the process works</h4>
<p class="intro-text-process">Some text goes here </p>
</section>
If you wish to use Bootstrap you can use bootstrap panel .
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-body">
<img src="https://www.pushpraj.com/images/cool-scenery.jpg" class="img-rounded" alt="error" width="384" height="236">
</div>
<div class="panel-footer">Title 1</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-body">
<img src="https://www.pushpraj.com/images/cool-scenery.jpg" class="img-rounded" alt="error" width="384" height="236">
</div>
<div class="panel-footer">Title 2</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-body">
<img src="https://www.pushpraj.com/images/cool-scenery.jpg" class="img-rounded" alt="error" width="384" height="236">
</div>
<div class="panel-footer">Title 3</div>
</div>
</div>
</body>
</html>

Issues getting my DIV container to center

I can't seem to get my Div container with my images to center. I tried margin 0 auto; and adding a width.
body{
margin: 0px;
}
.main{
height: 950px;
background: url(../Images/Mountain.jpg) center center/cover no-repeat;
}
#media screen and (min-width: 1000px;){
#container{
height: 1000px;
width: 1000px;
margin: 0 auto;
}
}
.header{
margin-top: 0px;
width: 100%;
}
.logo{
float: left;
margin-top: 10px;
margin-left: 50px;
}
nav{
float: right;
margin-top: 26px;
margin-right: 50px;
}
.navBar{
color: #fff;
font-size: 20px;
margin-left: 25px;
text-decoration: none;
}
.navBar:hover{
text-decoration: underline;
}
span{
width: 100%;
}
h1{
font-size: 80px;
color: #fff;
text-align: center;
clear: both;
padding-top: 200px;
}
h2{
font-size: 36px;
color: #fff;
text-align: center;
clear: both;
margin-top: 50px;
}
/*Header Section*/
#head{
width: 100%;
height: 400px;
background: url(https://static.pexels.com/photos/6934/beach-vacation-water-summer.jpg) center center/cover no-repeat;
}
.port{
padding-top: 75px;
}
.portfolio{
width: 300px;
height: 250px;
}
.padding{
margin-left: 50px;
}
.container_port{
width: 1000px;
margin-left: auto;
margin-right: auto;
}
<!DOCTYPE html>
<html>
<head>
<title>-------</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<link rel="shortcut icon" type="text/css" href="http://placehold.it/50x50">
<link rel="stylesheet" href="CSS/Style.css">
</head>
<body>
<div id="head">
<div class="header">
<img class="logo" src=http://placehold.it/100x100>
<nav>
<a class="navBar" href="#">Home</a>
<a class="navBar" href="#">Portfolio</a>
<a class="navBar" href="#">Blog</a>
<a class="navBar" href="#">Testimonials</a>
</nav>
</div>
<span>
<h1 class="port">Portfolio</h1>
</span>
</div>
<div id="container_port">
<div class="one">
<img class="portfolio" src="http://placehold.it/300x300">
<img class="portfolio padding" src="http://placehold.it/300x300">
<img class="portfolio padding" src="http://placehold.it/300x300">
</div>
<div class="two">
<img class="portfolio" src="http://placehold.it/300x300">
<img class="portfolio padding" src="http://placehold.it/300x300">
<img class="portfolio padding" src="http://placehold.it/300x300">
</div>
<div class="three">
<img class="portfolio" src="http://placehold.it/300x300">
<img class="portfolio padding" src="http://placehold.it/300x300">
<img class="portfolio padding" src="http://placehold.it/300x300">
</div>
<div class="four">
<img class="portfolio" src="http://placehold.it/300x300">
<img class="portfolio padding" src="http://placehold.it/300x300">
<img class="portfolio padding" src="http://placehold.it/300x300">
</div>
</div>
</body>
</html>
This should get you close:
#container_port {
text-align: center;
}
EDIT: I also just noticed that you have .container_port in your CSS above while it's clearly an ID and not a CLASS.
the image element is an inline-block element. You could change it to a block-level element or you could use margin: 0 50%;