I am working on a menu with CSS where when I point on the third item in the first row of the menu, the item will be bigger and then the second row will be messy. I tried to change the margins of the items and the sizes too, but it didn't work with me. also, I tried to change the padding of the menu body and the size, but nothing worked too.
I hope there is someone who could help.
thank you in advance
https://jsfiddle.net/a1dzbg1v/1/
here are HTML code and CSS
#menu {
padding: 0 10px;
}
.menu {
padding: 3px 5px;
margin: 0 5px;
position: relative;
display: inline-block;
border: 2px solid black;
border-radius: 10px;
float: right;
cursor: pointer;
}
.menu:hover {
background: #f9e8b5;
}
.menu-content {
position: absolute;
right: 0px;
width: 273px;
z-index: 1;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
text-align: center;
border: 1px solid black;
border-radius: 10px;
color: black;
background: linear-gradient(to bottom, #d3bd7b 0%,#ead28a 50%);
height: 0px;
padding: 40px 5px 20px 5px;
-webkit-transition: height 2s ease-out; /* For Safari 3.1 to 6.0 */
transition: height 2s ease-out;
}
.menu-content:hover {
height: auto;
padding: 45px 5px 25px 5px;
-webkit-transition: height 2s ease-out; /* For Safari 3.1 to 6.0 */
transition: height 2s ease-out;
}
.menu .menu-content {
visibility: hidden;
opacity: 0;
-webkit-transition: opacity 1s; /* For Safari 3.1 to 6.0 */
transition: opacity 1s;
}
.menu:hover .menu-content {
display: block;
visibility: visible;
opacity: 1;
}
.menu-header {
position: absolute;
top: 0px;
left: 0px;
width: 283px;
height: 40px;
background: black;
margin: 0px;
padding: 0px;
border-top-right-radius: 10px;
border-top-left-radius: 10px;
}
.menu-header p{
color: #ead28a;
font-weight: bold;
font-size: 20px;
margin: 8px;
}
.menu-footer {
position: absolute;
bottom: 0px;
left: 0px;
width: 283px;
height: 20px;
background: black;
margin: 0px;
padding: 0px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
}
.menu-footer p{
color: #ead28a;
margin: 4px;
}
.menu-item {
visibility: hidden;
list-style-type: none;
height: 60px;
width: 60px;
margin: 15px;
float: left;
border-radius: 10px;
-webkit-transition: width 2s, height 2s, margin 2s, visibility 2s, opacity 1s linear; /* For Safari 3.1 to 6.0 */
transition: width 2s, height 2s, margin 2s, visibility 2s, opacity 1s linear;
}
.menu-content .menu-item{
}
.menu-content:hover .menu-item {
visibility: visible;
opacity: 1;
}
.menu-item:hover {
height: 85px;
width: 85px;
margin: 0px;
background: #f9e8b5;
padding: 0px;
}
.menu-item a {
height: 60px;
width: 60px;
display: block;
text-decoration: none;
border-radius: 10px;
margin: 0px;
border-right: 1px solid black;
border-bottom: 1px solid black;
background: linear-gradient(to bottom, #d3bd7b 0%,#ead28a 50%);
transform: scale(1);
-webkit-transition: width 2s, height 2s; /* For Safari 3.1 to 6.0 */
transition: width 2s, height 2s;
}
.menu-item a:hover {
height: 85px;
width: 85px;
display: block;
margin: 0px;
background: #f9e8b5;
padding: 0px;
transform: scale(1);
}
.menu-item a p {
visibility: hidden;
opacity: 0;
margin: 0px;
-webkit-transition:visibility 2s, opacity 1s linear; /* For Safari 3.1 to 6.0 */
transition: visibility 2s, opacity 1s linear;
-webkit-transition-delay: 0.5s; /* Safari */
transition-delay: 0.5s;
}
.menu-item:hover.menu-item a p {
font-size: 16px;
visibility: visible;
opacity: 1;
}
.menu-item a img {
margin-top: 10px;
}
.menu-item:hover.menu-item a img {
margin-top: 20px;
}
<div id="menu">
<div class="menu">
<spin><img class="icon" src="#" /></spin>
<div class="menu-content">
<div class="menu-header">
<p>User Menu</p>
</div>
<div class="menu-item">
<img class="icon" src="#" /><p>Item 1</p>
</div>
<div class="menu-item">
<img class="icon" src="#" /><p>Item 2</p>
</div>
<div class="menu-item">
<img class="icon" src="#" /><p>Item 3</p>
</div>
<div class="menu-item">
<img class="icon" src="#" /><p>Item 4</p>
</div>
<div class="menu-item">
<img class="icon" src="#" /><p>Item 5</p>
</div>
<div class="menu-item">
<img class="icon" src="#" /><p>Item 6</p>
</div>
<div class="menu-footer">
<p><?php echo date("m-d-Y :: H:i:s");?></p>
</div>
</div>
</div>
</div>
I don't know where the rule about the transformation matrix is coming from; in an element inspector, it shows up in "Computed" styles, but I don't see any rule with a transform matrix in your actual CSS.
That said, I ran your code snippet and the only way I could figure out to fix your problem was to add
clear: left;
to your fourth menu-item div (the Meals one). You can do that the usual way in your stylesheet by calling nth-child or giving that element its own class name. You could also do an inline style but generally I know that's not recommended.
I'm sure there's a better way to fix this that wouldn't involve applying this to only one of your menu item divs, but it works.
Related
When I click my <a> tag for the popup box, the images in the background (with overlay effects) are glowing up, and I don't know why. If anybody know something I write the code under here.
As you can see I've put href to #popup1 in the first <a> tag, and it opens the popup box, but in the background you can see the image like glowing, the border too.
I've changed the display tag and other CSS tags, but nothing.
Here is the Codepen.
the problem is actually you add pop-up before container 2 so that's why it is glowing.
So, if you dont want to make this glow just add your pop-up division after both
containers like this.
Dont change your Css. you just have to change position of divisions like this
<div class="container1" style="cursor:default;">
<div class="container2">
<div class="content">
<a id="ant" href="#popup1" onclick="show('popup2')">
<div class="content-overlay"></div>
<img class="content-image" src="https://i.postimg.cc/5tNkjkV5/2.png" style="z-index: 0;height: 200px;width: 330px;border:2px solid rgb(205,144,76);padding:0;">
<div class="content-details fadeIn-bottom" style="background-size:cover;">
<h3 class="content-title" style="font-family: 'Roboto', sans-serif;">ANTIPASTI</h3>
<p class="content-text"></p>
</div>
</a>
</div>
</div>
<div class="container2">
<div class="content">
<a id="prim">
<div class="content-overlay"></div>
<img class="content-image" src="https://i.postimg.cc/5tNkjkV5/2.png" style="border:2px solid rgb(205,144,76);padding:0; height:200px; width:330px;">
<div class="content-details fadeIn-bottom">
<h3 class="content-title" style="font-family: 'Roboto', sans-serif;"> PRIMI PIATTI </h3>
<p class="content-text"></p>
</div>
</a>
</div>
</div>
</div>
<div id="popup1" class="popup">
×
<h2>The Popup Has Arrived</h2>
<p>QUESTI SONO GLI ANTIPASTI</p>
</div>
<a href="#ant" class="close-popup"></a
It depends on the order of your HTML-Elements. This example will fix the problem
.container1 {
display: flex;
width: 100%;
flex-wrap: wrap;
margin-top: 110px;
align-content: space-around;
justify-content: center;
transition: all 0.2s linear;
}
.container1 > div {
padding: 40px;
justify-content: center;
}
*,
*:before,
*:after {
margin: 0;
padding: 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.main-title {
color: #2d2d2d;
text-align: center;
text-transform: capitalize;
padding: 0.7em 0;
}
.container {
padding: 1em 0;
float: left;
width: 50%;
}
#media screen and (max-width: 640px) {
.container {
display: block;
width: 100%;
}
}
#media screen and (min-width: 900px) {
.container {
width: 33.33333%;
}
}
.container .title {
color: #1a1a1a;
font-family: 'Roboto', sans-serif;
text-align: center;
margin-bottom: 10px;
}
.content {
position: relative;
width: 100%;
max-width: 400px;
height: 100%;
margin: auto;
overflow: hidden;
transition: transform 0.4s;
}
.content .content-overlay {
/* background: rgba(70,34,0);*/
background: rgba(214, 142, 60, 70%);
/* background: rgb(214,142,60);*/
position: absolute;
height: 97%;
width: 100%;
left: 30px;
top: 0;
bottom: 0;
right: 0;
opacity: 0;
-webkit-transition: all 0.4s ease-in-out 0s;
-moz-transition: all 0.4s ease-in-out 0s;
transition: all 0.4s ease-in-out 0s;
}
.content:hover .content-overlay {
opacity: 0.5;
}
.content-details {
position: absolute;
text-align: center;
padding-left: 1em;
padding-right: 1em;
width: 100%;
top: 50%;
left: 50%;
opacity: 0;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
-webkit-transition: all 0.3s ease-in-out 0s;
-moz-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
}
.content:hover .content-details {
top: 50%;
left: 50%;
right: 50%;
opacity: 1;
}
.content-details h3 {
color: #fff;
font-weight: 500;
text-align: center;
letter-spacing: 0.15em;
margin-bottom: 0.5em;
padding-left: 20px;
text-transform: uppercase;
}
.content-details p {
color: #fff;
font-size: 0.8em;
text-align: center;
padding-left: 20px;
}
.fadeIn-bottom {
top: 80%;
}
.fadeIn-top {
top: 20%;
}
.fadeIn-left {
left: 20%;
}
.fadeIn-right {
left: 80%;
}
h1 {
font-size: 3em;
text-align: center;
color: #00898e;
margin: 0;
padding: 30vh 0 1em;
}
h2 {
text-align: center;
white-space: nowrap;
color: #00898e;
}
a {
text-decoration: none;
color: #fff;
}
p {
text-align: left;
}
.btn {
display: inline-block;
padding: 10px 20px;
border: 2px solid #00898e;
border-radius: 10px;
transition: background 0.3s;
}
.btn:hover {
background: #00898e;
}
.popup {
position: fixed;
padding: 10px;
max-width: 500px;
border-radius: 10px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: rgba(255, 255, 255, 0.9);
visibility: hidden;
opacity: 0;
/* "delay" the visibility transition */
-webkit-transition: opacity 0.5s, visibility 0s linear 0.5s;
transition: opacity 0.5s, visibility 0s linear 0.5s;
z-index: 1;
}
.popup:target {
visibility: visible;
opacity: 1;
/* cancel visibility transition delay */
-webkit-transition-delay: 0s;
transition-delay: 0s;
}
.popup-close {
position: absolute;
padding: 10px;
max-width: 500px;
border-radius: 10px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: rgba(255, 255, 255, 0.9);
}
.popup .close {
position: absolute;
right: 5px;
top: 5px;
padding: 5px;
color: #000;
transition: color 0.3s;
font-size: 2em;
line-height: 0.6em;
font-weight: bold;
}
.popup .close:hover {
color: #00e5ee;
}
.close-popup {
background: rgba(0, 0, 0, 0.7);
cursor: default;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
opacity: 0;
visibility: hidden;
/* "delay" the visibility transition */
-webkit-transition: opacity 0.5s, visibility 0s linear 0.5s;
transition: opacity 0.5s, visibility 0s linear 0.5s;
}
.popup:target + .close-popup {
opacity: 1;
visibility: visible;
/* cancel visibility transition delay */
-webkit-transition-delay: 0s;
transition-delay: 0s;
}
<div class="container1" style="cursor: default">
<div class="container2">
<div class="content">
<a id="ant" href="#popup1" onclick="show('popup2')">
<div class="content-overlay"></div>
<img
class="content-image"
src="https://i.postimg.cc/5tNkjkV5/2.png"
style="z-index: 0; height: 200px; width: 330px; border: 2px solid rgb(205, 144, 76); padding: 0"
/>
<div class="content-details fadeIn-bottom" style="background-size: cover">
<h3 class="content-title" style="font-family: 'Roboto', sans-serif">ANTIPASTI</h3>
<p class="content-text"></p>
</div>
</a>
</div>
</div>
<div class="container2">
<div class="content">
<a id="prim">
<div class="content-overlay"></div>
<img
class="content-image"
src="https://i.postimg.cc/5tNkjkV5/2.png"
style="border: 2px solid rgb(205, 144, 76); padding: 0; height: 200px; width: 330px"
/>
<div class="content-details fadeIn-bottom">
<h3 class="content-title" style="font-family: 'Roboto', sans-serif">PRIMI PIATTI</h3>
<p class="content-text"></p>
</div>
</a>
</div>
</div>
<!-- The popup should be entered as the last element so that it overlays the other elements -->
<div id="popup1" class="popup">
×
<h2>The Popup Has Arrived</h2>
<p>QUESTI SONO GLI ANTIPASTI</p>
</div>
</div>
In the example here, button.vertical-button__btn with the text "Description" is hoverable and clickable in all browsers but IE. (I've put a CSS border on hover to illustrate this. You can also see when the button is clickable by the 'hand' pointer appearing.)
A caveat: When I say it is not clickable in IE, I mean that the full button text (highlighted in yellow) is not clickable. Oddly, the extreme right edge of the button element does click and hover as intended.
What is causing this behavior, and how can I make the functionality the same in IE as with modern browsers?
I am only interested in supporting IE 11 and Edge... IE 10 and under do not need to be supported.
Edit:
Another odd behavior: If I remove the element div.project__image The button becomes clickable, but I cannot figure out why, and I need the div element to remain.
.project {
-webkit-column-count: 2;
-moz-column-count: 2;
column-count: 2;
padding: 20px;
margin: 30px auto;
width: 740px;
height: 295px;
box-shadow: 0px 4px 10px rgba(0,0,0,0.3);
}
.project__image, .project__text {
position: relative;
width: 280px;
max-width: 408px;
height: 210px;
display: inline-block;
margin: 0 auto;
}
.project__text {
height: 200px;
padding: 20px 8px 20px 8px;
}
.vertical-button {
width: 1px;
height: 20px;
background: #000;
position: absolute;
right: -100px;
top: calc(50% - 10px);
display: flex;
flex-direction: column;
justify-content: center;
opacity: 1;
-webkit-transition: 0.8s;
-moz-transition: 0.8s;
-ms-transition: 0.8s;
-o-transition: 0.8s;
transition: 0.8s;
}
.vertical-button__btn,
.vertical-button__btn:focus,
.vertical-button__btn:active {
background: none;
border: none;
display: inline;
font: inherit;
margin: 0;
padding: 0;
outline: none;
outline-offset: 0;
position: absolute;
top: 0px;
transform-origin: left top;
transform: rotate(90deg) translateX(-32%);
float: right;
padding: 5px;
cursor: pointer;
cursor: hand;
}
.vertical-button__btn:hover {
border: 1px solid red;
}
.vertical-button__stroke {
width: 1000px;
height: 1px;
background: #000;
}
<div class="project project--active">
<div class="project__image">
<a href="http://www.soupisgoodfood.com">
<img class="image" alt="soupisgoodfood.com" src="img/hl.jpg">
</a>
</div>
<div class="project__text">
<h3 class="project__heading">Soup Overflow</h3>
<p class="project__tagline">Soup Overflow, the creative agency of Vegetables</p>
<ul>
<li class="project__list-item">
<a class="project__link" href="http://www.soupisgoodfood.com">View Flavors</a>
</li>
<li class="project__list-item project__button">
<a class="project__link" href="">Description</a>
</li>
</ul>
<div class="vertical-button">
<button class="vertical-button__btn" style="background-color: yellow;">Description</button>
<div class="vertical-button__stroke"></div>
</div>
</div>
</div>
I do believe that it's a matter of z-index.
If you add a z-index: 200 to your vertical-button, the button will be clickable, even in IE.
.project {
-webkit-column-count: 2;
-moz-column-count: 2;
column-count: 2;
padding: 20px;
margin: 30px auto;
width: 740px;
height: 295px;
box-shadow: 0px 4px 10px rgba(0,0,0,0.3);
}
.project__image, .project__text {
position: relative;
width: 280px;
max-width: 408px;
height: 210px;
display: inline-block;
margin: 0 auto;
}
.project__text {
height: 200px;
padding: 20px 8px 20px 8px;
}
.vertical-button {
width: 1px;
height: 20px;
background: #000;
position: absolute;
right: -100px;
top: calc(50% - 10px);
display: flex;
flex-direction: column;
justify-content: center;
opacity: 1;
-webkit-transition: 0.8s;
-moz-transition: 0.8s;
-ms-transition: 0.8s;
-o-transition: 0.8s;
transition: 0.8s;
z-index: 200
}
.vertical-button__btn,
.vertical-button__btn:focus,
.vertical-button__btn:active {
background: none;
border: none;
display: inline;
font: inherit;
margin: 0;
padding: 0;
outline: none;
outline-offset: 0;
position: absolute;
top: 0px;
transform-origin: left top;
transform: rotate(90deg) translateX(-32%);
float: right;
padding: 5px;
cursor: pointer;
cursor: hand;
}
.vertical-button__btn:hover {
border: 1px solid red;
}
.vertical-button__stroke {
width: 1000px;
height: 1px;
background: #000;
}
<div class="project project--active">
<div class="project__image">
<a href="http://www.soupisgoodfood.com">
<img class="image" alt="soupisgoodfood.com" src="img/hl.jpg">
</a>
</div>
<div class="project__text">
<h3 class="project__heading">Soup Overflow</h3>
<p class="project__tagline">Soup Overflow, the creative agency of Vegetables</p>
<ul>
<li class="project__list-item">
<a class="project__link" href="http://www.soupisgoodfood.com">View Flavors</a>
</li>
<li class="project__list-item project__button">
<a class="project__link" href="">Description</a>
</li>
</ul>
<div class="vertical-button">
<button class="vertical-button__btn" style="background-color: yellow;">Description</button>
<div class="vertical-button__stroke"></div>
</div>
</div>
</div>
I have a progress bar that uses arrows but the only way I know how to make it is using pixels. So I am wondering if there is a way to create this progress bar using pixels, and then change its size according to the page. I have looked at similar questions, but none pertain to the type of element I am creating. Attached is what the bar currently looks like, and I want to be able to make it adaptable to the screen size.
.containerr {
font-family: 'Lato', sans-serif;
float: left;
position: relative;
width: 70%;
height: 100%;
}
.wrapperr {
float: left;
width: 70%;
height: 100%;
position: relative;
/*overflow:auto;*/
}
.pull-right {
}
a:hover {
color: #999;
}
/* Breadcrups CSS */
.arrow-steps {
zoom: 1.4;
position: relative;
display: inline-flex;
vertical-align: top;
}
.arrow-steps .step {
font-size: 100%;
text-align: center;
color: #666;
cursor: default;
margin: 0 3px;
padding: 10px 10px 10px 30px;
min-width: 180px;
float: left;
position: relative;
background-color: #d9e3f7;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
transition: background-color 0.2s ease;
}
.arrow-steps .step:after, .arrow-steps .step:before {
content: " ";
position: absolute;
top: 0;
right: -17px;
width: 0;
height: 0;
border-top: 20px solid transparent;
border-bottom: 19px solid transparent;
border-left: 17px solid #d9e3f7;
z-index: 2;
transition: border-color 0.2s ease;
}
.arrow-steps .step:before {
right: auto;
left: 0;
border-left: 17px solid #333;
z-index: 0;
}
.arrow-steps .step:first-child:before {
border: none;
}
.arrow-steps .step:first-child {
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
.arrow-steps .step span {
position: relative;
}
.arrow-steps .step span:before {
opacity: 0;
content: "✔";
position: absolute;
top: -2px;
left: -20px;
}
.arrow-steps .step.done span:before {
opacity: 1;
-webkit-transition: opacity 0.3s ease 0.5s;
-moz-transition: opacity 0.3s ease 0.5s;
-ms-transition: opacity 0.3s ease 0.5s;
transition: opacity 0.3s ease 0.5s;
}
.arrow-steps .step.current {
color: #fff;
background-color: #23468c;[![enter image description here][1]][1]
}
html
<div class="containerr">
<div class="wrapperr">
<div class="arrow-steps clearfix">
<div runat="server" id="first" class="step">
<asp:LinkButton ID="machineLink" CssClass="arrowTexts" runat="server" OnClick="machineLink_Click" OnClientClick="getCoordinates()">Safety</asp:LinkButton>
</div>
<div runat="server" id="second" class="step">
<asp:LinkButton ID="estopLink" CssClass="arrowTexts" runat="server" OnClick="estop_Click" OnClientClick="getCoordinates()">Estop Reset
</asp:LinkButton>
</div>
<div runat="server" id="third" class="step">
<asp:LinkButton ID="startLink" CssClass="arrowTexts" runat="server" OnClick="start_Click" OnClientClick="getCoordinates()">Start</asp:LinkButton>
</div>
</div>
</div>
</div>
You can utilize vh vw vmin and vmax to make your progress-bar responsive.
See this codepen
This question already has answers here:
Keep the middle item centered when side items have different widths
(12 answers)
Closed 5 years ago.
My title is being centered inside the flex box content area of my webpage. It's about 30 pixels to the right. Should I change the dimensions of the flex box? If so, how? Advice is greatly appreciated!
a {
outline: 0;
}
body {
background: linear-gradient(to bottom, #1D4350, #A43931);
background-attachment: scroll;
font-family: 'PT Mono', monospace;
}
html,
body,
.wrapper {
max-width: 100%;
min-height: 100%;
min-width: 960px;
margin: 0 auto;
}
.wrapper {
position: relative;
}
.content {
height: 1200px;
}
.header {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
}
.Octagon {
color: #2aa186;
line-height: 30%;
margin-top: 25px;
}
.LT {
color: #3a5454;
line-height: 0;
font-style: italic;
text-align: center;
position: relative;
bottom: 33px;
}
.boi {
position: relative;
cursor: pointer;
margin-right: 30px;
padding: 8px 18px;
border: 1px solid #204156;
border-color: #52AEC9;
color: #52AEC9;
transition-duration: 0.25s;
transition-timing-function: ease-in-out;
border-top-left-radius: 15px;
border-bottom-left-radius: 15px;
}
.iob {
position: relative;
cursor: pointer;
margin-left: 30px;
padding: 8px 18px;
border: 1px solid #204156;
border-color: #52AEC9;
color: #52AEC9;
transition-duration: 0.25s;
transition-timing-function: ease-in-out;
border-top-right-radius: 15px;
border-bottom-right-radius: 15px;
}
.boi:active,
.iob:active {
top: 3px;
}
.boi:hover,
.iob:hover {
text-shadow: 0 0 10px #a193ff;
}
.manyarms,
.colorful {
position: absolute;
margin-top: 30px;
margin-left: 30px;
}
.A1 img {
-webkit-transition: all 0.75s ease-in-out;
-moz-transition: all 0.75s ease-in-out;
-ms-transition: all 0.75s ease-in-out;
-o-transition: all 0.75s ease-in-out;
transition: all 0.75s ease-in-out;
}
.manyarms,
.A1:hover .colorful {
-webkit-opacity: 1;
-moz-opacity: 1;
opacity: 1;
}
.A1:hover .manyarms,
.colorful {
-webkit-opacity: 0;
-moz-opacity: 0;
opacity: 0;
}
.A2 img {
-webkit-transition: all 0.75s ease-in-out;
-moz-transition: all 0.75s ease-in-out;
-ms-transition: all 0.75s ease-in-out;
-o-transition: all 0.75s ease-in-out;
transition: all 0.75s ease-in-out;
}
.sensible,
.A2:hover .BlueBoi {
-webkit-opacity: 1;
-moz-opacity: 1;
opacity: 1;
}
.A2:hover .sensible,
.BlueBoi {
-webkit-opacity: 0;
-moz-opacity: 0;
opacity: 0;
}
.sensible,
.BlueBoi {
margin-top: 30px;
margin-right: 20px;
right: 10px;
position: absolute;
}
.VS {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
}
.verr {
padding-left: 31px;
padding-top: 263px;
}
.special {
padding-right: 71px;
padding-top: 263px;
}
.footer {
bottom: 0;
left: 0;
margin-right: 10px;
position: fixed;
text-align: right;
width: 100%;
}
<div class="wrapper">
<div class="header">
<a href="https://www.google.com/?gws_rd=ssl" target="_blank" style="text-decoration: none;">
<p class="iob">Information</p>
</a>
<h1 class="Octagon">The Pragmatic Octopus</h1>
<a href="https://www.google.com/?gws_rd=ssl" style="text-decoration: none;" target="_blank">
<p class="boi">Contact</p>
</a>
</div>
<p class="LT">Certes</p>
<div class="content">
<div class="A1">
<img src="https://s32.postimg.org/406x38nlh/imageedit_1_3827627792.jpg" alt="hecc" style="width:310px; height:250px;" class="manyarms">
<img src="https://s-media-cache-ak0.pinimg.com/736x/de/71/29/de71292c5df818b418fe09cbca9c49c2.jpg" alt="hecc2" style="width:310px; height:250px;" class="colorful">
</div>
<div class="A2">
<img src="http://www.wonderslist.com/wp-content/uploads/2014/07/Blue-ringed-octopus.jpg" alt="hecc3" style="width:310px; height:250px;" class="sensible">
<img src="http://img03.deviantart.net/a0a6/i/2010/007/6/4/octopus_by_mnk7.jpg" alt="hecc4" style="width:310px; height:250px;" class="BlueBoi">
</div>
<div class="VS">
<p style="color: #6458b7;" class="verr">Here comes a very special boi!</p>
<p style="color:#6458b7;" class="special">He loves to pose for photos!</p>
</div>
</div>
<div class="footer">
©Hecc™®
</div>
</div>
Here's the code you're using to align your flex items:
.header {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
}
With space-between the "Information" and "Contact" elements will be positioned at opposite edges of the container.
Because a flex container aligns items based on the distribution of free space, your middle item will be centered between them, not necessarily centered on the page.
With "Information" having a computed width of 174px, and "Contact" having a computed width of 135px, the middle item is off-center by 39px.
In order for the middle item to be centered on the page, its siblings would need to be equal width, so there is an equal balance of space on both sides.
The following post has two methods for centering items in a flex container when siblings vary in size:
Methods for Aligning Flex Items along the Main Axis (see box #71)
I'm well aware that this is a recurring question. I've checked my code but as far as I can see it should work. It should work without using media queries or vw.(I think)
The intention: Having an image and when I hover over it a text appears.
The problem: The text appears, but it is not responsive.
Please let me know what should I do differently.
Thank you for your time.
HTML:
<section id="recent-news">
<div class="container">
<div class="center wow fadeInDown">
<h2>Recent News</h2>
<h3 class="lead">The latest news about the school, research, students and more.</h3>
</div>
<div class="row">
<div class="col-xs-4 col-sm-4 col-md-3">
<div class="recent-news-wrap">
<img class="img-responsive" src="images/portfolio/recent/item1.png" alt="">
<div class="overlay">
<div class="recent-news-inner">
<h3 class = "text-center">Mobile Development </h3>
<p>We lead the field. Read more about the latest updates in this field.</p>
<a class="preview" href="images/portfolio/full/item1.png" rel="prettyPhoto"><i class="fa fa-eye"></i> View</a>
</div>
</div>
</div>
</div>
CSS:
#recent-news .col-xs-4.col-sm-4.col-md-3{
padding: 8px;
}
#recent-news{
padding-bottom: 70px;
}
.recent-news-wrap {
position: relative;
}
.recent-news-wrap img{
width: 100%;
}
.recent-news-wrap .recent-news-inner{
top: 0;
background: transparent;
opacity: .8;
width: 100%;
border-radius: 0;
margin-bottom: 0;
}
.recent-news-wrap .recent-news-inner h3{
margin: 10px 0;
}
.recent-news-wrap .recent-news-inner h3 a{
font-size: 24px;
color: #fff;
}
.recent-news-wrap .overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
border-radius: 0;
background: #3579DC;
color: #fff;
vertical-align: middle;
-webkit-transition: opacity 500ms;
-moz-transition: opacity 500ms;
-o-transition: opacity 500ms;
transition: opacity 500ms;
padding: 30px;
text-align: center;
}
.recent-news-wrap .overlay .preview {
bottom: 0;
display: inline-block;
height: 35px;
line-height: 35px;
border-radius: 0;
background: transparent;
text-align: center;
color: #fff;
}
.recent-news-wrap:hover .overlay {
opacity: 1;
}
By responsive I am guessing you want the overlay to fit on the page.
Use width: calc() inside of .recent-news-wrap .overlay {} like this:
.recent-news-wrap .overlay {
position: absolute;
top: 0;
left: 0;
width: calc(100% - 60px);
height: 100%;
opacity: 0;
border-radius: 0;
background: #3579DC;
color: #fff;
vertical-align: middle;
-webkit-transition: opacity 500ms;
-moz-transition: opacity 500ms;
-o-transition: opacity 500ms;
transition: opacity 500ms;
padding: 30px;
text-align: center;
}
See fiddle: https://jsfiddle.net/DIRTY_SMITH/2xzj4dqo/1/