Unpleasant small movement in overlapped expanding div - html

When you open it, click in the color aqua div, then make a hover in the first box and click where it says "CLICK ME". You'll see that when the appearing div reaches the border of the windows, there is a little movement in the top border, which is very annoying. I tried a lot of things but i wasn't able to remove it. Any ideas? Thanks in advance.
/* ////// INITIAL RESET AND CONFIGURATIONS ////// */
html {
margin: 0;
padding: 0;
}
body {
margin: 0;
padding: 0;
/* Hide the other pages */
}
body {
margin: 0;
padding: 0;
border: 0;
/*height: 100%; Also works 100vh (View percentage lenght) */
overflow: hidden;
}
ul {
list-style: none;
text-align: center;
}
a {
display: block;
border: none;
text-decoration: none;
color: black;
cursor: default;
}
/*================================== PAGE SLIDE TRANSITION ==================================*/
/* Basic Style/Positioning for all Pages */
.pages,
.page,
.page .backbutton,
.page .nextbutton {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
.page .backbutton,
.page .nextbutton {
height: 10%;
background-color: red;
z-index: 1;
}
.page .backbutton {
top: 0%;
}
.page .nextbutton {
top: 90%;
background-color: aqua;
}
/* Pages */
#i2 {
top: 100%;
}
#i3 {
top: 200%;
}
/* Slide Effect */
.pages {
-webkit-transition: top 0.8s;
-moz-transition: top 0.8s;
-o-transition: top 0.8s;
-ms-transition: top 0.8s;
transition: top 0.8s;
}
#a1:target .pages {
top: 0%;
}
#a2:target .pages {
top: -100%;
}
#a3:target .pages {
top: -200%;
}
#i1 {
background-color: #fff;
}
#i2 {
background-color: #bbb;
}
#i3 {
background-color: #777;
}
/*================================== PAGE ONE ==================================*/
/* ////// ELEMENT'S POSITION ////// */
#i1 {
background-color: bisque;
/*position:relative; stacking context */
}
/* ////// HOVER ////// */
.menu li a:hover {
background: teal;
visibility: visible;
}
#i1 .menu li a:hover + .image {
top: 0;
}
#i1 .menu li a {
z-index: 3;
position: relative;
}
#i1 li .image {
position: absolute;
width: 17.5%;
padding: 0px;
border: 0px #999999 solid;
margin: 0px;
height: 100%;
transition: 0.8s;
top: -50%;
}
#i1 .image1 {
background-color: grey;
left: 10%;
}
#i1 .image2 {
background-color: #777777;
left: 27.5%;
}
#i1 .image3 {
background-color: #555555;
left: 45%;
}
#i1 .image4 {
background-color: #333333;
left: 62.5%;
}
/* ////// ICON ////// */
[data-icon]:before {
/* Allows to show the icons */
font-family: 'icomoon';
content: attr(data-icon);
speak: none;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
}
.icon:before {
/* Shows the icon */
float: left;
content: '\e60e';
font-family: 'icomoon';
speak: none;
color: red;
font-size: 50px;
}
#button_menu {
position: absolute;
display: none;
}
label {
position: absolute;
float: left;
top: 75%;
left: 3%;
border: 1px green solid;
}
#button_menu + label {
cursor: pointer;
}
/* ////// MENU OPTION's TRANSITIONS ////// */
.menu {
list-style: none;
box-sizing: border-box;
width: 70%;
padding: 0;
margin: 0;
margin-top: 80vh;
margin-left: 10%;
overflow: hidden;
border: 1px solid #FF0000;
}
li.option {
float: left;
display: inline-block;
box-sizing: border-box;
padding: 0px 55px 0px 55px;
width: 25%;
margin: 0;
margin-top: 20px;
background: yellow;
border: 1px solid #000;
opacity: 0;
transition: .5s;
}
#button_menu:checked ~ .menu a {
cursor: pointer;
}
#button_menu:checked ~ .menu .option {
margin-top: 0px;
opacity: 1;
}
li.option:first-child {
transition-delay: .6s;
}
li.option:nth-child(2) {
transition-delay: .4s;
}
li.option:nth-child(3) {
transition-delay: .2s;
}
li.option:last-child {
transition-delay: 0s;
}
#button_menu:checked ~ .menu li.option:first-child {
transition-delay: 0s;
}
#button_menu:checked ~ .menu li.option:nth-child(2) {
transition-delay: .2s;
}
#button_menu:checked ~ .menu li.option:nth-child(3) {
transition-delay: .4s;
}
#button_menu:checked ~ .menu li.option:last-child {
transition-delay: .6s;
}
/*================================== PAGE TWO ==================================*/
h1,
p {
text-align: center;
padding: 0;
opacity: 0;
transform: scale(10);
transition: all 0.3s ease-in-out 0.1s;
}
.overlay {
display: block;
100%;
width: 100%;
margin: 0;
padding: 0;
}
#ov .overlay_open {
position: absolute;
margin: 0;
height: 100%;
width: 100%;
visibility: hidden;
opacity: 0;
-webkit-transform: scale(0.9);
transform: scale(0.9|);
-webkit-transition: -webkit-transform 0.2s, opacity 0.2s, visibility 0s 0.2s;
transition: transform 0.2s, opacity 0.2s, visibility 0s 0.2s;
background-color: chocolate;
z-index: 2;
}
/* ////// CENTERING THE PICTURES //////*/
.container {
/*occupes all the screen and hide the divs bigger than it*/
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
overflow: hidden;
}
.center {
position: absolute;
left: 50%;
top: 50%;
}
/*div centers in the middle of its parent, with 0
height and with (just a dot)*/
.center-container {
position: absolute;
left: -2500px;
top: -2500px;
/*move it left and top to be centered exactly in the middle from the center doth*/
width: 5000px;
height: 5000px;
line-height: 5000px;
text-align: center;
/*centers horizontally the pictures*/
overflow: hidden;
}
.dyn-box {
display: inline-block;
vertical-align: middle;
line-height: 100%;
}
/*-----------------***-----------------*/
.box {
float: left;
width: 130px;
height: 130px;
margin: 10px;
border: 5px black solid;
overflow: hidden;
}
.b4 {
clear: both;
}
.picture {
position: absolute;
width: 130px;
height: 130px;
background-color: beige;
}
.mask {
position: absolute;
width: 130px;
height: 130px;
overflow: hidden;
background-color: coral;
opacity: 0;
transition: all 0.3s ease-in-out 0.1s;
}
.box .mask:hover {
opacity: 0.4;
}
.box .mask:hover h1 {
transform: scale(1);
opacity: 1;
}
.box .mask:hover p {
transform: scale(1);
opacity: 1;
transition-delay: .2s;
}
#ov:target .overlay_open {
visibility: visible;
opacity: 0.8;
-webkit-transform: scale(1);
transform: scale(1);
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="rock_page.css">
<link rel="stylesheet" type="text/css" href="icons_files/style.css">
<script type="text/javascript" src="jquery-1.11.2.js"></script>
<script type="text/javascript" src="main.js"></script>
<title>Rock n' Roll</title>
</head>
<body>
<div id="a1">
<div id="a2">
<div id="a3">
<div class="pages">
<!-- Second Page #a1 -->
<div id="i1" class="page">
<input type="checkbox" name="button_menu" id="button_menu" />
<label for="button_menu" class="icon"></label>
<!--This also works for the icon instead of the CSS code
<span aria-hidden="true" data-icon="" class="down-arrow">-->
<ul class="menu">
<li class="option">Link 1
<div class="image image1"></div>
</li>
<li class="option">Link 2
<div class="image image2"></div>
</li>
<li class="option">Link 3
<div class="image image3"></div>
</li>
<li class="option">Link 4
<div class="image image4"></div>
</li>
</ul>
</div>
<!-- Second Page #a2 -->
<div id="i2" class="page">
<div class="container">
<div class="center">
<div class="center-container">
<span class="dyn-box">
<div class="box b1">
<div class="picture"></div>
<div class="mask">
<h1>Text</h1>
<p>Lore ipsum facto lore impsum facto</p>
CLICK ME
</div>
</div>
<div class="box b2">
<div class="picture"></div>
<div class="mask">
<h1>Text</h1>
<p>Lore ipsum facto lore impsum facto</p>
</div>
</div>
<div class="box b3">
<div class="picture"></div>
<div class="mask">
<h1>Text</h1>
<p>Lore ipsum facto lore impsum facto</p>
</div>
</div>
<div class="box b4">
<div class="picture"></div>
<div class="mask">
<h1>Text</h1>
<p>Lore ipsum facto lore impsum facto</p>
</div>
</div>
<div class="box b5">
<div class="picture"></div>
<div class="mask">
<h1>Text</h1>
<p>Lore ipsum facto lore impsum facto</p>
</div>
</div>
<div class="box b6">
<div class="picture"></div>
<div class="mask">
<h1>Text</h1>
<p>Lore ipsum facto lore impsum facto</p>
</div>
</div>
</span>
</div>
</div>
</div>
<div id="ov" class="overlay">
<div class="overlay_open">
</div>
</div>
</div>
<!-- Third Page #a3 -->
<div id="i3" class="page">
</div>
</div>
</div>
</div>
</div>
</body>
</html>
This simplified version works exactly like i want, and the transition is more fluid too.
body, .container { margin: 0; padding: 0;}
a {position: absolute}
.container .overlay {
position: fixed;
margin: 0;
padding: 0;
height: 100%;
width: 100%;
visibility: hidden;
opacity: 0;
-webkit-transform: scale(0.9);
transform: scale(0.9);
-webkit-transition: -webkit-transform 0.2s, opacity 0.2s, visibility 0s 0.2s;
transition: transform 0.2s, opacity 0.2s, visibility 0s 0.2s;
background-color: chocolate;
z-index: 2;
}
#c:target .overlay {
visibility: visible;
opacity: 0.8;
-webkit-transform: scale(1);
transform: scale(1);
-webkit-transition: -webkit-transform 0.4s, opacity 0.4s;
transition: transform 0.4s, opacity 0.4s;
}
<body>
<div id="c" class="container">
OPEN
<div class="overlay">
</div>
</div>
</body>

Related

Side By Side Photos - Setting Them So That They Are Responsive

I have two photos on a page that I've set so that they're lined up against one another. In order to make this web page easier to navigate through on a smartphone, I'd like to have the two photos line up one on top of another when the screen size shrinks.
If anyone knows how to make photos responsive so that they're lined up one on top of another and easier to view on small-screen devices, as well as to help space the images, I'd appreciate your advice.
![How I'd like my page to look on smaller devices][1]
My (revised) code is as follows:
<!DOCTYPE html>
<html lang="en; jp;">
<body style="background-color: white;">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<div class="page-wrap">
<div class="cp_cont">
<input id="cp_toggle03" type="checkbox"/>
<div class="cp_mobilebar">
<label for="cp_toggle03" class="cp_menuicon">
<span></span>
</label>
</div>
<label id="h-menu_black" class="cp_toggle03" for="cp_menuicon"></label>
<div id="body" class="noscroll"></div>
<header class="cp_offcm03">
<nav>
<ul style="text-align: center; margin-left: 210px; overflow: hidden;">
<li style="border-bottom: .05px solid lightgray;">ホーム</li>
<li style="border-bottom: .05px solid lightgray;">ブログ</li>
<li style="border-bottom: .05px solid lightgray;">小泉ついて</li>
<li style="border-bottom: .05px solid lightgray;">参考文献</li>
<div class="searchbar">
<form id="frmSearch" class="search2" method="get" action="default.html" style=" padding-right: 20px; padding-top: 20px; text-align: right; position: inline;"/>
<input class="search2" id="txtSearch" type="text" name="serach_bar" size="31" maxlength="255" value="" style="center: 396px; top: 185px; width: 180px; height: 26px;"/>
<input class="search1" type="submit" name="submition" value="検索" style=" padding-
bottom:20px; left: 0px; top: 153px; height: 25px; width: 32px;"/>
<input class="search2" type="hidden" name="sitesearch" value="default.html"/>
<script type="text/javascript">
document.getElementById('frmSearch').onsubmit = function() {
window.location = 'http://www.google.com/search?q=site:yoursitename.com ' + document.getElementById('txtSearch').value;
return false;
}
document.getElementById('cp_toggle03').onchange = function() {
if (document.getElementById('cp_toggle03').checked) {
document.body.style.overflow = "hidden";
} else {
document.body.style.overflow = "";
}
}
</script>
</div>
</ul>
</nav>
</header>
<div class="setsumei">
</div>
<br><div class="image" style="margin: 10px; text-align: center;">
<div class="responsive-image-container">
<img src="photos/Home_Page/fuji.JPG" alt="Fuji" width="40%"> <img src="photos/Home_Page/Kongoji_homepage.jpg" alt="Kongoji" width="40%">
</div>
<br><br><footer class="site-footer" style="font-size: 12px;">小泉© 2020年 | English</footer>
</div>
<style>
.searchbar{float: right;}
#media only screen and (max-width: 1050px){
.responsive-image-container{
display: flex;
flex-direction: column;
}
}
.setsumei{margin-left: 20px;
margin-right: 20px;}
.footer{width: 100%;
height: 40px;
text-align: center;
border-top: 1px solid black;
position: absolute;
bottom: 0;
padding: 10px;}
.page-wrap {
min-height: 100%;
/* equal to footer height */
margin-bottom: -40px;
}
.page-wrap:after {
content: "";
display: block;
}
.site-footer, .page-wrap:after {
/* .push must be the same height as footer */
height: 40px;
}
.site-footer {
text-align: center;
border-top: 1px solid black;
padding: 10px;
}
*, *:before, *:after {
padding-left: 0;
margin: 0;
box-sizing: border-box;
}
ol, ul {
list-style: none;
}
a {
text-decoration: none;
color: black;
}
.cp_cont {
height: auto;
}
/* menu */
.cp_offcm03 {
position: relative;
z-index: 5000;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: auto;
width: 100%;
height: auto;
padding-top: 0;
-webkit-transition: transform 0.3s ease-in;
transition: transform 0.3s ease-in;
text-align: center;
color: black;
background-color: white;
}
.cp_offcm03 nav,
.cp_offcm03 ul {
height: 100%;
}
.cp_offcm03 li {
display: inline-block;
margin-right: -6px;
}
.cp_offcm03 a {
display: block;
padding: 15px 45px;
margin-bottom: -5px;
-webkit-transition: background-color .3s ease-in;
transition: background-color .3s ease-in;
}
.cp_offcm03 a:hover {
background-color: lightgray;
}
/* menu toggle */
#cp_toggle03 {
display: none;
}
#cp_toggle03:checked ~ .cp_offcm03 {
-webkit-transform: translateX(0);
transform: translateX(0);
}
#cp_toggle03:checked ~ .cp_container {
-webkit-transform: translateX(0);
transform: translateX(0);
}
.cp_mobilebar {
display: none;
}
/* content */
.cp_container {
position: relative;
top: 0;
padding: 35px auto;
-webkit-transition: transform .3s ease-in;
transition: transform .3s ease-in;
}
.cp_content {
margin: 0 auto;
padding: 20px;
height: 65vh;
text-align: center;
}
#media (max-width: 1050px) and (min-width: 480px) {
/* menu */
.cp_offcm03 {
position: fixed;
left: -250px;
overflow-y: hidden;
width: 250px;
height: 100%;
padding-top: 40px;
color: black;
background-color: white;
z-index: 1000;
}
.cp_offcm03 nav {
background: white;
border-right: 0.5px solid lightgray;
margin-left: -210px;
}
.cp_offcm03 li {
display: block;
margin-right: 0;}
.cp_offcm03 a {
padding: 20px;
}
/* menu toggle */
.cp_mobilebar {
display: block;
z-index: 2000;
position: relative;
top: 0;
left: 0;
padding: 0 25px;
width: 100%;
height: 40px;
background-color: white;
border-bottom: .05px solid lightgray;
}
.cp_menuicon {
display: block;
position: relative;
width: 25px;
height: 100%;
cursor: pointer;
-webkit-transition: transform .3s ease-in;
transition: transform .3s ease-in;
}
.cp_menuicon > span {
display: block;
position: absolute;
top: 55%;
margin-top: -0.3em;
width: 100%;
height: 0.2em;
border-radius: 1px;
background-color: black;
-webkit-transition: transform .3s ease;
transition: transform .3s ease;
}
.cp_menuicon > span:before,
.cp_menuicon > span:after {
content: "";
position: absolute;
width: 100%;
height: 100%;
border-radius: 1px;
background-color: black;
-webkit-transition: transform .3s ease-in;
transition: transform .3s ease-in;
}
.cp_menuicon > span:before {
-webkit-transform: translateY(-0.6em);
transform: translateY(-0.6em);
}
.cp_menuicon > span:after {
-webkit-transform: translateY(0.6em);
transform: translateY(0.6em);
}
#cp_toggle03:checked + .cp_mobilebar .cp_menuicon {
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
#cp_toggle03:checked + .cp_mobilebar span:before,
#cp_toggle03:checked + .cp_mobilebar span:after {
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
}
#cp_toggle03:checked ~ .cp_offcm03 {
-webkit-transform: translateX(100%);
transform: translateX(100%);
}
#cp_toggle03:checked ~ .cp_container {
-webkit-transform: translateX(250px);
transform: translateX(250px);
}
input:checked ~ #h-menu_black {
display: block;/*カバーを表示*/
opacity: .6;
}
#h-menu_black {
display: none;
position: fixed;
z-index: 999;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: black;
opacity: 0;
transition: .7s ease-in-out;
}
/* content */
.cp_container {
top: 60px;
height: 92vh;
text-align: center;
}
.noscroll{
overflow: hidden;
position: fixed;
}
</style>
</body>
</html>
[1]: https://i.stack.imgur.com/HkD6k.jpg
Images are an inline elements. It depends on how you want your layout to work, but you may not need to do anything, it may be as simple as using the proper image size and setting a max-size.
A very simple implementation of what you need:
.responsive-image-container {
text-align: center;
}
.responsive-image-container>img {
max-width: 100%;
margin: 8px;
}
<div class="responsive-image-container">
<img src="https://placeimg.com/300/200/any" alt="some image" />
<img src="https://placeimg.com/300/200/any" alt="some image" />
</div>
A simple way to have more control, for example to have the images fill the containing parent, can be achieved using flex.
.responsive-image-container {
display: flex;
flex-direction: column;
align-items: stretch;
}
#media only screen and (min-width: 960px) {
.responsive-image-container {
display: flex;
flex-direction: row;
justify-content: space-evenly;
}
}
<div class="responsive-image-container">
<img src="https://placeimg.com/300/200/any" alt="some image" />
<img src="https://placeimg.com/300/200/any" alt="some image" />
</div>

how can I place show the circle div on top slider div?

The problem is the circle div is not appearing. I need to show the circle div on top of everything but I can't. How can I show the circle div?
.home {
height: 100vh;
overflow: hidden;
position: relative;
}
.home .slide {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-size: cover;
background-position: center;
z-index: 1;
display: none;
padding: 0 15px;
animation: slide 2s ease;
}
.home .slide.active {
display: flex;
}
#keyframes slide {
0% {
transform: scale(1);
/*1.1*/
}
100% {
transform: scale(1);
}
}
.containers {
max-width: 1170px;
margin: auto;
}
.home .containers {
flex-grow: 1;
}
.home .caption {
width: 50%;
}
.home .caption h1 {
font-size: 42px;
color: #000000;
margin: 0;
}
.home .slide.active .caption h1 {
opacity: 0;
animation: captionText .5s ease forwards;
animation-delay: 1s;
}
.home .caption p {
font-size: 18px;
margin: 15px 0 30px;
color: #222222;
}
.home .slide.active .caption p {
opacity: 0;
animation: captionText .5s ease forwards;
animation-delay: 1.2s;
}
.home .caption a {
display: inline-block;
padding: 10px 30px;
background-color: #000000;
text-decoration: none;
color: #ffffff;
}
.home .slide.active .caption a {
opacity: 0;
animation: captionText .5s ease forwards;
animation-delay: 1.4s;
}
#keyframes captionText {
0% {
opacity: 0;
transform: translateX(-100px);
}
100% {
opacity: 1;
transform: translateX(0px);
}
}
.home .controls .prev,
.home .controls .next {
position: absolute;
z-index: 2;
top: 50%;
height: 40px;
width: 40px;
margin-top: -20px;
color: #ffffff;
background-color: #FF5722;
text-align: center;
line-height: 40px;
font-size: 20px;
cursor: pointer;
transition: all .5s ease;
}
.home .controls .prev:hover,
.home .controls .next:hover {
background-color: #000000;
}
.home .controls .prev {
left: 0;
}
.home .controls .next {
right: 0;
}
.home .indicator {
position: absolute;
left: 50%;
bottom: 30px;
z-index: 2;
transform: translateX(-50%);
}
.home .indicator div {
display: inline-block;
width: 25px;
height: 25px;
color: #ffffff;
background-color: #FF5722;
border-radius: 50%;
text-align: center;
line-height: 25px;
margin: 0 3px;
}
.home .indicator div.active {
background-color: #000;
}
<section class="home">
<div class="circle" style="height: 350px; width: 350px; border: 70px solid #E5E4F0; border-radius: 50%; margin-top: -100px; margin-left: -100px;position: relative;">
</div>
<div class="slider">
<div class="slide active" style="background-image: url('img/home.jpg')">
<div class="containers">
<div class="caption">
<h1>"Title One"</h1>
</div>
</div>
</div>
<div class="slide" style="background-image: url('img/home1.jpg')">
<div class="containers">
<div class="caption">
<h1>"Title Two"</h1>
</div>
</div>
</div>
<div class="slide" style="background-image: url('img/home2.jpg')">
<div class="containers">
<div class="caption">
<h1>"Title Three"</h1>
</div>
</div>
</div>
</div>
<!-- controls -->
<div class="controls">
<div class="prev">
<</div>
<div class="next">></div>
</div>
<!-- indicators -->
<div class="indicator">
</div>
</section>
The main reason this isn't working is because of z-index - your slides have a z-index of 1 so your circle needs to have a higher z-index to appear above the slide.
Also, as you want the circle to appear in a specific location at all times, you could consider using position:absolute - it gets a bad rap sometimes but that's just because it is often used inappropriately :) It is ideal for positioning an element precisely inside a parent container - that's what it was designed for!
These are the changes:
.circle {
height: 350px;
width: 350px;
border: 70px solid #E5E4F0;
border-radius: 50%;
/* make sure the z-index value is higher than
all other elements you want this element to appear over */
z-index:10;
/* set the position exactly where you want: */
position: absolute;
top: -100px; /* these can be % values if you want it more responsive */
left: -100px;
}
Working example: (FYI This shows the circle in the same place as in your example - if this is a responsive design I assume you have other code to adjust the circle position)
.circle {
height: 350px;
width: 350px;
border: 70px solid #E5E4F0;
border-radius: 50%;
/* make sure the z-index value is higher than
all other elements you want this element to appear over */
z-index:10;
/* set the position exactly where you want: */
position: absolute;
top: -100px;
left: -100px;
}
.home {
height: 100vh;
overflow: hidden;
position: relative;
}
.home .slide {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-size: cover;
background-position: center;
z-index: 1;
display: none;
padding: 0 15px;
animation: slide 2s ease;
}
.home .slide.active {
display: flex;
}
#keyframes slide {
0% {
transform: scale(1);
/*1.1*/
}
100% {
transform: scale(1);
}
}
.containers {
max-width: 1170px;
margin: auto;
}
.home .containers {
flex-grow: 1;
}
.home .caption {
width: 50%;
}
.home .caption h1 {
font-size: 42px;
color: #000000;
margin: 0;
}
.home .slide.active .caption h1 {
opacity: 0;
animation: captionText .5s ease forwards;
animation-delay: 1s;
}
.home .caption p {
font-size: 18px;
margin: 15px 0 30px;
color: #222222;
}
.home .slide.active .caption p {
opacity: 0;
animation: captionText .5s ease forwards;
animation-delay: 1.2s;
}
.home .caption a {
display: inline-block;
padding: 10px 30px;
background-color: #000000;
text-decoration: none;
color: #ffffff;
}
.home .slide.active .caption a {
opacity: 0;
animation: captionText .5s ease forwards;
animation-delay: 1.4s;
}
#keyframes captionText {
0% {
opacity: 0;
transform: translateX(-100px);
}
100% {
opacity: 1;
transform: translateX(0px);
}
}
.home .controls .prev,
.home .controls .next {
position: absolute;
z-index: 2;
top: 50%;
height: 40px;
width: 40px;
margin-top: -20px;
color: #ffffff;
background-color: #FF5722;
text-align: center;
line-height: 40px;
font-size: 20px;
cursor: pointer;
transition: all .5s ease;
}
.home .controls .prev:hover,
.home .controls .next:hover {
background-color: #000000;
}
.home .controls .prev {
left: 0;
}
.home .controls .next {
right: 0;
}
.home .indicator {
position: absolute;
left: 50%;
bottom: 30px;
z-index: 2;
transform: translateX(-50%);
}
.home .indicator div {
display: inline-block;
width: 25px;
height: 25px;
color: #ffffff;
background-color: #FF5722;
border-radius: 50%;
text-align: center;
line-height: 25px;
margin: 0 3px;
}
.home .indicator div.active {
background-color: #000;
}
<section class="home">
<div class="circle">
</div>
<div class="slider">
<div class="slide active" style="background-image: url('http://lorempixel.com/1000/350/animals/4')">
<div class="containers">
<div class="caption">
<h1>"Title One"</h1>
</div>
</div>
</div>
<div class="slide" style="background-image: url('http://lorempixel.com/1000/350/animals/3')">
<div class="containers">
<div class="caption">
<h1>"Title Two"</h1>
</div>
</div>
</div>
<div class="slide" style="background-image: url('http://lorempixel.com/1000/350/animals/2')">
<div class="containers">
<div class="caption">
<h1>"Title Three"</h1>
</div>
</div>
</div>
</div>
<!-- controls -->
<div class="controls">
<div class="prev">
<</div>
<div class="next">></div>
</div>
<!-- indicators -->
<div class="indicator">
</div>
</section>

responsive bootstrap gave me undefined gradient

I try to make responsive part of this size with bootstrap grid. And always when I do resize of window, so there is made new gradient on right. I tried to find it in developer tools what it is, but there is nothing defined. I'm not sure but I have on more site with same design without bootstrap and there it looks nice when I resize window, but here with bootstrap it's bad. I am not sure if it's really bootstrap but looking for solution, because I really don't have idea.
Here is code and screen how it looks
#import url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.css);
#import url("https://fonts.googleapis.com/css?family=Titan+One");
body {
background: linear-gradient(45deg, #7b00e0, #ff006a);
margin: 0;
height: auto;
box-sizing: border-box;
}
.container {
width: 100%;
height: 100vh;
margin: 0 auto;
overflow: hidden;
}
.menu-container {
background-color: #E59617;
border-radius: 100%;
color: white;
cursor: pointer;
position: absolute;
width: 250px;
height: 250px;
left: -120px;
top: -120px;
transition: all 0.3s;
}
.menu-container.full-menu {
border-radius: 0;
padding: 0 !important;
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
transition: all 0.3s;
}
.full-menu .menu {
top: 40px;
left: 40px;
}
.menu {
color: white;
font-size: 2em;
position: absolute;
top: 160px;
left: 160px;
z-index: 100;
transition: all 0.3s;
}
.menu i {
opacity: 0.7;
transform: scale(1);
transition: all 0.3s;
}
.menu i:hover {
opacity: 1;
transform: scale(1.2);
transition: all 0.3s;
}
.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 0%;
opacity: 0;
visibility: hidden;
overflow: hidden;
}
.overlay.open {
opacity: .9;
visibility: visible;
height: 100%;
}
.overlay.open li {
animation: fadeInRight .5s ease forwards;
animation-delay: .35s;
}
.overlay.open li:nth-of-type(2) {
animation-delay: .4s;
}
.overlay.open li:nth-of-type(3) {
animation-delay: .45s;
}
.overlay.open li:nth-of-type(4) {
animation-delay: .50s;
}
.overlay nav {
font-size: 3.2em;
font-family: "Titan One", san-serif;
position: relative;
height: 70%;
top: 50%;
transform: translateY(-50%);
font-weight: 400;
text-align: center;
}
.overlay ul {
list-style: none;
padding: 0;
margin: 0 auto;
display: inline-block;
position: relative;
height: 100%;
}
.overlay ul li {
display: block;
height: 25%;
height: calc(100% / 4);
min-height: 50px;
position: relative;
opacity: 0;
}
.overlay ul li a {
display: block;
position: relative;
color: #fff;
text-decoration: none;
overflow: hidden;
opacity: 0.7;
transform: scale(1);
transition: all 0.3s;
}
.overlay ul li a:hover, .overlay ul li a:focus, .overlay ul li a:active {
opacity: 1;
transform: scale(1.2);
transition: all 0.3s;
}
#keyframes fadeInRight {
0% {
opacity: 0;
left: 20%;
}
100% {
opacity: 1;
left: 0;
}
}
h1.deti {
font-size: 5em;
font-family: "Titan One", san-serif;
background-color: rgba(255, 0, 106, 0.4);
border-radius: 100%;
box-shadow: 0 0 2em 1em rgba(255, 0, 106, 0.4);
color: white;
margin: 30vh auto;
position: relative;
text-align: center;
text-shadow: 0 8px 0 rgba(123, 0, 224, 0.4);
transform: rotate(-12deg);
width: 800px;
height: auto;
z-index: -1;
}
h1 span {
color: #ffc901;
}
.blob {
animation: blobby 4s infinite;
}
.blob2 {
animation: blobby2 6s infinite;
}
#keyframes blobby {
0% {
transform: scale(1);
}
50% {
transform: scale(1.08);
}
100% {
transform: scale(1);
}
}
#keyframes blobby2 {
0% {
transform: scale(1);
}
50% {
transform: scale(1.18);
}
100% {
transform: scale(1);
}
}
svg {
position: absolute;
top: 0;
}
#svg-right {
display: block;
fill: #7b00e0;
opacity: 0.5;
right: 0;
width: 60%;
z-index: -10;
}
#svg-left {
fill: #ff006a;
margin: 0;
width: 60%;
z-index: -10;
}
#media all and (max-width: 980px) {
h1.deti {
font-size: 3em;
font-family: "Titan One", san-serif;
}
}
#media all and (max-width: 480px) {
h1.deti {
font-size: 2em;
font-family: "Titan One", san-serif;
}
.overlay li {
font-size: 0.5em;
}
}
/*komix*/
p {
color: #fff;
}
.row {
display: flex;
height: 200px;
background-color: #7b00e0;
z-index: -99999;
}
h1 span {
color: #ffc901;
}
h1.mobile {
visibility: hidden;
}
.mobile {
display: none;
}
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Kajberšikana</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
</head>
<body>
<div class="mobile"><p class="mobile">Zmizni z mobilu na PC.</p></div>
<div class="title-deti"><h1 class="deti"><span>Lorem</span><br />Ipsum</h1>
<div class="circle"></div>
</div>
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-4 col-lg-6"><p>Box 1</p></div>
<div class="col-sm-6 col-md-4 col-lg-6"><p>Box 2</p></div>
<div class="col-sm-6 col-md-4 col-lg-6"><p>Box 2</p></div>
<div class="col-sm-6 col-md-4 col-lg-6"><p>Box 2</p></div>
<div class="col-sm-6 col-md-4 col-lg-6"><p>Box 2</p></div>
<div class="col-sm-6 col-md-4 col-lg-6"><p>Box 2</p></div>
</div>
<div class="container">
<div class="menu-container" id="toggle">
</i>
</div>
</div>
<div class="overlay" id="overlay">
<nav class="overlay-menu">
<ul>
<li>Domov</li>
<li>Pre deti</li>
<li>Pre dospelých</li>
<li>Kontakt</li>
</ul>
</nav>
</div>
</div>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>
<script src="js/index.js"></script>
</body>
</html>
**
You have several mistakes in your snippet.
First off, you're supposed to load bootstrap(.min).js after jQuery. You also need popper.js for v4.x.
Secondly, you should never have a .container inside another .container.
Third, you want to keep your .menu-deti from oversizing <body>, using:
.title-deti {
max-width: 100vw;
overflow: hidden;
}
See it fixed:
#import url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.css);
#import url("https://fonts.googleapis.com/css?family=Titan+One");
body {
background: linear-gradient(45deg, #7b00e0, #ff006a);
margin: 0;
height: auto;
box-sizing: border-box;
}
.container {
width: 100%;
height: 100vh;
margin: 0 auto;
overflow: hidden;
}
.menu-container {
background-color: #E59617;
border-radius: 100%;
color: white;
cursor: pointer;
position: absolute;
width: 250px;
height: 250px;
left: -120px;
top: -120px;
transition: all 0.3s;
}
.menu-container.full-menu {
border-radius: 0;
padding: 0 !important;
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
transition: all 0.3s;
}
.full-menu .menu {
top: 40px;
left: 40px;
}
.menu {
color: white;
font-size: 2em;
position: absolute;
top: 160px;
left: 160px;
z-index: 100;
transition: all 0.3s;
}
.menu i {
opacity: 0.7;
transform: scale(1);
transition: all 0.3s;
}
.menu i:hover {
opacity: 1;
transform: scale(1.2);
transition: all 0.3s;
}
.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 0%;
opacity: 0;
visibility: hidden;
overflow: hidden;
}
.overlay.open {
opacity: .9;
visibility: visible;
height: 100%;
}
.overlay.open li {
animation: fadeInRight .5s ease forwards;
animation-delay: .35s;
}
.overlay.open li:nth-of-type(2) {
animation-delay: .4s;
}
.overlay.open li:nth-of-type(3) {
animation-delay: .45s;
}
.overlay.open li:nth-of-type(4) {
animation-delay: .50s;
}
.overlay nav {
font-size: 3.2em;
font-family: "Titan One", san-serif;
position: relative;
height: 70%;
top: 50%;
transform: translateY(-50%);
font-weight: 400;
text-align: center;
}
.overlay ul {
list-style: none;
padding: 0;
margin: 0 auto;
display: inline-block;
position: relative;
height: 100%;
}
.overlay ul li {
display: block;
height: 25%;
height: calc(100% / 4);
min-height: 50px;
position: relative;
opacity: 0;
}
.overlay ul li a {
display: block;
position: relative;
color: #fff;
text-decoration: none;
overflow: hidden;
opacity: 0.7;
transform: scale(1);
transition: all 0.3s;
}
.overlay ul li a:hover,
.overlay ul li a:focus,
.overlay ul li a:active {
opacity: 1;
transform: scale(1.2);
transition: all 0.3s;
}
#keyframes fadeInRight {
0% {
opacity: 0;
left: 20%;
}
100% {
opacity: 1;
left: 0;
}
}
h1.deti {
font-size: 5em;
font-family: "Titan One", san-serif;
background-color: rgba(255, 0, 106, 0.4);
border-radius: 100%;
box-shadow: 0 0 2em 1em rgba(255, 0, 106, 0.4);
color: white;
margin: 30vh auto;
position: relative;
text-align: center;
text-shadow: 0 8px 0 rgba(123, 0, 224, 0.4);
transform: rotate(-12deg);
width: 800px;
height: auto;
z-index: -1;
}
h1 span {
color: #ffc901;
}
.blob {
animation: blobby 4s infinite;
}
.blob2 {
animation: blobby2 6s infinite;
}
#keyframes blobby {
0% {
transform: scale(1);
}
50% {
transform: scale(1.08);
}
100% {
transform: scale(1);
}
}
#keyframes blobby2 {
0% {
transform: scale(1);
}
50% {
transform: scale(1.18);
}
100% {
transform: scale(1);
}
}
svg {
position: absolute;
top: 0;
}
#svg-right {
display: block;
fill: #7b00e0;
opacity: 0.5;
right: 0;
width: 60%;
z-index: -10;
}
#svg-left {
fill: #ff006a;
margin: 0;
width: 60%;
z-index: -10;
}
#media all and (max-width: 980px) {
h1.deti {
font-size: 3em;
font-family: "Titan One", san-serif;
}
}
#media all and (max-width: 480px) {
h1.deti {
font-size: 2em;
font-family: "Titan One", san-serif;
}
.overlay li {
font-size: 0.5em;
}
}
/*komix*/
p {
color: #fff;
}
.row {
display: flex;
height: 200px;
background-color: #7b00e0;
z-index: -99999;
}
h1 span {
color: #ffc901;
}
h1.mobile {
visibility: hidden;
}
.mobile {
display: none;
}
.title-deti {
max-width: 100vw;
overflow: hidden;
}
#media (max-width: 800px) {h1.deti{width: 100vw;}}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Kajberšikana</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
</head>
<body>
<div class="mobile">
<p class="mobile">Zmizni z mobilu na PC.</p>
</div>
<div class="title-deti">
<h1 class="deti"><span>Lorem</span><br />Ipsum</h1>
<div class="circle"></div>
</div>
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-4 col-lg-6">
<p>Box 1</p>
</div>
<div class="col-sm-6 col-md-4 col-lg-6">
<p>Box 2</p>
</div>
<div class="col-sm-6 col-md-4 col-lg-6">
<p>Box 2</p>
</div>
<div class="col-sm-6 col-md-4 col-lg-6">
<p>Box 2</p>
</div>
<div class="col-sm-6 col-md-4 col-lg-6">
<p>Box 2</p>
</div>
<div class="col-sm-6 col-md-4 col-lg-6">
<p>Box 2</p>
</div>
</div>
</div>
<div class="container">
<div class="menu-container" id="toggle">
<i class="fa fa-bars" aria-hidden="true"></i>
</div>
</div>
<div class="overlay" id="overlay">
<nav class="overlay-menu">
<ul>
<li>Domov</li>
<li>Pre deti</li>
<li>Pre dospelých</li>
<li>Kontakt</li>
</ul>
</nav>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
</body>
</html>

An img in a list item with text and animation to the text

Okey, I'm working on a project and run in to a smal problem. I have a list that have text with an underline animation but now I want to include an img in the list. So i want to hover both the img and the text and the animation will only aply to the text. I have tried with a p element but didnt really work.
This is what I have at the moment:
/*Not imortant*/
.wrapper {
background-color: white;
color: white;
height: 500px;
margin: auto;
margin-top: 50px;
max-width: 1024px;
padding: 20px;
text-shadow: 1px 1px 1px #333;
width: 65%;
}
.wrapper h2 {
font-size: 44px;
margin: 0;
}
.wrapper p {
font-size: 25px;
font-weight: 500;
}
/*Here the important stuff happens*/
.wrapper li {
text-align: center;
}
.wrapper a img {
width: 100%;
height: 100px;
}
.wrapper a p {
color: white;
display: inline-block;
font-size: 25px;
font-weight: 500;
position: relative;
margin: 0;
}
.wrapper a p:before {
content: "";
position: absolute;
width: 100%;
height: 2px;
bottom: 0;
left: 0;
background-color: white;
visibility: hidden;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
}
.wrapper a p:hover:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
.main {
background-color: rgba(51, 51, 51, 0.3);
}
<main class="wrapper main">
<div class="row--no-gutter">
<h2>Gnestarias</h2>
<p>Some text :)</p>
</div>
<div class="row--no-gutter">
<ul>
<li class="col col--1-of-5">
<a href="arena.html">
<p>Arena</p>
<img src="#" alt="bild">
</a>
</li>
<li class="col col--1-of-5">
<a href="athena.html">
<p>Athena</p>
</a>
</li>
<li class="col col--1-of-5">
<a href="eatmeat.html">
<p>Eatmeat</p>
</a>
</li>
<li class="col col--1-of-5">
<a href="georges.html">
<p>Georges</p>
</a>
</li>
<li class="col col--1-of-5">
<a href="vitavillan.html">
<p>Vitavillan</p>
</a>
</li>
</ul>
</div>
</main>
Note that there is an grid behind it also (toast grid to be spesific) :)
Can i do something with only css or do I have to fix it with Javascript?
I want to be able to hover both the img and the text and the animation should only apply on the text, nothing else, and the underline should stop when the text stops
Hope you can help :)
http://johhag98.github.io/Gnesta-Pizza/
Move the hover trigger to the wrapping anchor
.wrapper a:hover p:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
/*Not imortant*/
.wrapper {
background-color: white;
color: white;
height: 500px;
margin: auto;
margin-top: 50px;
max-width: 1024px;
padding: 20px;
text-shadow: 1px 1px 1px #333;
width: 65%;
}
.wrapper h2 {
font-size: 44px;
margin: 0;
}
.wrapper p {
font-size: 25px;
font-weight: 500;
}
/*Here the important stuff happens*/
.wrapper li {
text-align: center;
list-style: none;
}
.wrapper a {
display: block;
}
.wrapper a img {
max-width: 100%;
height: 100px;
}
.wrapper a p {
color: white;
display: inline-block;
font-size: 25px;
font-weight: 500;
position: relative;
margin: 0;
}
.wrapper a p:before {
content: "";
position: absolute;
width: 100%;
height: 2px;
bottom: 0;
left: 0;
background-color: white;
visibility: hidden;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
}
.wrapper a:hover p:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
.main {
background-color: rgba(51, 51, 51, 0.3);
}
<main class="wrapper main">
<div class="row--no-gutter">
<h2>Gnestarias</h2>
<p>Some text :)</p>
</div>
<div class="row--no-gutter">
<ul>
<li class="col col--1-of-5">
<a href="arena.html">
<p>Arena</p>
<img src="http://www.fillmurray.com/100/100" alt="bild">
</a>
</li>
</ul>
</div>
</main>
Why don't you trigger the animation on hovering on the parent anchor tag?
Like this:
.wrapper a:hover p:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
Demo here:
/*Not imortant*/
.wrapper {
background-color: white;
color: white;
height: 500px;
margin: auto;
margin-top: 50px;
max-width: 1024px;
padding: 20px;
text-shadow: 1px 1px 1px #333;
width: 65%;
}
.wrapper h2 {
font-size: 44px;
margin: 0;
}
.wrapper p {
font-size: 25px;
font-weight: 500;
}
/*Here the important stuff happens*/
.wrapper li {
text-align: center;
}
.wrapper a img {
width: 100%;
height: 100px;
}
.wrapper a p {
color: white;
display: inline-block;
font-size: 25px;
font-weight: 500;
position: relative;
margin: 0;
}
.wrapper a p:before {
content: "";
position: absolute;
width: 100%;
height: 2px;
bottom: 0;
left: 0;
background-color: white;
visibility: hidden;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
}
.wrapper a p:hover:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
.wrapper a:hover p:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
.main {
background-color: rgba(51, 51, 51, 0.3);
}
<main class="wrapper main">
<div class="row--no-gutter">
<h2>Gnestarias</h2>
<p>Some text :)</p>
</div>
<div class="row--no-gutter">
<ul>
<li class="col col--1-of-5">
<a href="arena.html">
<p>Arena</p>
<img src="#" alt="bild">
</a>
</li>
<li class="col col--1-of-5">
<a href="athena.html">
<p>Athena</p>
</a>
</li>
<li class="col col--1-of-5">
<a href="eatmeat.html">
<p>Eatmeat</p>
</a>
</li>
<li class="col col--1-of-5">
<a href="georges.html">
<p>Georges</p>
</a>
</li>
<li class="col col--1-of-5">
<a href="vitavillan.html">
<p>Vitavillan</p>
</a>
</li>
</ul>
</div>
</main>

Trying to get Nav menu and logo to align within the grid

I am working on a responsive Nav menu for a website. I changed the header image into an image slider however now on the index.html page the nav menu is no longer aligned to the websites grid.
In the 'about', 'services' and contact pages the menu is positioned perfectly.
In the index.html page I have css code to position the navbar and logo position:absolute; but the rest of navs on the other page are position relative.
I want all the nav menus on each page to align the same so there is no obvious difference when the user changes pages. It may not be obvious on small screens but when you compare the index and about pages on a mobile device it is obvious the nav is not in the correct grid.
Can someone point me in the right direction?
Here is a link to the live site
http://shaneogrady.me/navtest/
HTML
<!DOCTYPE html>
<html>
<head>
<title> HELLO </title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content=""><script> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
<script src="js/jquery-1.11.1.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,800,700,600' rel='stylesheet' type='text/css'>
<link href="css/animate.css" rel="stylesheet" type="text/css" media="all">
<script src="js/wow.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script>
new WOW().init();
</script>
<script type="text/javascript" src="js/move-top.js"></script>
<script type="text/javascript" src="js/easing.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".scroll").click(function(event) {
event.preventDefault();
$('html,body').animate({scrollTop:$(this.hash).offset().top},900);
});
});
</script>
</head>
<body>
<div id="home" class="banner a-banner">
<div class="container" style=" position: relative; z-index: 5; top: 0%; left: 5%;">
<div class="head-logo">
<img src="images/logo.png" alt="" />
</div>
<div class="top-nav">
<span class="menu"><img src="images/menu.png" alt=""></span>
<ul class="nav1">
<li class="hvr-sweep-to-bottom">Contact<i><img src="images/nav-but5.png" alt=""/></i></li>
<li class="hvr-sweep-to-bottom">Services<i><img src="images/nav-but3.png" alt=""/></i></li>
<li class="hvr-sweep-to-bottom">About<i><img src="images/nav-but2.png" alt=""/></i></li>
<li class="hvr-sweep-to-bottom active">Home<i><img src="images/nav-but1.png" alt=""/></i></li>
<div class="clearfix"></div>
</ul>
<script>
$( "span.menu" ).click(function() {
$( "ul.nav1" ).slideToggle( 300, function() {});
});
</script>
</div>
</div>
<div class="carousel fade-carousel slide" data-ride="carousel" data-interval="4000" id="bs-carousel">
<ol class="carousel-indicators">
<li data-target="#bs-carousel" data-slide-to="0" class="active"></li>
<li data-target="#bs-carousel" data-slide-to="1"></li>
<li data-target="#bs-carousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="item slides active">
<div class="slide-1">
<div class="overlay"></div>
</div>
<div class="hero">
<hgroup>
<h1>Batman</h1>
<h3>Batman</h3>
</hgroup>
<div class="see-button">
<a class="btn btn-primary btn-lg see-button hvr-shutter-out-horizontal" href="about.html" role="button">See More</a>
</div>
</div>
</div>
<div class="item slides">
<div class="slide-2">
<div class="overlay"></div>
</div>
<div class="hero">
<hgroup>
<h1>Superman</h1>
<h3>Superman</h3>
</hgroup>
<div class="see-button">
<a class="btn btn-primary btn-lg see-button hvr-shutter-out-horizontal" href="about.html" role="button">See More</a>
</div>
</div>
</div>
<div class="item slides">
<div class="slide-3">
<div class="overlay"></div>
</div>
<div class="hero">
<hgroup>
<h1>Spiderman</h1>
<h3>Spiderman</h3>
</hgroup>
<div class="see-button">
<a class="btn btn-primary btn-lg see-button hvr-shutter-out-horizontal" href="services.html" role="button">See More</a>
</div>
</div>
</div>
</div>
</body>
</html>
CSS
body{
background:#fff;
font-family: 'Open Sans', sans-serif;
}
body a {
transition: 0.5s all;
-webkit-transition: 0.5s all;
-o-transition: 0.5s all;
-moz-transition: 0.5s all;
-ms-transition: 0.5s all;
}
.banner{
background: url(../images/banner2.jpg) no-repeat 0px 0px #eeece9;
min-height: 855px;
background-size: cover;
position: relative;
}
.head-logo{
float: left;
}
.head-logo a {
display: block;
margin-top: 3.5em;
}
.top-nav{
float: right;
width: 70%;
}
.top-nav ul{
padding:0;
margin:0;
}
.top-nav ul li {
display: inline-block;
width: 20%;
margin-right: .4em;
display:block;
float: right;
line-height:38px;
margin:0;
padding:0;
position:relative;
}
.top-nav ul li.active{
background: #5abc5e;
}
.top-nav ul li a{
color: #FFF;
font-size: 18px;
margin-right: .4em;
float: left;
padding: 3em 0em 3em 1.4em;
text-align: center;
width: 79%;
}
.top-nav ul li a i{
display: block;
margin-top: 1em;
color: #FFF;
font-size: 11px;
font-style: italic;
}
.top-nav ul li a:hover{
text-decoration:none;
}
/********************************/
/* Fade Bs-carousel */
/********************************/
.fade-carousel {
position: relative;
height: 100vh;
}
.fade-carousel .carousel-inner .item {
height: 100vh;
}
.fade-carousel .carousel-indicators > li {
margin: 0 2px;
background-color: #f39c12;
border-color: #f39c12;
opacity: .7;
}
.fade-carousel .carousel-indicators > li.active {
width: 10px;
height: 10px;
opacity: 1;
}
/********************************/
/* Hero Headers */
/********************************/
.hero {
position: absolute;
top: 50%;
left: 50%;
z-index: 3;
color: #fff;
text-align: center;
text-transform: uppercase;
text-shadow: 1px 1px 0 rgba(0,0,0,.75);
-webkit-transform: translate3d(-50%,-50%,0);
-moz-transform: translate3d(-50%,-50%,0);
-ms-transform: translate3d(-50%,-50%,0);
-o-transform: translate3d(-50%,-50%,0);
transform: translate3d(-50%,-50%,0);
}
.hero h1 {
font-size: 6em;
font-weight: bold;
margin: 0;
padding: 0;
}
.fade-carousel .carousel-inner .item .hero {
opacity: 0;
-webkit-transition: 2s all ease-in-out .1s;
-moz-transition: 2s all ease-in-out .1s;
-ms-transition: 2s all ease-in-out .1s;
-o-transition: 2s all ease-in-out .1s;
transition: 2s all ease-in-out .1s;
}
.fade-carousel .carousel-inner .item.active .hero {
opacity: 1;
-webkit-transition: 2s all ease-in-out .1s;
-moz-transition: 2s all ease-in-out .1s;
-ms-transition: 2s all ease-in-out .1s;
-o-transition: 2s all ease-in-out .1s;
transition: 2s all ease-in-out .1s;
}
/********************************/
/* Overlay */
/********************************/
.overlay {
position: absolute;
width: 100%;
height: 100%;
z-index: 2;
background-color: #080d15;
opacity: .3;
}
/********************************/
/* Slides backgrounds */
/********************************/
.fade-carousel .slides .slide-1,
.fade-carousel .slides .slide-2,
.fade-carousel .slides .slide-3 {
height: 100vh;
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
}
.fade-carousel .slides .slide-1 {
background-image: url(../images/banner2.jpg);
}
.fade-carousel .slides .slide-2 {
background-image: url(../images/squad.jpg);
}
.fade-carousel .slides .slide-3 {
background-image: url(../images/roadside.jpg);
}
/********************************/
/* Media Queries */
/********************************/
#media screen and (min-width: 980px){
.hero { width: 980px; }
}
#media screen and (max-width: 640px){
.hero h1 { font-size: 4em; }
}
/* Sweep To Bottom */
.hvr-sweep-to-bottom {
display: inline-block;
vertical-align: middle;
-webkit-transform: translateZ(0);
-o-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
-o-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
-ms-osx-font-smoothing: grayscale;
-o-osx-font-smoothing: grayscale;
position: relative;
-webkit-transition-property: color;
-o-transition-property: color;
-moz-transition-property: color;
-ms-transition-property: color;
transition-property: color;
-webkit-transition-duration: 0.3s;
-o-transition-duration: 0.3s;
-moz-transition-duration: 0.3s;
-ms-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.hvr-sweep-to-bottom:before {
content: "";
position: absolute;
z-index: -1;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #5abc5e;
-webkit-transform: scaleY(0);
-o-transform: scaleY(0);
-moz-transform: scaleY(0);
-ms-transform: scaleY(0);
transform: scaleY(0);
-webkit-transform-origin: 50% 0;
-o-transform-origin: 50% 0;
-moz-transform-origin: 50% 0;
-ms-transform-origin: 50% 0;
transform-origin: 50% 0;
-webkit-transition-property: transform;
-o-transition-property: transform;
-moz-transition-property: transform;
-ms-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: 0.3s;
-o-transition-duration: 0.3s;
-moz-transition-duration: 0.3s;
-ms-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
-o-transition-timing-function: ease-out;
-moz-transition-timing-function: ease-out;
-ms-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-sweep-to-bottom:hover, .hvr-sweep-to-bottom:focus, .hvr-sweep-to-bottom:active {
color: white;
}
.hvr-sweep-to-bottom:hover:before, .hvr-sweep-to-bottom:focus:before, .hvr-sweep-to-bottom:active:before {
-webkit-transform: scaleY(1);
transform: scaleY(1);
}
.banner-bottom-grids{
margin: 5em 0;
}
.banner-bottom-left{
padding: 0;
padding-left: 0 !important;
padding-right: 0 !important;
margin: 0;
}
.banner-bottom-left h3{
color: #000;
font-size: 37px;
margin: 0;
line-height: 1.2em;
font-weight: 300;
}
.banner-bottom-left h5{
color: #969696;
font-size: 14px;
margin: 1em 0;
line-height: 1.8em;
}
.banner-bottom-left h5 span{
display:block;
}
.banner-bottom-left p{
color: #333333;
font-size: 14px;
margin: 0;
line-height: 1.8em;
font-weight: 600;
}
.banner-bottom-right img{
width:100%;
}
.see-button{
margin-top: 1em;
}
.see-button a{
font-size: 14px;
text-transform: uppercase;
text-decoration: none;
padding: 1em 4em;
outline: none;
background: #393939;
border: none !important;
border-radius:0;
}
.jumbotron.banner-bottom-left {
background: none;
}
/*------------------ Slider Part starts Here----------*/
#slider2,
#slider3 {
box-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
margin: 0 auto;
}
.rslides_tabs {
list-style: none;
padding: 0;
background: rgba(0,0,0,.25);
box-shadow: 0 0 1px rgba(255,255,255,.3), inset 0 0 5px rgba(0,0,0,1.0);
-moz-box-shadow: 0 0 1px rgba(255,255,255,.3), inset 0 0 5px rgba(0,0,0,1.0);
-webkit-box-shadow: 0 0 1px rgba(255,255,255,.3), inset 0 0 5px rgba(0,0,0,1.0);
font-size: 18px;
list-style: none;
margin: 0 auto 50px;
max-width: 540px;
padding: 10px 0;
text-align: center;
width: 100%;
}
.rslides_tabs li {
display: inline;
float: none;
margin-right: 1px;
}
.rslides_tabs a {
width: auto;
line-height: 20px;
padding: 9px 20px;
height: auto;
background: transparent;
display: inline;
}
.rslides_tabs li:first-child {
margin-left: 0;
}
.rslides_tabs .rslides_here a {
background: rgba(255,255,255,.1);
color: #fff;
font-weight: bold;
}
.events {
list-style: none;
}
.callbacks_container {
position: relative;
float: left;
width: 100%;
}
.callbacks {
position: relative;
list-style: none;
overflow: hidden;
width: 100%;
padding: 0;
margin: 0;
}
.callbacks li {
position: absolute;
width: 100%;
left: 0;
top: 0;
}
.callbacks img {
position: relative;
z-index: 1;
height: auto;
border: 0;
}
.callbacks .caption {
display: block;
position: absolute;
z-index: 2;
font-size: 20px;
text-shadow: none;
color: #fff;
left: 0;
right: 0;
padding: 10px 20px;
margin: 0;
max-width: none;
top: 10%;
text-align: center;
}
.callbacks_nav {
position: absolute;
-webkit-tap-highlight-color: rgba(0,0,0,0);
top: 52%;
left: 0;
opacity: 0.7;
z-index: 3;
text-indent: -9999px;
overflow: hidden;
text-decoration: none;
height: 61px;
width: 55px;
background: transparent url("../images/themes.png") no-repeat left top;
margin-top: -65px;
}
.callbacks_nav:active {
opacity: 1.0;
}
.callbacks_nav.next {
left: auto;
background-position: right top;
right: 0;
}
#slider3-pager a {
display: inline-block;
}
#slider3-pager span{
float: left;
}
#slider3-pager span{
width:100px;
height:15px;
background:#fff;
display:inline-block;
border-radius:30em;
opacity:0.6;
}
#slider3-pager .rslides_here a {
background: #FFF;
border-radius:30em;
opacity:1;
}
#slider3-pager a {
padding: 0;
}
#slider3-pager li{
display:inline-block;
}
.rslides {
position: relative;
list-style: none;
overflow: hidden;
width: 100%;
padding: 0;
margin: 0;
}
.rslides li {
-webkit-backface-visibility: hidden;
position: absolute;
display: none;
width: 100%;
left: 0;
top: 0;
}
.rslides li{
position: relative;
display: block;
float: left;
}
.rslides img {
height: auto;
border: 0;
width:100%;
}
.callbacks_tabs{
list-style: none;
position: absolute;
top: 78%;
z-index: 999;
left: 45%;
padding: 0;
margin: 0;
}
.slider-top{
text-align: center;
padding:10em 0;
}
.slider-top h1{
font-weight:700;
font-size:48px;
color:#010101;
}
.slider-top p{
font-weight:400;
font-size:20px;
padding:1em 7em;
color:#010101;
}
.slider-top ul.social-slide{
display:inline-flex;
margin: 0px;
padding: 0px;
}
You might want to try rebuilding your css from scratch instruction by instruction and see what is changing something. If a change doesn't apply, try adding !important at the end (like so :{ width : 30% !important;}), sometimes Bootstrap is a bit possessive.
Maybe throwing a position : absolute ; right :0; top:0; in the .top-nav and building from there would help do the trick.
An element with position: absolute is positioned relative to the
nearest positioned ancestor (instead of positioned relative to the
viewport, like fixed)
position: absolute allows an element to be positioned with respect
to a containing block using left, right, top or bottom (the containing
block is the nearest ancestor node with a position of relative,
absolute or fixed).
To fix it just add left: 0 and right: 0 to .container this will make the div stretch to document width.
Here a minimal snippet example to illustrate (without using left, right):
div.relative {
position: relative;
height: 200px;
border: 3px solid #8AC007;
}
div.absolute {
position: absolute;
height: 100px;
border: 3px solid blue;
display: block;
}
<div class="relative">This
<div>element has position: relative;
<div class="absolute">This
<div>element has position: absolute;</div>
</div>
Now with left: 0, right: 0
div.relative {
position: relative;
height: 200px;
border: 3px solid #8AC007;
}
div.absolute {
position: absolute;
height: 100px;
border: 3px solid blue;
display: block;
left: 0;
right: 0;
}
<div class="relative">This
<div>element has position: relative;
<div class="absolute">This
<div>element has position: absolute;</div>
</div>
Check this out to full information