In this organization chart, the spacing between the list elements become too large(ex. between name3 and name5, between name5 and name12, between name6 and name11). How can we reduce the spaces between them, so that it can be view in one page without horizontal scrolling. Please help with this
I have attached the code which I tried
* {
margin: 0;
padding: 0;
}
.img-quadrata {
border-radius: 50%;
width: 100px;
height: 100px;
}
.text-center {
margin-top: 10px;
font-size: 1.2em;
}
small {
text-align: center;
font-size: 0.8em;
text-decoration: none;
color: gray;
}
.tree {
text-align: center;
padding-left: 10px;
}
.tree ul {
display: block;
white-space: nowrap;
padding-top: 15px;
position: relative;
transition: all 0.5s;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
}
.tree li {
vertical-align: top;
display: inline-block;
white-space: normal;
text-align: center;
list-style-type: none;
position: relative;
padding: 20px 0px 0px 60px;
transition: all 0.5s;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
}
/*We will use ::before and ::after to draw the connectors*/
.tree li::before,
.tree li::after {
content: '';
position: absolute;
top: 0;
right: 50%;
border-top: 1px solid #ccc;
width: 60%;
height: 15px;
}
.tree li::after {
right: auto;
left: 50%;
border-left: 1px solid #ccc;
}
/*Remove left-right connectors from elements without any siblings*/
.tree li:only-child::after,
.tree li:only-child::before {
display: none;
}
/*Remove space from the top of single children*/
.tree li:only-child {
padding-top: 0;
}
/*Remove left connector from first child and right connector from last child*/
ul.first li.first::before,
ul.first li.first::after {
border: 0 none;
}
.tree li:first-child::before,
.tree li:last-child::after {
border: 0 none;
}
/*Adding back the vertical connector to the last nodes*/
.tree li:last-child::before {
border-right: 1px solid #ccc;
border-radius: 0 5px 0 0;
-webkit-border-radius: 0 5px 0 0;
-moz-border-radius: 0 5px 0 0;
}
.tree li:first-child::after {
border-radius: 5px 0 0 0;
-webkit-border-radius: 5px 0 0 0;
-moz-border-radius: 5px 0 0 0;
}
/*Time to add downward connectors from parents*/
.tree ul ul::before {
content: '';
position: absolute;
top: 0;
left: 50%;
border-left: 1px solid #ccc;
width: 0;
height: 15px;
}
<div class="tree">
<ul class="first">
<li class="first techops">
<div class="col-md-4">
<img src="https://ununsplash.imgix.net/photo-1417024321782-1375735f8987?q=75&fm=jpg&s=7af3f809a9c1b90b7fcbd71655b661bc" class="img-quadrata center-block">
<h3 class="text-center">Name1
<br/>
<small> Designation</small></h3>
</div>
<ul>
<li class="first techops">
<div class="col-md-4">
<img src="https://ununsplash.imgix.net/photo-1417024321782-1375735f8987?q=75&fm=jpg&s=7af3f809a9c1b90b7fcbd71655b661bc" class="img-quadrata center-block">
<h3 class="text-center">Name2
<br/>
<small> Designation</small></h3>
</div>
</li>
</ul>
<ul>
<li>
<div class="col-md-4">
<img src="https://ununsplash.imgix.net/photo-1417024321782-1375735f8987?q=75&fm=jpg&s=7af3f809a9c1b90b7fcbd71655b661bc" class="img-quadrata center-block">
<h3 class="text-center">Name3
<br/>
<small> Designation</small></h3>
</div>
</li>
<li>
<div class="col-md-4">
<img src="https://ununsplash.imgix.net/photo-1417024321782-1375735f8987?q=75&fm=jpg&s=7af3f809a9c1b90b7fcbd71655b661bc" class="img-quadrata center-block">
<h3 class="text-center">Name5
<br/>
<small> Designation</small></h3>
</div>
<ul>
<li>
<div class="col-md-4">
<img src="https://ununsplash.imgix.net/photo-1417024321782-1375735f8987?q=75&fm=jpg&s=7af3f809a9c1b90b7fcbd71655b661bc" class="img-quadrata center-block">
<h3 class="text-center">Name6
<br/>
<small> Designation</small></h3>
</div>
<ul>
<li>
<div class="col-md-4">
<img src="https://ununsplash.imgix.net/photo-1417024321782-1375735f8987?q=75&fm=jpg&s=7af3f809a9c1b90b7fcbd71655b661bc" class="img-quadrata center-block">
<h3 class="text-center">Name7
<br/>
<small> Designation</small></h3>
</div>
</li>
<li>
<div class="col-md-4">
<img src="https://ununsplash.imgix.net/photo-1417024321782-1375735f8987?q=75&fm=jpg&s=7af3f809a9c1b90b7fcbd71655b661bc" class="img-quadrata center-block">
<h3 class="text-center">Name8
<br/>
<small> Designation</small></h3>
</div>
</li>
<li>
<div class="col-md-4">
<img src="https://ununsplash.imgix.net/photo-1417024321782-1375735f8987?q=75&fm=jpg&s=7af3f809a9c1b90b7fcbd71655b661bc" class="img-quadrata center-block">
<h3 class="text-center">Name9
<br/>
<small> Designation</small></h3>
</div>
</li>
<li>
<div class="col-md-4">
<img src="https://ununsplash.imgix.net/photo-1417024321782-1375735f8987?q=75&fm=jpg&s=7af3f809a9c1b90b7fcbd71655b661bc" class="img-quadrata center-block">
<h3 class="text-center">Name10
<br/>
<small> Designation</small></h3>
</div>
</li>
</ul>
</li>
<li>
<div class="col-md-4">
<img src="https://ununsplash.imgix.net/photo-1417024321782-1375735f8987?q=75&fm=jpg&s=7af3f809a9c1b90b7fcbd71655b661bc" class="img-quadrata center-block">
<h3 class="text-center">Name11
<br/>
<small> Designation</small></h3>
</div>
</ul>
</li>
<li>
<div class="col-md-4">
<img src="https://ununsplash.imgix.net/photo-1417024321782-1375735f8987?q=75&fm=jpg&s=7af3f809a9c1b90b7fcbd71655b661bc" class="img-quadrata center-block">
<h3 class="text-center">Name12
<br/>
<small> Designation</small></h3>
</div>
</li>
<li>
<div class="col-md-4">
<img src="https://ununsplash.imgix.net/photo-1417024321782-1375735f8987?q=75&fm=jpg&s=7af3f809a9c1b90b7fcbd71655b661bc" class="img-quadrata center-block">
<h3 class="text-center">Name13
<br/>
<small> Designation</small></h3>
</div>
</li>
<li>
<div class="col-md-4">
<img src="https://ununsplash.imgix.net/photo-1417024321782-1375735f8987?q=75&fm=jpg&s=7af3f809a9c1b90b7fcbd71655b661bc" class="img-quadrata center-block">
<h3 class="text-center">Name14
<br/>
<small> Designation</small></h3>
</div>
</li>
</ul>
</li>
</ul>
</div>
Related
sorry for my English, I'm new with Bootstrap....
I to want to build 4 columns and because of the width from Bootstrap col-sm-3 too small or col-sm-4 too big it is, I do try as here to say, but to come as here to show
how to show the image
How to show are not margin between columns...
Code CSS
.container {margin-top: 13rem; }
.product-grid{
font-family: 'Roboto Condensed', sans-serif;
text-align: center;
overflow: hidden;
position: relative;
border: 4px solid #fff;
margin-top: 170px;
background-color: #ffffff;
}
.product-grid:before{
content: '';
height: 100%;
width: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 1;
transition: all 0.3s ease 0s;
}
.product-grid .product-image a{ display: block; }
.product-grid .product-image img{
width: 60%;
height: auto;
}
.product-grid { width: 300px;}
.product-grid .product-content{
padding: 18px;
position: relative;
z-index: 2;
background-color: white;
}
.product-grid .title{
font-size: 16px;
font-weight: 500;
margin: 0 0 10px 0;
}
.product-grid .title a{ color: #000; }
.product-grid .title a:hover{ color: #fa8231; }
.product-grid .price{
color: #fa8231;
font-size: 18px;
font-weight: 600;
}
.product-grid .price span{
color: #777;
margin: 0 0 0 5px;
font-weight: 300;
display: inline-block;
}
Code HTML
<div class="container">
<div class="row">
<div class="col-sm-3 product-grid">
<div class="product-grid">
<div class="product-image">
<a href="#">
<img alt="" class="bild" src="photo/111.jpg">
</a>
</div>
<div class="product-content">
<h3 class="title">
la
</h3>
<div class="price">
</div>
</div>
</div>
</div>
<div class="col-sm-3 product-grid">
<div class="product-grid">
<div class="product-image">
<a href="#">
<img alt="" class="bild" src="photo/111.jpg">
</a>
</div>
<div class="product-content">
<h3 class="title">
le
</h3>
<div class="price"></div>
</div>
</div>
</div><div class="col-sm-3 col-md-3">
<div class="product-grid">
<div class="product-image">
<a href="#">
<img alt="" class="bild" src="photo/111.jpg">
</a>
</div>
<div class="product-content">
<h3 class="title">
li
</h3>
<div class="price"></div>
</div>
</div>
</div><div class="col-sm-3 col-md-3">
<div class="product-grid">
<div class="product-image">
<a href="#">
<img alt="" class="bild" src="photo/111.jpg">
</a>
</div>
<div class="product-content">
<h3 class="title">
lo
</h3>
<div class="price"></div>
</div>
</div>
</div>
</div><br><br>
</div>
Can Please someone help me und this issue to solve, Thanks!
I am using flex to display pictures. For wide screen all works well but as for for smaller media sizes I would like to see div with the class "base" apper under pictures even when they are displayed in a second an third row. How could I implement this?
Take a look at it on Codepen
<div class="container">
<div class="bookshelf">
<div class="bookshelf-background">
<div class="base"></div>
</div>
<div class="bookshelf-images">
<ul class="container">
<li class="flex flex1">
<a href="#" class="img">
<div style="width: 250px">
<img src="https://image.shutterstock.com/image-illustration/amazing-word-pop-art-retro-
600w-1112517635.jpg" style="width: 150px;">
</div>
</a>
</li>
<li class="flex flex1">
<a href="#" class="img">
<div style="width: 250px">
<img src="https://image.shutterstock.com/image-illustration/amazing-word-pop-art-retro-
600w-1112517635.jpg" style="width: 150px;">
</div>
</a>
</li>
</ul>
</div>
</div>
</div>`
Can you please check with this code, hope it will resolve your query. First, we remove static "base" class div and add background in separate list item using pseudo-element.
.flex {
margin-bottom: 50px;
color: white;
font-size: 20px;
text-align: center;
position: relative;
}
.bookshelf-images .flex {
position: relative;
padding-bottom: 14px;
}
.bookshelf-images .flex:before {
content: "";
width: 100%;
height: 45px;
border-bottom: 9px solid fuchsia;
position: absolute;
left: 0;
bottom: 0;
background: #35091b;
}
.bookshelf-images .flex a{
position: relative;
}
.container {
max-width: 800px;
background: none;
margin-bottom: 0px;
text-align: center;
display: flex;
flex-wrap: wrap;
margin-top: -3px;
}
.container .bookshelf {
display: flex;
position: relative;
}
.container .bookshelf-images {
height: 100%;
}
.container .bookshelf-image {
height: 100%;
position: relative;
max-width: 100%;
display: flex;
}
li {
list-style-type: none;
}
ul {
margin-left: 0;
padding-left: 0;
}
.container .bookshelf-background {
position: absolute;
border: 0px solid #ff0000;
left: 0;
bottom: 45px;
width: 100%;
height: 42px;
}
.container .bookshelf-background .base {
width: 100%;
height: 100%;
border: 0px solid #fff000;
box-shadow: 0px 9px 1px fuchsia;
position: absolute;
background: #35091b;
}
<div class="container">
<div class="bookshelf">
<!-- <div class="bookshelf-background">
<div class="base"></div>
</div> -->
<div class="bookshelf-images">
<ul class="container">
<li class="flex flex1">
<a href="#" class="img">
<div style="width: 250px">
<img
src="https://image.shutterstock.com/image-illustration/amazing-word-pop-art-retro-600w-1112517635.jpg"
style="width: 150px;"
/>
</div>
</a>
</li>
<li class="flex flex1">
<a href="#" class="img">
<div style="width: 250px">
<img
src="https://image.shutterstock.com/image-illustration/amazing-word-pop-art-retro-600w-1112517635.jpg"
style="width: 150px;"
/>
</div>
</a>
</li>
<li class="flex flex1">
<a href="#" class="img">
<div style="width: 250px">
<img
src="https://image.shutterstock.com/image-illustration/amazing-word-pop-art-retro-600w-1112517635.jpg"
style="width: 150px;"
/>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
[Web design noob]
I'm trying to create layout like below:
Here's what I have tried so far:
.inner,
.outer {
position: relative;
}
.dash {
border: 0;
border-top: 1px dashed #cfcfcf;
}
.vertical-line {
width: 2px;
height: 100px;
background: 100% #4a90e2;
margin: 0 auto;
}
.outer {
width: 10px;
height: 10px;
border: 1px solid #4a90e2;
border-radius: 50%;
}
.inner {
background-color: #4a90e2;
top: 25%;
left: 25%;
width: 50%;
height: 50%;
border: 1px solid #4a90e2;
border-radius: 50%;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Opportunity</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.0/css/bootstrap.min.css">
</head>
<body>
<div>
<div class="container">
<div class="row">
<div class="col">
<h1 style="font-size:15px;padding-top:34px;font-family:Lato, sans-serif;font-weight:bold;">HOW YOU CAN REACH MICHAEL</h1>
<hr style="max-width:60px;height:8px;max-height:8px;margin-left:1px;">
</div>
<div class="col-lg-5" style="margin-top:34px;margin-right:40px;">
<div class="row rounded" style="background-image: linear-gradient(-140deg, #2217A4 0%, #8326B8 100%);">
<div class="col" style="padding-top:5px;">
<h5 style="font-size:10px;color:rgb(255,255,255);font-family:Lato, sans-serif;font-weight:bold;margin-top:1px;">Reach out to Philip, for an introduction</h5>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-lg-1" style="padding-right:0px;padding-left:0px;padding-top:12px;"><img src="https://cdn.pixabay.com/photo/2018/08/28/12/41/avatar-3637425_960_720.png" class="rounded pull-right" style="min-width:50px;max-width:50px;">
<div class="vertical-line" style="margin-right:24px;"></div>
<div class="outer" style="margin-right:0px;padding-right:0px;">
<div class="inner" style="padding-right:-3px;"></div>
</div>
</div>
<div class="col" style="padding-top:12px;">
<h5 style="font-size:15px;margin-bottom:0px;font-family:Lato, sans-serif;font-weight:bold;">John Doe (You)</h5>
<h5 style="color:#797979;font-size:15px;font-family:Lato, sans-serif;">Founder at ESOP International</h5>
<hr class="dash" style="margin-top:45px;">
</div>
<div class="col-md-6"></div>
</div>
<div class="row">
<div class="col-md-6"></div>
<div class="col-md-6"></div>
</div>
<div class="row">
<div class="col-md-6"></div>
<div class="col-md-6"></div>
</div>
<div class="row">
<div class="col-md-6"></div>
<div class="col-md-6"></div>
</div>
</div>
</div>
</body>
</html>
Can anyone please help me in
Aligning vertical and horizontal 'lines' in between cols
Adding rectangle like on right side of layout?
I have changed the layout based on your image structure. Include bootstrap and try the below code. I hope this solution will be helpful.
* {
box-sizing: border-box;
position: relative;
font-family: Lato, sans-serif;
}
.combo-box h5 {
background-image: linear-gradient(-140deg, #2217A4 0%, #8326B8 100%);
font-size: 11px;
color: rgb(255, 255, 255);
font-family: Lato, sans-serif;
font-weight: bold;
padding: 10px 10px;
text-align: center;
border-radius: 3px;
}
.combo-box h3 {
font-size: 15px;
font-family: Lato, sans-serif;
font-weight: bold;
position: relative;
}
.combo-box h3::after {
position: absolute;
content: "";
width: 70px;
background-color: rgba(0, 0, 0, 0.1);
height: 1px;
bottom: -8px;
left: 0;
}
.combo-box {
padding: 0 25px;
}
.combo-box ul {
margin: 0;
padding: 0;
list-style: none;
position: relative;
}
.combo-box ul:last-child:before {}
.combo-box ul::before {
position: absolute;
content: "";
background: #4b90e2;
width: 1px;
height: 100%;
left: 30px;
}
.combo-box ul li {
position: relative;
margin: 0 0 0;
padding: 0 0 0;
list-style: none;
}
.combo-box .img img {
width: 60px;
}
.combo-box .profile-desc h4 {
font-size: 15px;
font-weight: 600;
margin: 0 0 0;
}
.combo-box .profile-desc small {
color: #888;
}
.combo-box li.left {
display: flex;
}
.combo-box ul li.right::after {
position: absolute;
content: "";
width: 12px;
height: 12px;
border: 1px solid #4b90e2;
border-radius: 50%;
left: 25px;
top: 40%;
background: #fff;
padding: 2px;
}
.combo-box ul li.right:before {
border-top: 2px dashed #ccc;
position: absolute;
content: "";
left: 30px;
width: 85%;
top: 50%;
}
.combo-box .inner-desc {
display: flex;
}
.combo-box ul li.right .inner-desc:before {
position: absolute;
content: "";
left: 28px;
background: #4b90e2;
width: 6px;
height: 6px;
border-radius: 50%;
top: 47%;
z-index: 9;
}
.combo-box ul li.right {
text-align: right;
}
.combo-box ul li.right p {
margin-left: auto;
text-align: right;
font-size: 12px;
display: inline-block;
background: #f8f8f8;
border: 1px solid #e6e6e6;
padding: 5px 8px;
margin-bottom: 0;
line-height: 18px;
border-radius: 3px;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container my-5">
<div class="combo-box">
<div class="row">
<div class="col-md-7">
<h3>HOW YOU CAN REACH MICHAEL</h3>
</div>
<div class="col-md-5">
<h5>Reach out to Philip, for an introduction</h5>
</div>
</div>
<ul>
<li class="left">
<div class="img mr-3">
<img src="https://cdn.pixabay.com/photo/2018/08/28/12/41/avatar-3637425_960_720.png" class="img-fluid">
</div>
<div class="profile-desc">
<h4>John Doe (You)</h4>
<small>Founder at ESOP International</small>
</div>
</li>
<li class="right">
<div class="inner-desc">
<p>Lorem Ipsum is simply dummy text of
<br>typesetting industry. </p>
</div>
</li>
</ul>
<ul>
<li class="left">
<div class="img mr-3">
<img src="https://cdn.pixabay.com/photo/2018/08/28/12/41/avatar-3637425_960_720.png" class="img-fluid">
</div>
<div class="profile-desc">
<h4>John Doe (You)</h4>
<small>Founder at ESOP International</small>
</div>
</li>
<li class="right">
<div class="inner-desc">
<p>Lorem Ipsum is simply dummy text of
<br>typesetting industry. </p>
</div>
</li>
</ul>
<ul>
<li class="left">
<div class="img mr-3">
<img src="https://cdn.pixabay.com/photo/2018/08/28/12/41/avatar-3637425_960_720.png" class="img-fluid">
</div>
<div class="profile-desc">
<h4>John Doe (You)</h4>
<small>Founder at ESOP International</small>
</div>
</li>
<li class="right">
<div class="inner-desc">
<p>Lorem Ipsum is simply dummy text of
<br>typesetting industry. </p>
</div>
</li>
</ul>
<ul>
<li class="left">
<div class="img mr-3">
<img src="https://cdn.pixabay.com/photo/2018/08/28/12/41/avatar-3637425_960_720.png" class="img-fluid">
</div>
<div class="profile-desc">
<h4>John Doe (You)</h4>
<small>Founder at ESOP International</small>
</div>
</li>
</ul>
</div>
</div>
I have tried by changing some of the structure
have a look at the pen.
I have used the positioning by position: absolute; of the line and round dot.
Please check and ask if any query
.inner,
.outer {
position: relative;
}
.dash {
border: 0;
border-top: 1px dashed #cfcfcf;
}
.vertical-line {
width: 2px;
height: 100px;
background: 100% #4a90e2;
margin: 0 auto;
}
.outer {
width: 10px;
height: 10px;
border: 1px solid #4a90e2;
border-radius: 50%;
}
.inner {
background-color: #4a90e2;
top: 25%;
left: 25%;
width: 50%;
height: 50%;
border: 1px solid #4a90e2;
border-radius: 50%;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Opportunity</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,700i,900">
<link rel="stylesheet" href="assets/css/styles.min.css">
</head>
<body>
<div>
<div class="container">
<div class="row">
<div class="col">
<h1 style="font-size:15px;padding-top:34px;font-family:Lato, sans-serif;font-weight:bold;">HOW YOU CAN REACH MICHAEL</h1>
<hr style="max-width:60px;height:8px;max-height:8px;margin-left:1px;">
</div>
<div class="col-lg-5" style="margin-top:34px;margin-right:40px;">
<div class="row rounded" style="background-image: linear-gradient(-140deg, #2217A4 0%, #8326B8 100%);">
<div class="col" style="padding-top:5px;">
<h5 style="font-size:10px;color:rgb(255,255,255);font-family:Lato, sans-serif;font-weight:bold;margin-top:1px;">Reach out to Philip, for an introduction</h5>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-lg-1" style="padding-right:0px;padding-left:0px;padding-top:12px;"><div style="
position: relative;
display: inline-block;
"><img src="https://cdn.pixabay.com/photo/2018/08/28/12/41/avatar-3637425_960_720.png" class="rounded pull-right" style="min-width:50px;max-width:50px;">
<div class="vertical-line" style="position: absolute;left: 50%;margin-left: -1px;"></div>
<div class="outer" style="margin-right:0px;padding-right:0px;position: absolute;left: 50%;transform: translateX(-50%);top: 85px;z-index: 9;background-color: white;">
<div class="inner" style="padding-right:-3px;"></div>
</div></div></div>
<div class="col" style="padding-top:12px;">
<h5 style="font-size:15px;margin-bottom:0px;font-family:Lato, sans-serif;font-weight:bold;">John Doe (You)</h5>
<h5 style="color:#797979;font-size:15px;font-family:Lato, sans-serif;">Founder at ESOP International</h5>
<hr class="dash" style="margin-top:45px;">
</div>
<div class="col-md-6"></div>
</div>
<div class="row">
<div class="col-md-6"></div>
<div class="col-md-6"></div>
</div>
<div class="row">
<div class="col-md-6"></div>
<div class="col-md-6"></div>
</div>
<div class="row">
<div class="col-md-6"></div>
<div class="col-md-6"></div>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.0/js/bootstrap.bundle.min.js"></script>
</body>
</html>
Here's a link to a CodePen
This question already has answers here:
Add rounded borders to selected corners of an element
(2 answers)
Closed 5 years ago.
I have created a broken border effect but I do not want the sharp look on the end of the border I would like it boxed off. I have messed with border-radius and everything i can think of but cant think of anything. Any input would be much appreciated.
I would like for it to look like this:
.container{padding-top: 40px;}
a h3{margin-top:0!important;}
.col-sm-15{
width: 18%;
margin:1%;
height: 4em;
float:left;
position:relative;
}
.col-sm-15 .wrap:before{
content: '';
position: absolute;
width: 50%;
height: calc(100% - 10px);
bottom: 0;
left: 0;
border: 10px solid transparent;
border-bottom-color: #330099;
border-left-color: #330099;
}
.col-sm-15 .wrap:after{
content: '';
position: absolute;
width: 50%;
height: calc(100% - 10px);
top: 0;
right: 0;
border: 10px solid transparent;
border-top-color: #330099;
border-right-color:#330099;
}
a h3{
font-size: 20px;
color: #000000;
padding: 10px;
margin-top: 3.2em;
}
a:hover{text-decoration: none;}
a:hover h3{color: #330099;}
<section id="funnnels">
<div class="container">
<div class="row padd">
<div class="col-sm-15 text-center">
<a href="#">
<div class="wrap">
<h3>Option 1</h3>
</div>
</a>
<div class="clearfix"></div>
</div>
<div class="col-sm-15 text-center">
<a href="#">
<div class="wrap">
<h3>option 2</h3>
</div>
</a>
<div class="clearfix"></div>
</div>
<div class="col-sm-15 text-center">
<a href="#">
<div class="wrap">
<h3>option 3</h3>
</div>
</a>
<div class="clearfix"></div>
</div>
<div class="col-sm-15 text-center">
<a href="#">
<div class="wrap">
<h3>option 4</h3>
</div>
</a>
<div class="clearfix"></div>
</div>
<div class="col-sm-15 text-center">
<a href="#">
<div class="wrap">
<h3>option 5</h3>
</div>
</a>
<div class="clearfix"></div>
</div>
</div>
</div>
</section>
Do like this instead and the border doesn't get a sharp end
border-bottom: 10px solid #330099;
border-left: 10px solid #330099;
I also reduced the height a little more than the set 10px, to 30px (height: calc(100% - 30px);)
Stack snippet
.container {
padding-top: 40px;
}
a h3 {
margin-top: 0!important;
}
.col-sm-15 {
width: 18%;
margin: 1%;
height: 4em;
float: left;
position: relative;
}
.col-sm-15 .wrap:before {
content: '';
position: absolute;
width: 50%;
height: calc(100% - 30px);
bottom: 0;
left: 0;
border-bottom: 10px solid #330099;
border-left: 10px solid #330099;
}
.col-sm-15 .wrap:after {
content: '';
position: absolute;
width: 50%;
height: calc(100% - 30px);
top: 0;
right: 0;
border-top: 10px solid #330099;
border-right: 10px solid #330099;
}
a h3 {
font-size: 20px;
color: #000000;
padding: 10px;
margin-top: 3.2em;
}
a:hover {
text-decoration: none;
}
a:hover h3 {
color: #330099;
}
<section id="funnnels">
<div class="container">
<div class="row padd">
<div class="col-sm-15 text-center">
<a href="#">
<div class="wrap">
<h3>Option 1</h3>
</div>
</a>
<div class="clearfix"></div>
</div>
<div class="col-sm-15 text-center">
<a href="#">
<div class="wrap">
<h3>option 2</h3>
</div>
</a>
<div class="clearfix"></div>
</div>
<div class="col-sm-15 text-center">
<a href="#">
<div class="wrap">
<h3>option 3</h3>
</div>
</a>
<div class="clearfix"></div>
</div>
<div class="col-sm-15 text-center">
<a href="#">
<div class="wrap">
<h3>option 4</h3>
</div>
</a>
<div class="clearfix"></div>
</div>
<div class="col-sm-15 text-center">
<a href="#">
<div class="wrap">
<h3>option 5</h3>
</div>
</a>
<div class="clearfix"></div>
</div>
</div>
</div>
</section>
I am trying to create a portfolio page for FreeCodeCamp using flexbox for the layout, but I'm having trouble with vertical overflow. The HTML:
<div class="flex-container flex-column top">
<header class="flex-container">
<h1 class="logo"><i class="fa fa-hashtag"></i>DubDev</h1>
<nav>
<ul>
<li>ABOUT</li>
<li>PORTFOLIO</li>
<li>CONTACT</li>
</ul>
</nav>
</header>
<main class="flex-container">
<a name="about"></a>
<section class="about">
<h2>About Me</h2>
</section>
<a name="project"></a>
<section class="projects flex-container">
<article class="card flex-container flex-column">
<img src="http://fpoimg.com/300x250">
<div class="card-title">
<h2>Project 1</h2>
</div>
</article>
<article class="card flex-container flex-column">
<img src="http://fpoimg.com/300x250">
<div class="card-title">
<h2>Project 1</h2>
</div>
</article>
<article class="card flex-container flex-column">
<img src="http://fpoimg.com/300x250">
<div class="card-title">
<h2>Project 1</h2>
</div>
</article>
<article class="card flex-container flex-column">
<img src="http://fpoimg.com/300x250">
<div class="card-title">
<h2>Project 1</h2>
</div>
</article>
<article class="card flex-container flex-column">
<img src="http://fpoimg.com/300x250">
<div class="card-title">
<h2>Project 1</h2>
</div>
</article>
<article class="card flex-container flex-column">
<img src="http://fpoimg.com/300x250">
<div class="card-title">
<h2>Project 1</h2>
</div>
</article>
<article class="card flex-container flex-column">
<img src="http://fpoimg.com/300x250">
<div class="card-title">
<h2>Project 1</h2>
</div>
</article>
<article class="card flex-container flex-column">
<img src="http://fpoimg.com/300x250">
<div class="card-title">
<h2>Project 1</h2>
</div>
</article>
<article class="card flex-container flex-column">
<img src="http://fpoimg.com/300x250">
<div class="card-title">
<h2>Project 1</h2>
</div>
</article>
<article class="card flex-container flex-column">
<img src="http://fpoimg.com/300x250">
<div class="card-title">
<h2>Project 1</h2>
</div>
</article>
</section>
<a name="contact"></a>
<section class="contact">
<h2>Contact Me </h2>
</section>
</main>
<footer class="flex-container">
<p>© 2016 Dubrick Development<p>
</footer>
</div>
The CSS:
#import url(https://fonts.googleapis.com/css?family=Passion+One:400,700);
#import url(https://fonts.googleapis.com/css?family=Droid+Serif:700);
*, *:before, *:after {
box-sizing: inherit;
}
html {
box-sizing: border-box;
}
html, body {
height: 100%;
}
footer, header {
font-family: "Passion One", sans-serif;
font-weight: 400;
background: #1abc9c;
color: white;
width: 100%;
/* flex: 0 0 75px; */
}
footer, header > * {
padding: 0 5px 0 5px;
}
footer {
box-shadow:4px -4px 0 rgba(0,0,0,0.1);
justify-content: center;
align-items: center;
font-size: 18px;
}
header {
box-shadow:4px 4px 0 rgba(0,0,0,0.1);
}
main {
flex-wrap: wrap;
overflow-y: auto;
background-color: #909AA1;
justify-content: center;
position: relative;
flex: 0 1 auto;
}
nav {
flex: 1;
align-self: center;
text-align: right;
padding-right: 20px;
}
nav ul {
list-style-type: none;
margin: 0;
padding: 0;
}
nav ul li {
display: inline;
font-size: 36px;
padding: 10px;
transition: background-color 0.5s ease;
}
nav ul li:hover {
background-color: rgba(0,0,0,0.2);
}
nav ul li a {
color: white;
text-decoration: none;
}
.about {
flex-basis: 1000px;
}
.card {
box-shadow: 0 1.5px 4px rgba(0, 0, 0, 0.24), 0 1.5px 6px rgba(0, 0, 0, 0.12);
flex-basis: 300px;
height: 300px;
margin: 10px;
align-items: center;
}
.card > img {
flex-basis: 250px;
}
.card .card-title {
background-color: white;
flex: 1;
align-self: stretch;
text-align: center;
font-family: "Droid Serif";
}
.flex-container {
display: flex;
}
.flex-column {
flex-direction: column;
}
.logo {
padding: 5px;
border-radius: 5px;
border: 1px solid white;
box-shadow: 1px 1px 5px rgba(0,0,0,0.3);
text-shadow:4px 4px 0 rgba(0,0,0,0.1);
}
.projects {
flex: 0 1 1000px;
flex-wrap: wrap;
justify-content: center;
padding-top: 20px;
padding-bottom: 20px;
background-color: #D8DBDE;
max-height: 100%;
}
.contact {
flex-basis: 1000px;
}
.top {
height: 100%;
}
If I don't set height: 100%; on the top div, there is no overflow, but it doesn't seem to "flex"; that is, main does not fill the space between the header and footer with the header and footer remaining sticky. If I do set height: 100%; on the top div, as shown in the code, main fills the available space, but the flex-item children of section class="projects" now overflow. I'm very new to flexbox, so I'm probably doing something stupid here, but I can't figure out what it is.
Link to codepen
This should be the most apt-solution for you.
if you want your header's height to be relative then you will have to use jquery else you can just set a margin-top: 90px; to #content
new css required
.content{
position: relative;
}
#top-1 {
position: fixed;
top: 0;
width: 100%;
z-index: 1000;
}
footer {
position: fixed;
bottom: 0;
width: 100%;
height: 60px;
margin: 0;
}
small js required to adjust content's margin-top (jquery required)
$(document).ready(function() {
$('#content').css('margin-top', $('#top-1').height() + 'px');
});
http://codepen.io/Rohithzr/pen/PNKmwb