How to add video background over a section? - css

I'm trying to replace a header background image with a short video. I've searched a lot but couldn't find a proper solution to it.
I could find this article but couldn't do much with it as I'm still a novice in web development.
Can anyone please help me with the changes required in my code.
Here is a link to my Fiddle.
HTML:
<section>
<header>
<h1><strong>Header</strong></h1>
<p>Lorem Ipsum</p>
</header>
<footer>
US
UK
India
China
Mongolia
</footer>
</section>
CSS:
.dark {
color: #aaa;
color: rgba(255, 255, 255, 0.65);
}
#header {
position: relative;
margin: 0;
background-image: url("http://www.mygreencity.in/images/slider/1.jpg");
background-size: auto, cover;
background-position: top left, center center;
background-repeat: repeat, no-repeat;
padding: 14em 0 14em 0;
text-align: center;
color: #fff;
}
#header header h1 {
font-size: 2.25em;
line-height: 1.25em;
margin-bottom: 0;
}
#header header p {
margin-top: 1.25em;
font-weight: 100;
padding: 0;
font-size: 1.25em;
line-height: 1.5em;
text-align: center;
}
#header footer {
padding-top: 1.5em;
}
input[type="button"],
input[type="submit"],
input[type="reset"],
button,
.button {
-moz-transition: all 0.25s ease-in-out;
-webkit-transition: all 0.25s ease-in-out;
-ms-transition: all 0.25s ease-in-out;
transition: all 0.25s ease-in-out;
-webkit-appearance: none;
position: relative;
display: inline-block;
background: #3d3d3d;
padding: 0.85em 3em 0.85em 3em;
border-radius: 0.25em;
cursor: pointer;
border: 0;
color: #fff;
text-align: center;
text-decoration: none;
}
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
button:hover,
.button:hover {
background: #4f4f4f;
}
input[type="button"].alt,
input[type="submit"].alt,
input[type="reset"].alt,
button.alt,
.button.alt {
color: inherit;
box-shadow: inset 0 0 0 1px #e6e6e6;
background: none;
}
input[type="button"].alt:hover,
input[type="submit"].alt:hover,
input[type="reset"].alt:hover,
button.alt:hover,
.button.alt:hover {
background: rgba(0, 0, 0, 0.025);
}
.dark input[type="button"],
.dark input[type="submit"],
.dark input[type="reset"],
.dark button,
.dark .button {
background: rgba(255, 255, 255, 0.15);
box-shadow: inset 0 0 0 1px #fff;
color: #fff;
}
.dark input[type="button"]:hover,
.dark input[type="submit"]:hover,
.dark input[type="reset"]:hover,
.dark button:hover,
.dark .button:hover {
background: rgba(255, 255, 255, 0.25);
}
.dark input[type="button"].alt,
.dark input[type="submit"].alt,
.dark input[type="reset"].alt,
.dark button.alt,
.dark .button.alt {
background: none;
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.dark input[type="button"].alt:hover,
.dark input[type="submit"].alt:hover,
.dark input[type="reset"].alt:hover,
.dark button.alt:hover,
.dark .button.alt:hover {
background: rgba(255, 255, 255, 0.15);
box-shadow: inset 0 0 0 1px #fff;
}

You could use the jquery videoBG plugin: http://syddev.com/jquery.videoBG/
Or you could add the following code: https://jsfiddle.net/5oxjuyum/1/
The alternative image is displayed when the browser doesn't support the video.
HTML
<video id="video" autoplay>
<source src="video.mp4" type="video/mp4" />
<img id="alternative" src="http://www.mygreencity.in/images/slider/1.jpg" />
</video>
CSS
#video, #alternative {
width: 100%;
height: 100vh;
object-fit: cover;
position: fixed;
left: 0px;
top: 0px;
z-index: -1;
}

https://css-tricks.com/snippets/jquery/append-site-overlay-div/
$(function() {
var docHeight = $(document).height();
$("body").append("<div id='overlay'>VIDEO TAG</div>");
$("#overlay")
.height(docHeight)
.css({
'opacity' : 0.4,
'position': 'absolute',
'top': 0,
'left': 0,
'background-color': 'black',
'width': '100%',
'z-index': 5000
});
});

Related

set div width to fit the content

I tried creating a button. I didn't set the width so it should automatically increase the width when I add a margin to the div or the svg, but it just scales it down and hides the overflow.
.btn {
position: relative;
display: flex;
background: none;
margin: 0.5% 0;
padding: .8%;
border: 1px solid rgba(255, 255, 255, 0);
border-radius: 5px;
cursor: pointer;
color: white;
gap: 20%;
&:hover {
background: rgba(255, 255, 255, .1);
border: 1px solid rgba(255, 255, 255, .4);
}
&:hover.disabled {
background: none;
border: 1px solid rgba(255, 255, 255, 0);
}
&.disabled {
cursor: default;
color: gray;
}
& svg {
background: none;
color: white;
cursor: pointer;
height: 100%;
}
& div {
font-size: 100%;
}
}
Tested the following code on Firefox, and it works as expected. I do not understand what is the problem you are facing, and on what browser.
Also, since, you did not provide any information about the div inside your button, I left it as an empty element. As a result, the div occupies zero width for its content - since it has no content inside of it. Although, padding and margin on the div should work.
Plus, I set box-sizing: border-box on everything using the wildcard selector, since it makes visualizing layout boxes a bit intuitive.
* {
box-sizing: border-box;
}
.btn {
position: relative;
display: flex;
background: transparent;
margin: 0.5% 0;
padding: 0.8%;
/* Changed the border color, so we can see the button size grow */
border: 1px solid black;
border-radius: 5px;
cursor: pointer;
color: white;
gap: 20%;
}
.btn:hover {
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.4);
}
.btn:hover.disabled {
background: none;
border: 1px solid rgba(255, 255, 255, 0);
}
.btn.disabled {
cursor: default;
color: gray;
}
.btn svg {
background: none;
color: white;
cursor: pointer;
height: 100%;
/* Adding margin to check if everything is working fine */
margin: 10px;
}
.btn div {
font-size: 100%;
}
<button class="btn">
<svg width="18" height="18" viewBox="0 0 18 18">
<path d="M15 2V1H3v1H0v4c0 1.6 1.4 3 3 3v1c.4 1.5 3 2.6 5 3v2H5s-1 1.5-1 2h10c0-.4-1-2-1-2h-3v-2c2-.4 4.6-1.5 5-3V9c1.6-.2 3-1.4 3-3V2h-3ZM3 7c-.5 0-1-.5-1-1V4h1v3Zm8.4 2.5L9 8 6.6 9.4l1-2.7L5 5h3l1-2.7L10 5h2.8l-2.3 1.8 1 2.7h-.1ZM16 6c0 .5-.5 1-1 1V4h1v2Z"
></path>
</svg>
<div></div>
</button>

Transition on linear-gradient

I have problem with adding transition on gradient. I know that its impossible to transition gradient and I found a solution. https://keithjgrant.com/posts/2017/07/transitioning-gradients/
The background-image should be revealed in time. This button have background-color: black; and should change on gradient with hover. Any idea how can I make this on a hover pseudoclass?
.register {
float: right;
padding: 0 20px;
text-transform: uppercase;
}
.register a {
border: 1px solid white;
border-radius: 4px;
}
.register a:hover {
background-image: linear-gradient( to bottom right, rgb(40, 40, 40), rgb(60, 60, 60));
}
<li class="register">register</li>
You could try doing a transition from white to black (if, by your suggested code snippet, that is what you'd like).
<a class="btn btn-1">Hover me</a>
Accompanied by CSS:
.btn {
flex: 1 1 auto;
margin: 10px;
padding: 30px;
text-align: center;
text-transform: uppercase;
transition: 0.5s;
background: linear-gradient(90deg, var(--c1, #fff), var(--c2, #333) 51%, var(--c1, #000)) var(--x, 0)/ 200%;
color: white;
}
.btn:hover { --x: 100%; }
.btn-1 {
--c1: #fff;
--c2: #000;
}
See my fiddle for more
https://jsfiddle.net/80f7t1ej/

editing HTML template

I am trying to edit this free template but im stuck with banner. I need to edit banner so that only image remains and not this red transparent background over it.
Here is the link to the template: http://app-radetic.com/ivanj_t/index.html
and this is css file. I can't find out where in banner section I can change it.
/* Banner */
#banner {
-ms-flex-align: center;
-ms-flex-pack: center;
background-color: #111111;
color: rgba(255, 255, 255, 0.5);
-moz-align-items: center;
-webkit-align-items: center;
-ms-align-items: center;
align-items: center;
display: -moz-flex;
display: -webkit-flex;
display: -ms-flex;
display: flex;
-moz-justify-content: center;
-webkit-justify-content: center;
-ms-justify-content: center;
justify-content: center;
background-image: url("../../images/banner.jpg");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
border-top: 0;
display: -ms-flexbox;
height: 35rem !important;
min-height: 35rem;
overflow: hidden;
position: relative;
text-align: center;
width: 100%; }
#banner input, #banner select, #banner textarea {
color: #ffffff; }
#banner a {
color: #ce1b28; }
#banner strong, #banner b {
color: #ffffff; }
#banner h1, #banner h2, #banner h3, #banner h4, #banner h5, #banner h6 {
color: #ffffff; }
#banner blockquote {
border-left-color: rgba(255, 255, 255, 0.25); }
#banner code {
background: rgba(255, 255, 255, 0.075);
border-color: rgba(255, 255, 255, 0.25); }
#banner hr {
border-bottom-color: rgba(255, 255, 255, 0.25); }
#banner input[type="submit"],
#banner input[type="reset"],
#banner input[type="button"],
#banner button,
#banner .button {
background-color: transparent;
box-shadow: inset 0 0 0 1px #ffffff;
color: #ffffff !important; }
#banner input[type="submit"]:hover,
#banner input[type="reset"]:hover,
#banner input[type="button"]:hover,
#banner button:hover,
#banner .button:hover {
/box-shadow: inset 0 0 0 1px #ce1b28;
color: #ce1b28 !important; }
#banner input[type="submit"]:hover:active,
#banner input[type="reset"]:hover:active,
#banner input[type="button"]:hover:active,
#banner button:hover:active,
#banner .button:hover:active {
background-color: rgba(206, 27, 40, 0.25); }
#banner input[type="submit"].primary,
#banner input[type="reset"].primary,
#banner input[type="button"].primary,
#banner button.primary,
#banner .button.primary {
box-shadow: none;
background-color: #ce1b28;
color: #ffffff !important; }
#banner input[type="submit"].primary:hover,
#banner input[type="reset"].primary:hover,
#banner input[type="button"].primary:hover,
#banner button.primary:hover,
#banner .button.primary:hover {
background-color: #e2212f;
box-shadow: none; }
#banner input[type="submit"].primary:hover:active,
#banner input[type="reset"].primary:hover:active,
#banner input[type="button"].primary:hover:active,
#banner button.primary:hover:active,
#banner .button.primary:hover:active {
background-color: #b71824; }
#banner label {
color: #ffffff; }
#banner input[type="text"],
#banner input[type="password"],
#banner input[type="email"],
#banner input[type="tel"],
#banner input[type="search"],
#banner input[type="url"],
#banner select,
#banner textarea {
background-color: rgba(255, 255, 255, 0.075);
border-color: rgba(255, 255, 255, 0.25); }
#banner input[type="text"]:focus,
#banner input[type="password"]:focus,
#banner input[type="email"]:focus,
#banner input[type="tel"]:focus,
#banner input[type="search"]:focus,
#banner input[type="url"]:focus,
#banner select:focus,
#banner textarea:focus {
border-color: #ce1b28;
box-shadow: 0 0 0 1px #ce1b28; }
#banner select {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' preserveAspectRatio='none' viewBox='0 0 40 40'%3E%3Cpath d='M9.4,12.3l10.4,10.4l10.4-10.4c0.2-0.2,0.5-0.4,0.9-0.4c0.3,0,0.6,0.1,0.9,0.4l3.3,3.3c0.2,0.2,0.4,0.5,0.4,0.9 c0,0.4-0.1,0.6-0.4,0.9L20.7,31.9c-0.2,0.2-0.5,0.4-0.9,0.4c-0.3,0-0.6-0.1-0.9-0.4L4.3,17.3c-0.2-0.2-0.4-0.5-0.4-0.9 c0-0.4,0.1-0.6,0.4-0.9l3.3-3.3c0.2-0.2,0.5-0.4,0.9-0.4S9.1,12.1,9.4,12.3z' fill='rgba(255, 255, 255, 1.0)' /%3E%3C/svg%3E"); }
#banner select option {
color: rgba(255, 255, 255, 0.5);
background-color: #111111; }
#banner input[type="checkbox"] + label,
#banner input[type="radio"] + label {
color: rgba(255, 255, 255, 0.5); }
#banner input[type="checkbox"] + label:before,
#banner input[type="radio"] + label:before {
background: rgba(255, 255, 255, 0.075);
border-color: rgba(255, 255, 255, 0.25); }
#banner input[type="checkbox"]:checked + label:before,
#banner input[type="radio"]:checked + label:before {
background-color: #ce1b28;
border-color: #ce1b28;
color: #ffffff; }
#banner input[type="checkbox"]:focus + label:before,
#banner input[type="radio"]:focus + label:before {
border-color: #ce1b28;
box-shadow: 0 0 0 1px #ce1b28; }
#banner ::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.4) !important; }
#banner :-moz-placeholder {
color: rgba(255, 255, 255, 0.4) !important; }
#banner ::-moz-placeholder {
color: rgba(255, 255, 255, 0.4) !important; }
#banner :-ms-input-placeholder {
color: rgba(255, 255, 255, 0.4) !important; }
#banner ul.alt li {
border-top-color: rgba(255, 255, 255, 0.25); }
#banner table tbody tr {
border-color: rgba(255, 255, 255, 0.25); }
#banner table tbody tr:nth-child(2n + 1) {
background-color: rgba(255, 255, 255, 0.075); }
#banner table th {
color: #ffffff; }
#banner table thead {
border-bottom-color: rgba(255, 255, 255, 0.25); }
#banner table tfoot {
border-top-color: rgba(255, 255, 255, 0.25); }
#banner table.alt tbody tr td {
border-color: rgba(255, 255, 255, 0.25); }
#banner .highlights .content {
background: #111111;
box-shadow: 0px 0px 4px 1px rgba(255, 255, 255, 0.025); }
#banner .testimonials .content {
background: #111111;
box-shadow: 0px 0px 4px 1px rgba(255, 255, 255, 0.025); }
#banner .testimonials .content .credit strong {
color: #ce1b28; }
#banner > .inner {
-moz-transform: scale(1.0);
-webkit-transform: scale(1.0);
-ms-transform: scale(1.0);
transform: scale(1.0);
-moz-transition: opacity 1s ease, -moz-transform 1s ease;
-webkit-transition: opacity 1s ease, -webkit-transform 1s ease;
-ms-transition: opacity 1s ease, -ms-transform 1s ease;
transition: opacity 1s ease, transform 1s ease;
opacity: 1;
position: relative;
z-index: 3; }
#banner > .inner > :last-child {
margin-bottom: 0; }
#banner h1 {
font-size: 4rem;
margin-bottom: 1rem; }
#banner p {
font-size: 1.5rem; }
#banner a {
color: rgba(255, 255, 255, 0.5);
text-decoration: none; }
#banner a:hover {
color: #ffffff; }
#banner video {
-moz-transform: translateX(50%) translateY(50%);
-webkit-transform: translateX(50%) translateY(50%);
-ms-transform: translateX(50%) translateY(50%);
transform: translateX(50%) translateY(50%);
bottom: 50%;
height: auto;
min-height: 100%;
min-width: 100%;
overflow: hidden;
position: absolute;
right: 50%;
width: auto; }
#banner:before {
-moz-transition: opacity 3s ease;
-webkit-transition: opacity 3s ease;
-ms-transition: opacity 3s ease;
transition: opacity 3s ease;
-moz-transition-delay: 1.25s;
-webkit-transition-delay: 1.25s;
-ms-transition-delay: 1.25s;
transition-delay: 1.25s;
background: #111111;
content: '';
display: block;
height: 100%;
left: 0;
opacity: 0.45;
position: absolute;
top: 0;
width: 100%;
z-index: 1; }
#banner:after {
background: linear-gradient(135deg, #ce1b28 0%, #111111 74%);
content: ' ';
display: block;
height: 100%;
left: 0;
opacity: 0.6;
position: absolute;
top: 0;
webkit-linear-gradientidth: 100%;
width: 100%;
z-index: 1; }
#banner.small {
height: 30vh !important;
min-height: 30vh; }
#media screen and (max-width: 1280px) {
#banner video {
display: none; } }
#media screen and (max-width: 736px) {
#banner {
height: auto !important;
min-height: 0;
padding: 4rem 2rem 4rem 2rem; }
#banner .inner {
width: 100%; }
#banner h1 {
font-size: 1.75rem;
margin-bottom: 0.5rem;
padding-bottom: 0; }
#banner p {
font-size: 1.25rem; }
#banner br {
display: none; }
#banner .button {
width: 100%; } }
#media screen and (max-width: 480px) {
#banner p {
font-size: 1rem; } }
body.is-preload #banner .inner {
-moz-transform: scale(0.99);
-webkit-transform: scale(0.99);
-ms-transform: scale(0.99);
transform: scale(0.99);
opacity: 0; }
body.is-preload #banner:before {
opacity: 1; }
This rule is creating the gradient overlay, so try removing it
#banner:after {
background: linear-gradient(135deg, #ce1b28 0%, #111111 74%);
}
or adding this:
#banner:after {
background: none!important;
}
Should fix it

CSS: round buttons with shadow effect

I'm trying to replicate the navigation buttons here, that's a wix website so it's so hard to inspect elements.
What I have tried is here
https://jsfiddle.net/1vngy4uo/1/
I'm trying many variations, never getting the css 100% correct.
.navButton {
width:15%;
display:inline-block;
position:relative;
background-color:#03314b;
border-radius: 30%;
box-shadow: 2px 2px 2px #888888;
}
.navButton:hover {
background-color:#98b7c8;
}
.navButton span {
width:100%;
display:inline-block;
position:absolute;
border-radius: 30%;
box-shadow: 2px 2px 2px #888888;
}
.navButton .bg {
height:50%;
top:0;
background-color:#3a6076 ;
border-radius: 30%;
box-shadow: 2px 2px 2px #888888;
}
.navButton:hover .bg{
background-color:#afcad9;
}
.navButton .text {
position:relative;
text-align:center;
color:#fff;
vertical-align: middle;
align-items: center;
}
.navButton .text:hover {
color:#000000;
}
and html
<a href="contact.html" class="navButton">
<span class="bg"></span>
<span class="text">Contact</span>
A very similar one, using linear-gradient and less HTML markup
jsFiddle
.navButton {
color: white;
text-decoration: none;
font-family: Helvetica, Arial, sans-serif;
font-size: 14px;
text-align: center;
padding: 0 30px;
line-height: 30px;
display: inline-block;
position: relative;
border-radius: 20px;
background-image: linear-gradient(#335b71 45%, #03324c 55%);
box-shadow: 0 2px 2px #888888;
transition: color 0.3s, background-image 0.5s, ease-in-out;
}
.navButton:hover {
background-image: linear-gradient(#b1ccda 49%, #96b4c5 51%);
color: #03324c;
}
Contact
I just used a div element to implement the same button that you referred. Is this what you want?
https://jsfiddle.net/9L60y8c6/
<div class="test">
</div>
.test {
cursor: pointer;
background: rgba(4, 53, 81, 1) url(//static.parastorage.com/services/skins/2.1212.0/images/wysiwyg/core/themes/base/shiny1button_bg.png) center center repeat-x;
border-radius: 10px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
transition: background-color 0.4s ease 0s;
position: absolute;
top: 0;
bottom: 0;
left: 5px;
right: 5px;
height: 30px;
width: 115px;
}
Would this be a start? You might want to adjust the colors a little.
Note: One can use linear-gradient, though it won't work on IE9, so I use a pseudo instead
.navButton {
width: 15%;
display: inline-block;
position: relative;
background-color: #03314b;
border-radius: 8px;
box-shadow: 2px 2px 2px #888888;
text-align: center;
text-decoration: none;
color: #fff;
padding: 5px;
transition: all 0.3s;
overflow: hidden;
}
.navButton:before {
content: '';
position: absolute;
top: 0;
left: 0;
height: 50%;
width: 100%;
background-color: #335b71;
transition: all 0.3s;
}
.navButton span {
position: relative;
}
.navButton:hover {
transition: all 0.3s;
background-color: #96b4c5;
color: black;
}
.navButton:hover:before {
transition: all 0.3s;
background-color: #b1ccda;
}
<a href="contact.html" class="navButton">
<span>Contact</span>
</a>

Click the circle after hovernig to direct to a url

https://jsfiddle.net/qd2o38fp/1/
I want the user to be able to hover over the circle, and then click the circle itself to be directed to another link. (not the text when hovered)
.ch-item {
width: 100%;
height: 100%;
border-radius: 50%;
overflow: hidden;
position: relative;
cursor: default;
box-shadow:
inset 0 0 0 16px rgba(255,255,255,0.6),
0 1px 2px rgba(0,0,0,0.1);
transition: all 0.4s ease-in-out;
content: url(www.yahoo.com);
}
I tried to put
content: url(www.yahoo.com);
but this makes the text disappear for some reason.
If you want to be able to click it, it must be a link:
<a href="//www.yahoo.com" class="ch-info">
<h3>See Portfolio</h3>
</a>
Just display it as a block, and your current code will work:
.ch-info {
display: block;
}
.ch-grid {
margin: 20px 0 0 0;
padding: 0;
list-style: none;
display: block;
text-align: center;
width: 100%;
}
.ch-grid::after {
clear: both;
}
.ch-grid li {
width: 220px;
height: 220px;
display: inline-block;
margin: 20px;
}
.ch-item {
width: 100%;
height: 100%;
border-radius: 50%;
overflow: hidden;
position: relative;
cursor: default;
box-shadow: inset 0 0 0 16px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.1);
transition: all 0.4s ease-in-out;
}
.ch-img-1 {
background-image: url(http://www.pulsarwallpapers.com/data/media/3/Alien%20Ink%202560X1600%20Abstract%20Background.jpg);
}
.ch-img-2 {
background-image: url(../images/2.jpg);
}
.ch-img-3 {
background-image: url(../images/3.jpg);
}
.ch-info {
position: absolute;
background: rgba(63, 147, 147, 0.8);
width: inherit;
height: inherit;
border-radius: 50%;
overflow: hidden;
opacity: 0;
transition: all 0.4s ease-in-out;
transform: scale(0);
display: block;
}
.ch-info h3 {
color: #fff;
text-transform: uppercase;
letter-spacing: 2px;
font-size: 22px;
margin: 0 30px;
padding: 45px 0 0 0;
height: 140px;
font-family: 'Open Sans', Arial, sans-serif;
text-shadow: 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.3);
}
.ch-info p {
color: #fff;
padding: 10px 5px;
font-style: italic;
margin: 0 30px;
font-size: 12px;
border-top: 1px solid rgba(255, 255, 255, 0.5);
opacity: 0;
transition: all 1s ease-in-out 0.4s;
}
.ch-info p a {
display: block;
color: rgba(255, 255, 255, 0.7);
font-style: normal;
font-weight: 700;
text-transform: uppercase;
font-size: 9px;
letter-spacing: 1px;
padding-top: 4px;
font-family: 'Open Sans', Arial, sans-serif;
}
.ch-info p a:hover {
color: rgba(255, 242, 34, 0.8);
}
.ch-item:hover {
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.1);
}
.ch-item:hover .ch-info {
transform: scale(1);
opacity: 1;
}
.ch-item:hover .ch-info p {
opacity: 1;
}
.ch-item::before {
content: "P";
position: absolute;
font-size: 180px;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
<ul class="ch-grid">
<li>
<div class="ch-item ch-img-1">
<a href="//www.yahoo.com" class="ch-info">
<h3>See Portfolio</h3>
</a>
</div>
</li>
</ul>
extending Oriol's you could also use clip-path: circle(110px at center);
to limit :hover selection
.ch-grid {
margin: 20px 0 0 0;
padding: 0;
list-style: none;
display: block;
text-align: center;
width: 100%;
}
.ch-grid::after {
clear: both;
}
.ch-grid li {
width: 220px;
height: 220px;
display: inline-block;
margin: 20px;
}
.ch-item {
width: 100%;
height: 100%;
border-radius: 50%;
overflow: hidden;
position: relative;
cursor: default;
box-shadow: inset 0 0 0 16px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.1);
transition: all 0.4s ease-in-out;
}
.ch-img-1 {
background-image: url(http://www.pulsarwallpapers.com/data/media/3/Alien%20Ink%202560X1600%20Abstract%20Background.jpg);
}
.ch-img-2 {
background-image: url(../images/2.jpg);
}
.ch-img-3 {
background-image: url(../images/3.jpg);
}
.ch-info {
position: absolute;
background: rgba(63, 147, 147, 0.8);
width: inherit;
height: inherit;
border-radius: 50%;
overflow: hidden;
opacity: 0;
transition: all 0.4s ease-in-out;
transform: scale(0);
display: block;
}
.ch-info h3 {
color: #fff;
text-transform: uppercase;
letter-spacing: 2px;
font-size: 22px;
margin: 0 30px;
padding: 45px 0 0 0;
height: 140px;
font-family: 'Open Sans', Arial, sans-serif;
text-shadow: 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.3);
}
.ch-info p {
color: #fff;
padding: 10px 5px;
font-style: italic;
margin: 0 30px;
font-size: 12px;
border-top: 1px solid rgba(255, 255, 255, 0.5);
opacity: 0;
transition: all 1s ease-in-out 0.4s;
}
.ch-info p a {
display: block;
color: rgba(255, 255, 255, 0.7);
font-style: normal;
font-weight: 700;
text-transform: uppercase;
font-size: 9px;
letter-spacing: 1px;
padding-top: 4px;
font-family: 'Open Sans', Arial, sans-serif;
clip-path: circle(110px at center);
}
.ch-info p a:hover {
color: rgba(255, 242, 34, 0.8);
clip-path: circle(110px at center);
}
.ch-item:hover {
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.1);
clip-path: circle(110px at center);
}
.ch-item:hover .ch-info {
transform: scale(1);
opacity: 1;
}
.ch-item:hover .ch-info p {
opacity: 1;
}
.ch-item::before {
content: "P";
position: absolute;
font-size: 180px;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
<ul class="ch-grid">
<li>
<div class="ch-item ch-img-1">
<a href="//www.yahoo.com" class="ch-info">
<h3>See Portfolio</h3>
</a>
</div>
</li>
</ul>

Resources