Alignment issues in children of looped words animation - html

I used to do my best to solve the problem, however, it doesn't work. As you can see, if you run the code the animation is not inline or they are not in proper position, what I want to - the animation should be in between or centered in the Let's Make and Awesome elements. Looking forward and answer and if you mind can you please explain to make so that i will understand it fully. Thank You so much
.circle {
position: relative;
border-radius: 50%;
width: 30rem;
height: 30rem;
background-color: #6CA9A5;
margin: 5rem auto;
}
.hello, .hello2 {
position: relative;
text-transform: uppercase;
font-family: "Montserrat", sans-serif;
font-weight: 900;
letter-spacing: .2rem;
font-size: 1.5rem;
color: #fff;
text-align: center;
padding: 70px 0 2px 0;
/* z-index: 1; */
}
.hello2 {
position:absolute;
top: 58px; /* changeable */
left:50%;
transform:translateX(-50%);
}
.hello span:hover {
color: #f4511e;
transition: .59s;
}
.circle a {
position: absolute;
top:60%; /* changeable */
left:50%;
transform:translateX(-50%);
font-size: 15px;
text-decoration: none;
background: #fff;
padding: 15px 35px;
border-radius: 35px;
text-transform: uppercase;
}
/* .more a {
height: 150px;
width: 500px;
background-color: #fff;
} */
#container {
color:#999;
text-transform: uppercase;
font-family: "Montserrat", sans-serif;
font-size: 1.5rem;
font-weight: bold;
padding-top: 200px;
position: relative;
width:100%;
bottom: 45%;
display:block;
text-align: center;
}
#flip {
height: 80px;
overflow:hidden;
}
#flip > div > div {
border-radius: 30px;
color:#fff;
padding:4px 15px 4px 15px;
height:30px;
margin-bottom: 62px;
display:inline-block;
}
#flip > div > .ever {
/* height: 59px; */
}
#flip div:first-child {
animation: show 5s linear infinite;
}
#flip div div {
background:#42c58a;
}
#flip div:first-child div {
background:#4ec7f3;
}
#flip div:last-child div {
background:#DC143C;
}
#keyframes show {
0% {margin-top:-270px;}
5% {margin-top:-180px;}
33% {margin-top:-180px;}
38% {margin-top:-90px;}
66% {margin-top:-90px;}
71% {margin-top:0px;}
99.99% {margin-top:0px;}
100% {margin-top:-270px;}
}
<div class="content">
<h1 class="possible">Everything is Possible</h1>
<div class="circle">
<p class="hello">Let's Make </p>
<div id="container">
<div id="flip">
<div><div>wOrK</div></div>
<div><div>lifeStyle</div></div>
<div><div class="ever">Everything</div></div>
</div>
</div>
<p class="hello2">Awesome</p>
Read More
</div>
</div>

Related

Speech bubble with rotation when mouse goes over it

I'm in the process of playing with css a bit. Unfortunately, it doesn't look quite the way I'd like it to yet. The speech bubble should be smaller and directly above them. The other reason is the rotation when the mouse pointer goes over the speech bubble the complete speech bubble should rotate. Unfortunately, when you rotate it, everything else looks like a speech bubble....
How do I make the bubble smaller and put it over them and how do I make the rotation look better.
HTML
#import url('https://fonts.googleapis.com/css?family=Montserrat:400,800');
body {
padding: 50px;
font-family: 'Montserrat', sans-serif;
}
.spinner-text {
color: #fff;
}
.spinning {
color: #fff;
}
.spinning:hover {
width: 100px;
height: 100px;
color: #fff;
background-color: #5869FF;
animation-name: spin;
animation-duration: 5000ms;
animation-iteration-count: infinite;
animation-timing-function: linear;
/* transform: rotate(3deg); */
/* transform: rotate(0.3rad);/ */
/* transform: rotate(3grad); */
/* transform: rotate(.03turn); */
}
#keyframes spin {
from {
transform:rotate(0deg);
}
to {
transform:rotate(360deg);
}
}
.bubble {
position: relative;
font-family: sans-serif;
font-size: 18px;
line-height: 24px;
width: 300px;
color: #fff;
background: #5869FF;
border-radius: 40px;
padding: 24px;
text-align: center;
color: #000;
}
.bubble-bottom-left:before {
content: "";
width: 0px;
height: 0px;
position: absolute;
border-left: 24px solid #5869FF;
border-right: 12px solid transparent;
border-top: 12px solid #5869FF;
border-bottom: 20px solid transparent;
left: 32px;
bottom: -24px;
}
.blue {
color: #5869FF;
}
.black {
color: #3B3B3B;
}
.text {
text-align: center;
display: flex;
margin-top: 35px;
}
<div>
<div class="spinning">
<div class="bubble bubble-bottom-left" contenteditable>
<div class="spinner-text">
:)
</div>
</div>
</div>
<div class="text">
<div class="blue">this</div>
<div class="black">is</div>
<div class="blue">name</div>
</div>
</div>
What I have
What I want
Try this, Instead of animation on .spinning div and animation on .spinner-text only
#import url('https://fonts.googleapis.com/css?family=Montserrat:400,800');
body {
padding: 50px;
font-family: 'Montserrat', sans-serif;
}
.spinner-text {
color: #fff;
}
.spinning {
margin-left: 30px;
}
.spinning:hover .bubble .spinner-text {
background-color: #5869FF;
animation-name: spin;
animation-duration: 5000ms;
animation-iteration-count: infinite;
animation-timing-function: linear;
/* transform: rotate(3deg); */
/* transform: rotate(0.3rad);/ */
/* transform: rotate(3grad); */
/* transform: rotate(.03turn); */
}
#keyframes spin {
from {
transform:rotate(0deg);
}
to {
transform:rotate(360deg);
}
}
.bubble {
position: relative;
font-family: sans-serif;
font-size: 30px;
line-height: 28px;
width: 52px;
height: 52px;
color: #fff;
padding: 0;
text-align: center;
color: #000;
}
.bubble-bottom-left:before {
content: "";
width: 0px;
height: 0px;
position: absolute;
border-left: 14px solid #5869FF;
border-right: 12px solid transparent;
border-top: 12px solid #5869FF;
border-bottom: 20px solid transparent;
left: 15px;
bottom: -20px;
}
.bubble .spinner-text {
background: #5869FF;
border-radius: 40px;
padding: 12px;
border-radius: 40px;
}
.blue {
color: #5869FF;
}
.black {
color: #3B3B3B;
}
.text {
text-align: center;
display: flex;
margin-top: 20px;
font-weight: bold;
font-size: 20px;
}
<div>
<div class="spinning">
<div class="bubble bubble-bottom-left" contenteditable>
<div class="spinner-text">
:)
</div>
</div>
</div>
<div class="text">
<div class="blue">this</div>
<div class="black">is</div>
<div class="blue">name</div>
</div>
</div>
Here you have the solution which is coresponding with the screenshot of your requirements. I have modified Minals code to get a faster solution because he did really good job with fixing the rotate issue.
#import url('https://fonts.googleapis.com/css?family=Montserrat:400,800');
body {
padding: 50px;
font-family: 'Montserrat', sans-serif;
}
.spinner-text {
color: #fff;
font-size:20px;
font-weight:700;
width:40px;
}
.spinning {
margin-left: 115px;
}
.spinning:hover .bubble .spinner-text {
animation-name: spin;
animation-duration: 5000ms;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
.bubble .spinner-text {
background: transparent!important;
border-radius: 40px;
padding: 10px;
border-radius: 40px;
position:absolute;
left:-10px;
bottom:2px;
}
#keyframes spin {
from {
transform:rotate(0deg);
}
to {
transform:rotate(360deg);
}
}
.bubble {
position: relative;
font-family: sans-serif;
font-size: 18px;
line-height: 24px;
width: 0px;
height:0px;
background: #5869FF;
border-radius: 40px;
padding: 21px;
text-align: center;
color: #000;
top:14px;
}
.bubble-bottom-left:before {
content: "";
width: 10px;
height: 15px;
position: absolute;
background-color: #5869ff;
left: 5px;
bottom: -8px;
border-radius: 0px 0px 100px 0px;
transform: translate(0, -5px);
}
.blue {
color: #5869FF;
font-size:25px;
font-weight:600;
}
.black {
color: #3B3B3B;
font-size:25px;
font-weight:600;
}
.text {
text-align: center;
display: flex;
margin-top: 20px;
font-weight: bold;
font-size: 20px;
}
<div>
<div class="spinning">
<div class="bubble bubble-bottom-left" contenteditable>
<div class="spinner-text">
:)
</div>
</div>
</div>
<div class="text">
<div class="blue">this</div>
<div class="black">is</div>
<div class="blue">name</div>
</div>
</div>
You need to set a transform origin by transform-origin: 0% 0% to rotate element in center or what point you want to transform.
See JSFiddle Sample
body {
padding: 50px;
font-family: "Montserrat", sans-serif;
}
.spinner-text {
color: #fff;
}
.spinning {
color: #fff;
position: absolute;
bottom: 28px;
left: 80px;
width: 40px;
height: 40px;
}
.spinning:hover {
cursor: default;
color: #fff;
animation-name: spin;
animation-duration: 5000ms;
animation-iteration-count: infinite;
animation-timing-function: linear;
transform-origin: 50% 50%;
}
#keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
#speechBubble {
display: block;
position: relative;
}
.bubble {
position: absolute;
font-family: sans-serif;
font-size: 18px;
line-height: 20px;
width: 20px;
height: 20px;
color: #fff;
background: #5869ff;
border-radius: 50%;
padding: 10px;
text-align: center;
}
.bubble-bottom-left:before {
content: "";
width: 6px;
height: 18px;
position: absolute;
background-color: #5869ff;
transform: rotate(35deg);
left: 15px;
bottom: -8px;
border-radius: 0px 0px 40px 0px;
}
.blue {
color: #5869ff;
}
.black {
color: #3b3b3b;
}
.text {
text-align: center;
display: flex;
margin-top: 35px;
font-weight: 600;
font-size: 20px;
}
/* EOS */
<div id="speechBubble">
<div class="spinning">
<div class="bubble bubble-bottom-left" contenteditable>
<div class="spinner-text">
:)
</div>
</div>
</div>
<div class="text">
<div class="blue">this</div>
<div class="black">is</div>
<div class="blue">name</div>
</div>
</div>

How to create content just below an absolute background image

I created some background images in a div with slideshow and some content displaying on that, and now I'm trying to add a section right below my background image but anything I add after my background div in my html, locates behind my background image and top of my window as if I've had created no content in my webpage before this section except a navbar with sticky position. I put my codes here for better perception.
I'm trying to create content just after my background image as different, separated parts of my webpage, does anyone have an idea?
P.S: My main focus is running this web on full screen windows so please excuse my cluttered code result in non-full-screen windows.
*,
*::before,
*::after{
padding: 0;
margin: 0;
box-sizing: border-box;
}
body{
background-color: aqua;
}
header{
z-index: 999999999;
overflow: hidden;
position: sticky;
top: -31px;
}
header .header_main{
background-color: rgba(255,255,255,0.98);
}
header div.header_meta{
font-family: 'Open Sans', sans-serif;
font-weight: bold;
font-size: 11px;
border-bottom: 1px solid rgba(224, 224, 224, 0.56);
}
header div.container{
line-height: 30px;
width: 90%;
margin: auto;
padding: 0 50px;
}
header div.container nav ul{
line-height: 30px;
margin: 0 auto;
float: right;
}
header div.container nav ul li{
float: right;
list-style: none;
}
header div.container nav ul li a{
text-decoration: none;
float: right;
padding: 0 10px;
color: #ffffff;
}
header div.container nav ul li a:hover{
text-decoration: underline;
color: #E6E6E6;
}
header .header_meta .header_contact{
margin: auto;
line-height: 30px;
color: #ffffff;
}header .header_main{
box-shadow: 0 3px 4px -4px rgba(138, 138, 138, 0.65);
}
header .header_main .container_logo_nav{
width: 90%;
height: 60px;
line-height: 60px;
margin: 0 auto;
padding: 0 4%;
}
header .header_main .container_logo_nav img{
height: 100%;
width: 216px;
float: left;
}
header .header_main .container_logo_nav ul{
float: right;
padding-right: 1%;
}
header .header_main .container_logo_nav ul li{
float: right;
list-style: none;
}
header .header_main .container_logo_nav ul li a{
text-decoration: none;
font-family: 'Open Sans', sans-serif;
font-weight: bolder;
font-size: 14px;
color: #6E6E6E;
padding: 0 13px;
transition: 300ms;
}
header .header_main .container_logo_nav ul li a.search{
font-size: 11px;
}
header .header_main .container_logo_nav ul li a:hover{
color: #000000;
}
.container_slider{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 82vh;
animation: animate 35s ease-in-out infinite;
background-size: cover;
background: no-repeat center;
clear: both;
display: block;
}
.container_slider::before{
width: 100%;
height: 100%;
content:"";
background-color: rgba(22,22,22,0.2);
position: absolute;
top: 0;
}
#keyframes animate{
0%,100%{
background-image: url("Background_Image1");
}
20%{
background-image: url("Background_Image2");
}
40%{
background-image: url("Background_Image3");
}
60%{
background-image: url("Background_Image4");
}
80%{
background-image: url("Background_Image5");
}
}
.container_slider .outer{
width: 100%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50% , -50%);
text-align: center;
}
.container_slider .outer .details{
}
.container_slider .outer .details h1{
font-family: 'Finger Paint', cursive;
font-weight: lighter;
color: #ffffff;
font-size: 70px;
line-height: 77px;
padding: 15px 0;
animation: caption 600ms ease-in-out 1;
}
#keyframes caption {
0%{
transform: translate(0, -20px);
opacity: 0;
}
100%{
transform: translate(0, 0);
opacity: 1;
}
}
.container_slider .outer .details span{
font-family: 'Open Sans';
font-weight: 600;
font-size: 16px;
color: #ffffff;
display: block;
animation: ltlspan 600ms linear 1;
}
#keyframes ltlspan {
0%{
transform: translate(0, 20px);
opacity: 0;
}
100%{
transform: translate(0, 0);
opacity: 1;
}
}
.container_slider .outer .buttons{
width: 100%;
margin-top: 40px;
}
.container_slider .outer a{
background-color: #f8f8f8;
width: 152px;
height: 46px;
line-height: 23px;
border-radius: 100px;
padding: 10px 20px;
margin: 0 10px;
text-decoration: none;
font-family: 'Open Sans', sans-serif;
font-size: 12px;
font-weight: bold;
display: inline-block;
text-align: center;
transition: 300ms;
color: #666666;
animation: abuttons 1300ms ease-in 1;
}
#keyframes abuttons {
0%{
transform: translate(0, -20px);
opacity: 0;
}
100%{
transform: translate(0, 0);
opacity: 1;
}
}
.container_slider .outer a:first-child{
background-color: #109bc5;
color: #ffffff;
border-bottom: 1px solid #0079a3;
}
.container_slider .outer a:first-child:hover{
background-color: rgba(16, 156, 198, 0.9);
}
.container_slider .outer a:nth-child(2):hover{
background-color: rgba(255, 255, 255, 0.86);
color: black;
}
div.box{
width: 100px;
height: 100px;
background-color: blue;
/* I want this box to be displayed below my background image */
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght#300&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans+Condensed:wght#700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Finger+Paint&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght#600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header>
<div class="header_meta">
<div class="container">
<nav>
<ul>
<li> Registration </li>
<li> Customer Login </li>
</ul>
</nav>
<div class="header_contact"> <span>Call us now: 555-147-5643</span> </div>
</div>
</div>
<div class="header_main">
<div class="container_logo_nav">
<span class="logo"> <img src="images/logo-large.png" alt=""> </span>
<nav class="main_menu">
<ul>
<li><a class="search" href="#"><i class="fa fa-search"></i></a></li>
<li>News</li>
<li>Contact</li>
<li>About</li>
<li>Deals</li>
<li>Destinations</li>
<li>Welcome</li>
</ul>
</nav>
</div>
</div>
</header>
<div class="container_slider">
<div class="outer">
<div class="details">
<h1>To Travel is to live</h1>
<h2>
<span>Want to make a journey? We got the destinations!</span>
</h2>
</div>
<div class="buttons">
ALL DESTINATIONS
LATEST OFFERS
</div>
</div>
</div>
<div class="box"></div>
</body>
</html>
You have set your wrapper to position absolute together with inner. I have changed the .container_slider to relative to wrap properly your slider and box.
[screenshot of the result][1]
here is a screenshot: https://i.stack.imgur.com/8hTNT.jpg
*,
*::before,
*::after {
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
background-color: aqua;
}
header {
z-index: 999999999;
overflow: hidden;
position: sticky;
top: -31px;
}
header .header_main {
background-color: rgba(255, 255, 255, 0.98);
}
header div.header_meta {
font-family: 'Open Sans', sans-serif;
font-weight: bold;
font-size: 11px;
border-bottom: 1px solid rgba(224, 224, 224, 0.56);
}
header div.container {
line-height: 30px;
width: 90%;
margin: auto;
padding: 0 50px;
}
header div.container nav ul {
line-height: 30px;
margin: 0 auto;
float: right;
}
header div.container nav ul li {
float: right;
list-style: none;
}
header div.container nav ul li a {
text-decoration: none;
float: right;
padding: 0 10px;
color: #ffffff;
}
header div.container nav ul li a:hover {
text-decoration: underline;
color: #e6e6e6;
}
header .header_meta .header_contact {
margin: auto;
line-height: 30px;
color: #ffffff;
}
header .header_main {
box-shadow: 0 3px 4px -4px rgba(138, 138, 138, 0.65);
}
header .header_main .container_logo_nav {
width: 90%;
height: 60px;
line-height: 60px;
margin: 0 auto;
padding: 0 4%;
}
header .header_main .container_logo_nav img {
height: 100%;
width: 216px;
float: left;
}
header .header_main .container_logo_nav ul {
float: right;
padding-right: 1%;
}
header .header_main .container_logo_nav ul li {
float: right;
list-style: none;
}
header .header_main .container_logo_nav ul li a {
text-decoration: none;
font-family: 'Open Sans', sans-serif;
font-weight: bolder;
font-size: 14px;
color: #6e6e6e;
padding: 0 13px;
transition: 300ms;
}
header .header_main .container_logo_nav ul li a.search {
font-size: 11px;
}
header .header_main .container_logo_nav ul li a:hover {
color: #000000;
}
.container_slider {
position: relative; /*changed to relative*/
top: 0;
left: 0;
width: 100%;
height: 82vh;
animation: animate 35s ease-in-out infinite;
background-size: cover;
background: no-repeat center;
clear: both;
display: block;
}
.container_slider::before {
width: 100%;
height: 100%;
content: '';
background-color: rgba(22, 22, 22, 0.2);
position: absolute;
top: 0;
}
#keyframes animate {
0%,
100% {
background-image: url('https://www.pexels.com/photo/green-leaf-plant-808510/');
}
20% {
background-image: url('https://www.pexels.com/photo/green-leaf-plant-808510/');
}
40% {
background-image: url('https://www.pexels.com/photo/green-leaf-plant-808510/');
}
60% {
background-image: url('https://www.pexels.com/photo/green-leaf-plant-808510/');
}
80% {
background-image: url('https://www.pexels.com/photo/green-leaf-plant-808510/');
}
}
.container_slider .outer {
width: 100%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
.container_slider .outer .details {
}
.container_slider .outer .details h1 {
font-family: 'Finger Paint', cursive;
font-weight: lighter;
color: #ffffff;
font-size: 70px;
line-height: 77px;
padding: 15px 0;
animation: caption 600ms ease-in-out 1;
}
#keyframes caption {
0% {
transform: translate(0, -20px);
opacity: 0;
}
100% {
transform: translate(0, 0);
opacity: 1;
}
}
.container_slider .outer .details span {
font-family: 'Open Sans';
font-weight: 600;
font-size: 16px;
color: #ffffff;
display: block;
animation: ltlspan 600ms linear 1;
}
#keyframes ltlspan {
0% {
transform: translate(0, 20px);
opacity: 0;
}
100% {
transform: translate(0, 0);
opacity: 1;
}
}
.container_slider .outer .buttons {
width: 100%;
margin-top: 40px;
}
.container_slider .outer a {
background-color: #f8f8f8;
width: 152px;
height: 46px;
line-height: 23px;
border-radius: 100px;
padding: 10px 20px;
margin: 0 10px;
text-decoration: none;
font-family: 'Open Sans', sans-serif;
font-size: 12px;
font-weight: bold;
display: inline-block;
text-align: center;
transition: 300ms;
color: #666666;
animation: abuttons 1300ms ease-in 1;
}
#keyframes abuttons {
0% {
transform: translate(0, -20px);
opacity: 0;
}
100% {
transform: translate(0, 0);
opacity: 1;
}
}
.container_slider .outer a:first-child {
background-color: #109bc5;
color: #ffffff;
border-bottom: 1px solid #0079a3;
}
.container_slider .outer a:first-child:hover {
background-color: rgba(16, 156, 198, 0.9);
}
.container_slider .outer a:nth-child(2):hover {
background-color: rgba(255, 255, 255, 0.86);
color: black;
}
div.box {
width: 100px;
height: 100px;
background-color: blue;
/* I want this box to be displayed below my background image */
}

After Using CSS animation other element not showing on the page

Good day, guys, I tried to work on my code and I wasn't able to fix it on my own, the class .hello2 and .more are not showing on the page whereas it should appear below the id="flip" content, which happened it disappear the .hello2 and .more class element, it was my first time to use animation this time guys. here's the code that I been using. Looking forward
.possible {
color: #fff;
text-align: center;
letter-spacing: 10px;
text-transform: uppercase;
padding-top: 2rem;
font-family: "Coiny", sans-serif;
}
.circle {
position: relative;
border-radius: 50%;
width: 30rem;
height: 30rem;
background-color: #6CA9A5;
margin: 5rem auto;
}
.hello, .hello2 {
position: relative;
text-transform: uppercase;
font-family: "Montserrat", sans-serif;
font-weight: 900;
letter-spacing: .2rem;
font-size: 2.5rem;
color: #fff;
text-align: center;
padding-top: 100px;
/* z-index: 1; */
}
.hello span:hover {
color: #f4511e;
transition: .59s;
}
.circle a {
font-size: 15px;
text-decoration: none;
}
/* .more a {
height: 150px;
width: 500px;
background-color: #fff;
} */
#container {
color:#999;
text-transform: uppercase;
font-family: "Montserrat", sans-serif;
font-size:36px;
font-weight:bold;
padding-top:180px;
position: relative;
width:100%;
bottom:45%;
display:block;
text-align: center;
}
#flip {
height:60px;
overflow:hidden;
}
#flip > div > div {
border-radius: 30px;
color:#fff;
padding:4px 15px;
height:45px;
margin-bottom:45px;
display:inline-block;
}
#flip div:first-child {
animation: show 5s linear infinite;
}
#flip div div {
background:#42c58a;
}
#flip div:first-child div {
background:#4ec7f3;
}
#flip div:last-child div {
background:#DC143C;
}
#keyframes show {
0% {margin-top:-270px;}
5% {margin-top:-180px;}
33% {margin-top:-180px;}
38% {margin-top:-90px;}
66% {margin-top:-90px;}
71% {margin-top:0px;}
99.99% {margin-top:0px;}
100% {margin-top:-270px;}
}
<div class="content">
<h1 class="possible">Everything is Possible</h1>
<div class="circle">
<p class="hello">Let's Make </p>
<div id="container">
<div id="flip">
<div><div>wOrK</div></div>
<div><div>lifeStyle</div></div>
<div><div>Everything</div></div>
</div>
</div>
<p class="hello2">Awesome</p>
Read More
</div>
</div>
I added position:absolute to .hello2
.possible {
color: #fff;
text-align: center;
letter-spacing: 10px;
text-transform: uppercase;
padding-top: 2rem;
font-family: "Coiny", sans-serif;
}
.circle {
position: relative;
border-radius: 50%;
width: 30rem;
height: 30rem;
background-color: #6CA9A5;
margin: 5rem auto;
}
.hello, .hello2 {
position: relative;
text-transform: uppercase;
font-family: "Montserrat", sans-serif;
font-weight: 900;
letter-spacing: .2rem;
font-size: 2.5rem;
color: #fff;
text-align: center;
padding-top: 100px;
/* z-index: 1; */
}
/* I added */
.hello2 {
position:absolute;
top:80px; /* changeable */
left:50%;
transform:translateX(-50%);
}
/* I added */
.hello span:hover {
color: #f4511e;
transition: .59s;
}
.circle a {
font-size: 15px;
text-decoration: none;
}
/* .more a {
height: 150px;
width: 500px;
background-color: #fff;
} */
#container {
color:#999;
text-transform: uppercase;
font-family: "Montserrat", sans-serif;
font-size:36px;
font-weight:bold;
padding-top:180px;
position: relative;
width:100%;
bottom:45%;
display:block;
text-align: center;
}
#flip {
height:60px;
overflow:hidden;
}
#flip > div > div {
border-radius: 30px;
color:#fff;
padding:4px 15px;
height:45px;
margin-bottom:45px;
display:inline-block;
}
#flip div:first-child {
animation: show 5s linear infinite;
}
#flip div div {
background:#42c58a;
}
#flip div:first-child div {
background:#4ec7f3;
}
#flip div:last-child div {
background:#DC143C;
}
#keyframes show {
0% {margin-top:-270px;}
5% {margin-top:-180px;}
33% {margin-top:-180px;}
38% {margin-top:-90px;}
66% {margin-top:-90px;}
71% {margin-top:0px;}
99.99% {margin-top:0px;}
100% {margin-top:-270px;}
}
<div class="content">
<h1 class="possible">Everything is Possible</h1>
<div class="circle">
<p class="hello">Let's Make </p>
<div id="container">
<div id="flip">
<div><div>wOrK</div></div>
<div><div>lifeStyle</div></div>
<div><div>Everything</div></div>
</div>
</div>
<p class="hello2">Awesome</p>
Read More
</div>
</div>

Why is there a gap on the edges of my website even with width set to 100%?

UPDATE: I have included all of my code. I have my width for the body and background images set to 100% and I have a gap around the perimeter of my page. I tried playing with the percentages, margins and padding and nothing so far is working. I do have a background image that is black so it is very noticeable.
Here is some of my CSS:
body {
background: url("background.png") no-repeat fixed center;
background-size: 100%;
width: 100%;
margin: 0;
padding: 0;
}
#msg {
color: #000000;
font-size: 40px;
margin: 0 auto;
padding-top: 400px;
padding-right: 50px;
float: right;
font-family: "Roboto Mono", monospace;
}
header {
width: 100%;
background: url("background 2.png") no-repeat fixed center;
background-size: 100%;
animation: example 1s;
animation-iteration-count: 1;
margin: -10px;
margin: 0;
padding: 0;
}
#keyframes example {
0% {
background: url("background.png") no-repeat fixed center;
}
25% {
background: grey;
}
50% {
background: url("background.png") no-repeat fixed center;
}
100% {
background: url("background.png") no-repeat fixed center;
}
}
.glitch {
position: relative;
font-family: "Raleway", sans-serif;
font-weight: 500;
color: white;
font-size: 250px;
padding-top: 300px;
text-align: center;
}
.glitch::before,
.glitch::after {
content: attr(data-text);
position: absolute;
top: 300.5px;
left: 0;
width: 100%;
height: 100%;
}
.glitch::before {
left: 5px;
text-shadow: -1.5px 0 red !important;
background: black;
animation: glitch-anim-1 1.89s infinite linear alternate-reverse;
}
.glitch::after {
left: -10px;
text-shadow: -1.5px 0 rgb(89, 0, 255);
background: black;
animation: glitch-anim-2 1.8s infinite linear alternate-reverse;
}
#keyframes glitch-anim-1 {
0% {
clip: rect(100px, 1500px, 150px, 0);
}
10% {
clip: rect(50px, 1500px, 25px, 0);
}
20% {
clip: rect(50px, 1500px, 25px, 0);
}
30% {
clip: rect(50px, 1500px, 400px, 0);
}
40% {
clip: rect(600px, 1500px, 50px, 0);
}
50% {
clip: rect(300px, 1500px, 65px, 0);
}
60% {
clip: rect(100px, 1500px, 150px, 0);
}
70% {
clip: rect(50px, 1500px, 25px, 0);
}
80% {
clip: rect(200px, 1500px, 30px, 0);
}
90% {
clip: rect(600px, 1500px, 50px, 0);
}
100% {
clip: rect(600px, 1500px, 50px, 0);
}
}
#keyframes glitch-anim-2 {
0% {
clip: rect(100px, 1500px, 150px, 0);
}
10% {
clip: rect(50px, 1500px, 25px, 0);
}
20% {
clip: rect(50px, 1500px, 25px, 0);
}
30% {
clip: rect(50px, 1500px, 400px, 0);
}
40% {
clip: rect(600px, 1500px, 50px, 0);
}
50% {
clip: rect(300px, 1500px, 65px, 0);
}
60% {
clip: rect(100px, 1500px, 150px, 0);
}
70% {
clip: rect(50px, 1500px, 25px, 0);
}
80% {
clip: rect(200px, 1500px, 30px, 0);
}
90% {
clip: rect(600px, 1500px, 50px, 0);
}
100% {
clip: rect(600px, 1500px, 50px, 0);
}
}
.arrow {
color: #ffffff;
font-size: 80px;
margin-top: 6%;
margin-left: 50%;
margin-bottom: 10%;
}
/* -----------
NAVIGATION
------------ */
nav {
position: fixed;
top: 0;
width: 100%;
text-align: center !important;
background: #fffefe;
margin: -8px;
z-index: 2 !important;
}
nav > ul > li {
padding: 8px 20px;
display: inline-block;
}
nav > ul > li > a {
text-decoration: none;
list-style-type: none;
color: #000000;
font-family: "Major Mono Display", monospace;
font-size: 20px;
}
nav > ul > li:hover {
/* ADD WEBKIT */
transform: rotate(-180deg);
}
.container {
background: url("background.png") no-repeat fixed center;
background-size: 100%;
width: 100%;
height: 500px;
}
.sectionHead {
font-family: "Major Mono Display", monospace;
float: right;
/* ADD WEBKIT */
transform: rotate(90deg);
font-size: 30px;
padding: 50px 10px;
}
/* ABOUT */
.b1 {
background: #fffefe;
width: 90%;
height: 600px;
margin-top: 150px;
margin-bottom: 200px;
float: left;
}
.aboutPic {
width: 355px;
height: 325px;
margin-top: 140px;
margin-left: 50px;
border-radius: 50%;
}
#description {
margin-left: 400px;
margin-right: 200px;
margin-top: -300px;
padding: 20px;
text-align: center;
}
.name {
text-transform: uppercase;
font-family: "Raleway", sans-serif;
font-size: 45px;
font-weight: 100;
letter-spacing: 1px;
line-height: 1px;
}
.des1 {
font-family: "Raleway", sans-serif;
font-size: 20px;
font-weight: 800;
text-transform: uppercase;
line-height: 20px;
}
.des2 {
font-family: "Raleway", sans-serif;
font-size: 16px;
font-weight: 500;
}
/* SKILLS */
.b2 {
background: #fffefe;
width: 90%;
height: 600px;
margin-bottom: 200px;
float: right !important;
}
#skills-text {
position: absolute;
width: 30%;
margin-top: 200px;
margin-left: 700px;
font-family: "Raleway", sans-serif;
}
#skills-text .title {
text-transform: uppercase;
font-family: "Raleway", sans-serif;
font-size: 35px;
font-weight: 200;
line-height: 2px;
}
#skills-text > ul > li {
font-size: 16px;
font-weight: 200;
}
#skills {
position: relative;
margin-top: 40px;
width: 50%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-evenly;
text-align: center;
}
#skills p {
font-family: "Raleway", sans-serif;
text-align: center;
font-size: 11px;
margin-top: 5px;
margin-bottom: -5px;
}
i {
font-size: 48px;
}
.jquery {
width: 50px;
height: 50px;
}
.redux {
margin-top: -2px;
margin-bottom: 2px;
width: 80px;
height: 60px;
}
.boot {
margin-top: 0px;
margin-bottom: 0px;
width: 45px;
height: 45px;
}
/* PROJECTS */
.b3 {
background: #fffefe;
width: 90%;
height: 600px;
margin-bottom: 200px;
float: left;
}
.projects {
padding-top: 86px;
padding-left: 20px;
}
figure.display {
display: inline-block;
position: relative;
overflow: hidden;
width: 21.5%;
height: 21.5%;
color: #646464;
text-align: center;
border-radius: 50%;
}
h2 {
font-family: "Roboto Mono", monospace;
font-size: 20px;
}
.projectLi {
font-family: "Raleway", sans-serif;
font-size: 12px;
text-align: start;
}
figure.display * {
-webkit-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
figure.display img {
width: 140%;
opacity: 0.3;
}
a {
text-decoration: none;
}
#link {
text-decoration: none;
list-style-type: none;
background: none;
border: 1px solid #646464;
border-radius: 5%;
color: #646464;
width: 42%;
height: 15%;
margin: 3px;
padding-left: 0;
font-family: "Raleway", sans-serif;
font-size: 12px;
font-weight: 700;
text-align: center;
}
#link:hover {
background: #646464;
color: #ffffff;
transition: 500ms;
padding-left: -10px;
}
#link > i {
font-size: 13px;
color: #646464;
background: none;
padding-left: 0;
}
figure.display figcaption {
position: absolute;
margin: 40px;
display: inline-block;
padding: 5px 5px;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
figure.display:before {
height: 100%;
width: 100%;
top: 0;
left: 0;
content: "";
background: #c2c1c1;
position: absolute;
-webkit-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
-webkit-transform: rotate(110deg) translateY(-50%);
transform: rotate(110deg) translateY(-50%);
}
figure.display.overlay {
background: #f1f1f1;
}
.note {
list-style-type: none;
font-size: 13px;
padding-top: 5px;
}
/* CONTACT */
.b4 {
background: #fffefe;
width: 90%;
height: 600px;
margin-bottom: 100px;
float: right !important;
}
form {
position: absolute;
margin-top: 100px;
margin-left: 400px;
}
input {
width: 400px;
height: 30px;
margin: 15px 0px;
border-bottom: 1px solid #000000;
border-top: none;
border-left: none;
border-right: none;
background: #fffefe;
}
input::placeholder {
font-family: "Raleway", sans-serif;
font-size: 14px;
}
textarea {
background: #fffefe;
height: 100px;
min-width: 396px;
max-width: 396px;
border: 1px solid #000000;
}
textarea::placeholder {
font-family: "Raleway", sans-serif;
font-size: 14px;
padding: 2px;
}
.submit {
font-family: "Raleway", sans-serif;
font-size: 14px;
margin-top: 10px;
width: 400px;
height: 30px;
box-shadow: none;
background: #000000;
color: #fffefe;
border: 1px solid black;
}
.fa-angle-double-right {
font-size: 12px;
}
button:hover {
background: #fffefe;
color: #000000;
}
.formText {
text-align: center;
}
/* FOOTER */
footer {
clear: both;
background: #fffefe;
color: #8f8f8f;
height: 100px;
width: 100%;
margin-bottom: -200px;
}
h3 {
font-family: "Raleway", sans-serif;
font-size: 14px;
font-weight: 300;
text-align: center;
padding-top: 30px;
}
.social {
margin-top: -50px;
margin-right: 90px;
float: right;
}
.fli {
font-size: 20px;
color: #8f8f8f;
padding: 10px;
}
.fli:hover {
color: #000000;
transition: 800ms;
}
.fg {
font-size: 20px;
color: #8f8f8f;
padding: 10px;
}
.fg:hover {
color: #000000;
transition: 800ms;
}
It is a basic thing that the default margin added in your page .
For Ex :
Click to see the Default margin
So you need to remove that. So you have to add the style in your style tag <style>body {margin:0px;}>
And you can add your additional styles based on your need.
<html>
<head>
<style>
.img
{
width:100%;
height:100%;
}
body
{
margin:0px;
}
</style>
</head>
<body>
<image src="https://4.img-dpreview.com/files/p/E~TS590x0~articles/3925134721/0266554465.jpeg" class="img">
</body>
</html>
Hope it will help you. Thanks.
The thing is the browsers have some default css settings. Search Google for phrase "reset css" and include it before defining your own look :) beware that everything will be then unstyled before you redefine it
Try to set the property of background image...
background-size : cover;
I think so from this property your problem will be solved.
Well I don't know your html structure, so I am suggesting something that I use mostly,
<head>
#..
</head>
<body style="margin: 0;">
<img class="background">
</body>
<style>
.background{
width: 100%;
height: ..
..
}
</style>
What I do is to make body, the whole screen. Margin set to 0 make it 100% screen size with no more margin left.
Then I add my header div or background image or footer inside it instead of adding directly the background image to the body tag. You can make all these 100% or whatever your requirement. There will not be any problem regarding margin.
This is something I use that works fine for me in most cases. Hope this can help you as well.

Need to apply hover to 2nd div when hover over 1st div

CSS:
#content-items .thumb-artist img {
width: 220px;
position: relative;
z-index: 10;
height: 147px;
}
#filter-artist {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
padding: 25px 0 25px 10px;
position: relative;
font-weight: bold;
color: #666666;
text-transform: uppercase;
float: left;
width: 100%;
line-height: 1.4em;
}
#filter-artist #s {
border: 0;
font-size: 10px;
color: #666666;
background: transparent;
text-transform: uppercase;
font-family: Arial, Helvetica, sans-serif;
padding: 1px 0px;
width: 80%;
}
#content-items {
width: 960px;
margin: 0 auto;
color: #fff;
}
#filter-artist span {
float: left;
}
#filter-artist a {
color: #666666;
padding: 0 8px;
float: left;
}
.active-filter {
color: #fff!important;
}
#filter-artist #submit {
background-image: url(img/icons.png);
background-position: -84px 0px;
background-color: transparent;
border: 0;
height: 14px;
line-height: 0;
padding: 0;
width: 14px;
float:right;
}
#filter-artist > p {display:none;}
#filter-artist form {
float: left;
border-bottom: 1px solid #666666;
}
#filter-artist #submit:hover {
background-image: url(img/icons.png);
background-position: -84px -14px;
}
#content-items .artist {
width: 25%;
float: left;
padding: 0 1% 40px 1%;
line-height: 1em;
height: 270px;
height: 190px!important;
}
#content-items .thumb-artist {
position: relative;
}
.thumb-artist img:hover .social-content {
opacity:1;
}
#content-items .artist h3 {
font-size: 18px;
margin: 10px 0;
line-height: 1em;
color: #fff;
font-family: "futura-pt",sans-serif;
}
}
element.style {
display: none;
}
#load-items .social-content {
position: absolute;
top: 80%;
left: 0%;
z-index: 15;
width: 100%;
text-align: center;
opacity:0;
-webkit-transition: all 0.5s ease-in;
-moz-transition: all 0.5s ease-in;
-o-transition: all 0.5s ease-in;
transition: all 0.5s ease-out;
}
.social {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
line-height: 1em;
display: inline-block;
font-size: 10px;
font-family: Arial, Helvetica, sans-serif;
color: #fff;
line-height: 11px;
margin-right: 4px;
}
.facebook {
position:relative;
background-image: url(img/icons.png);
background-position: -3px -1px;
width: 20px;
height: 20px;
padding: 5px;
z-index:15;
float:left;
}
.web {
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
float:left;
}
.sat-color {
background-color: #ff0033;
padding: 5px;
}
.social-content a:hover {
color: #ff3333;
}
.twitter {
position:relative;
background-image: url(img/icons.png);
background-position: -45px -1px;
width: 20px;
height: 20px;
padding: 5px;
float:left;
}
#load-items .social-content:hover {
position: absolute;
top: 80%;
left: 0%;
z-index: 15;
width: 100%;
text-align: center;
opacity:1;
}
.sat-color:hover {
background-color: #ff3333;
color: #fff !important;
}
HTML:
<article id="content-items">
<div id="filter-artist">
<span>FILTER:</span>
ALLNEWESTALPHABETICAL</div>
<div id="load-items">
<div class="artist">
<div class="thumb-artist">
<img width="300" height="138" src="http://downunderlabelgroup.com/wp-content/uploads/2013/03/k_oconnor_lge-300x138.jpg" class="attachment-medium wp-post-image" alt="Kim O'Connor">
<span class="social-content">
OFFICIAL SITE
</span>
</div>
<h3 class="name-artist">Troye Sivan</h3>
</div></div></article>
At the moment the hover effect is only applied when the mouse is hovered onto the social content. I would like to apply it to the whole picture.
So if anyone hovers onto the image the social content is displayed.
Thanks alot.
There are 2 options, 1 make the hover on the div, 2 hover on the img
1st option (recommended):
#content-items .thumb-artist:hover .social-content {
opacity: 1;
}
2nd option (use + next selector):
#content-items .thumb-artist .wp-post-image:hover + .social-content {
opacity: 1;
}
DEMO: http://jsfiddle.net/7w8spct6/
Maybe a CSS rule like this could work
img.attachement-medium:hover + .social-content {
position: absolute;
top: 80%;
left: 0%;
z-index: 15;
width: 100%;
text-align: center;
opacity:1;
}
But a better way would be to actually take the <img> and <span> elements you want and put them inside a new <div> and then have a rule for the contents of the <div>
<div class="wrapper">
<img width="300" height="138" src="http://downunderlabelgroup.com/wp-content/uploads/2013/03/k_oconnor_lge-300x138.jpg" class="content attachment-medium wp-post-image" alt="Kim O'Connor">
<span class="social-content content">
OFFICIAL SITE
</span>
</div>
.wrapper:hover .content {
/*styles*/ }