Content none on hover in a label - css

on hover i would like to remove the content inside a label. I have tried with the Portugal tab only. Is it restricted when working inside an element? Thank you
.tablabel {
background: rgba(0, 0, 0, .6);
border: 1px solid #000;
color: #fff !important;
height: 40px;
line-height: 37px;
width: auto;
padding: 2px 8px 2px 8px;
box-shadow: inset 0 0 0 0.1 transparent;
-webkit-transition: ease-out 0.4s;
-moz-transition: ease-out .4s;
transition: ease-out .4s;
transform: translate3d(0, 0, 0);
font-size: 1.15em;
}
.tablabel:hover {
color: #000 !important;
}
#portimg {
content: 'PORTUGAL';
}
#portimg:hover {
content: none;
background: url("/images/flags/portugal-flag.svg");
background-position: center 10%;
background-size: 200px;
transform: translate3d(0, 0, 0);
}
#portimg:hover:after {
content: none;
}
<div class="col-8 justify-content-center">
<input id="tab-1" type="radio" checked="checked" name="tab-groupa" />
<input id="tab-2" type="radio" name="tab-groupa" />
<input id="tab-3" type="radio" name="tab-groupa" />
<input id="tab-4" type="radio" name="tab-groupa" />
<input id="tab-5" type="radio" name="tab-groupa" />
<p class="row text-center justify-content-center text-center">
<label id="portimg" class="tablabel" for="tab-1"></label>
<label id="ukimg" class="tablabel" for="tab-2">UNTIED KINGDOM</label>
<label class="tablabel btn btn-dark white text-center" for="tab-3">CYPRUS</label>
<label class="tablabel btn btn-dark white text-center" for="tab-4">SPAIN</label>
<label class="tablabel btn btn-dark white text-center" for="tab-5">GREECE</label>
</p>

Just edit the #porting selector to this:
#portimg:after {
display: inline;
content: 'PORTUGAL';
}
Here your code edited.
.tablabel {
background: rgba(0, 0, 0, .6);
border: 1px solid #000;
color: #fff !important;
height: 40px;
line-height: 37px;
width: auto;
padding: 2px 8px 2px 8px;
box-shadow: inset 0 0 0 0.1 transparent;
-webkit-transition: ease-out 0.4s;
-moz-transition: ease-out .4s;
transition: ease-out .4s;
transform: translate3d(0, 0, 0);
font-size: 1.15em;
}
.tablabel:hover {
color: #000 !important;
}
#portimg:after {
display: inline;
content: 'PORTUGAL';
}
#portimg:hover {
content: none;
background: url("/images/flags/portugal-flag.svg");
background-position: center 10%;
background-size: 200px;
transform: translate3d(0, 0, 0);
}
#portimg:hover::after {
content: none;
}
<div class="col-8 justify-content-center">
<input id="tab-1" type="radio" checked="checked" name="tab-groupa" />
<input id="tab-2" type="radio" name="tab-groupa" />
<input id="tab-3" type="radio" name="tab-groupa" />
<input id="tab-4" type="radio" name="tab-groupa" />
<input id="tab-5" type="radio" name="tab-groupa" />
<p class="row text-center justify-content-center text-center">
<label id="portimg" class="tablabel" for="tab-1"></label>
<label id="ukimg" class="tablabel" for="tab-2">UNTIED KINGDOM</label>
<label class="tablabel btn btn-dark white text-center" for="tab-3">CYPRUS</label>
<label class="tablabel btn btn-dark white text-center" for="tab-4">SPAIN</label>
<label class="tablabel btn btn-dark white text-center" for="tab-5">GREECE</label>
</p>
</div>

Related

not able to select all the when checked

hope i can get some help.
First, i'm new in to programming. I found a great tuto on youtube and wanted to recopied it. It works almost fine, but for some reason I don't get the same result.
When the mouse goes hover the stars it only shows some part of it and when i checked ex. 4 stars it only shows the last part of the 4th star.
thans for the help
HTML:
enter image description here
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rating Star</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" integrity="sha512-5A8nwdMOWrSz20fDsjczgUidUBR8liPYU+WymTZP1lmY9G6Oc7HlZv156XqnsgNUzTyMefFTcsFH/tnJE/+xBg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<h2>5 Star Skills Rating Bar</h2>
<div class="skills">
<h3 class="name"> Html</h3>
<div class="rating">
<input type="radio" name="html">
<input type="radio" name="html">
<input type="radio" name="html">
<input type="radio" name="html">
<input type="radio" name="html">
<input type="radio" name="html">
<input type="radio" name="html">
<input type="radio" name="html">
<input type="radio" name="html">
<input type="radio" name="html">
</div>
</div>
<div class="skills">
<h3 class="name"> CSS</h3>
<div class="rating">
<input type="radio" name="CSS">
<input type="radio" name="CSS">
<input type="radio" name="CSS">
<input type="radio" name="CSS">
<input type="radio" name="CSS">
<input type="radio" name="CSS">
<input type="radio" name="CSS">
<input type="radio" name="CSS">
<input type="radio" name="CSS">
<input type="radio" name="CSS">
</div>
</div>
<div class="skills">
<h3 class="name"> Javascript</h3>
<div class="rating">
<input type="radio" name="Javascript">
<input type="radio" name="Javascript">
<input type="radio" name="Javascript">
<input type="radio" name="Javascript">
<input type="radio" name="Javascript">
<input type="radio" name="Javascript">
<input type="radio" name="Javascript">
<input type="radio" name="Javascript">
<input type="radio" name="Javascript">
<input type="radio" name="Javascript">
</div>
</div>
<div class="skills">
<h3 class="name"> Photoshop</h3>
<div class="rating">
<input type="radio" name="Photoshop">
<input type="radio" name="Photoshop">
<input type="radio" name="Photoshop">
<input type="radio" name="Photoshop">
<input type="radio" name="Photoshop">
<input type="radio" name="Photoshop">
<input type="radio" name="Photoshop">
<input type="radio" name="Photoshop">
<input type="radio" name="Photoshop">
<input type="radio" name="Photoshop">
</div>
</div>
<!-- <p style="color:white">Fournir un commentaire:</p>
<textarea name="message" id="" cols="30" rows="10"></textarea> -->
</div>
</div>
</body>
</html>
```
here the css:
#import url('https://fonts.googleapis.com/css?family=Poppins:200,300,400,500,600,700,800,900&display=swap');
*
{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
body
{
display:flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #0a2b3c;
}
.container
{
position: relative;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
padding: 30px;
border-radius: 10px;
box-shadow: -1px -1px 2px rgba(255, 255, 255,0.25),
inset 2px 2px 2px rgba(255, 255, 255,0.25),
8px 30px 30px rgba(0, 0, 0, 0.4),
inset -2px -2px 5px rgba(0, 0, 0, 0.3);
}
.container h2
{
margin-bottom: 10px;
font-weight: 500px;
color: #1f9cff;
}
.container .skills
{
display: flex;
justify-content: center;
align-items: center;
margin: 10px 0;
padding-right: 10px;
box-shadow: -1px -1px 2px rgba(255, 255, 255,0.25),
inset 2px 2px 2px rgba(255, 255, 255,0.25),
8px 30px 30px rgba(0, 0, 0, 0.4),
inset -2px -2px 5px rgba(0, 0, 0, 0.3);
transition: 0.5s;
}
.container:hover .skills
{
filter: blur(0px);
opacity: 0.2;
}
.container .skills:hover
{
filter: blur(0px);
opacity: 2;
}
.container .skills h3
{
min-width: 180px;
text-align: right;
padding-right: 20px;
color:#fff;
font-size: 20px;
font-weight: 400px;
letter-spacing: 2px;
}
.container .skills .rating
{
position: relative;
display: flex;
margin: 10px;
flex-direction: row-reverse;
}
.container .skills .rating input
{
position: relative;
width: 20px;
height: 40px;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
-webkit-appearance: none;
appearance: none;
overflow: hidden;
}
.container .skills .rating input::before
{
content: '\f005 ';
position: absolute;
font-family: fontAwesome;
font-size: 34px;
position: absolute;
left: 4px;
color:#030b0f;
transition: 0.5s;
}
.container .skills .rating input:nth-child(2n + 1)::before
{
right: 4px;
left: initial;
}
.container .skills .rating input:hover ∼ input::before,
.container .skills .rating input:hover::before
{
color:#1f9cff;
}
here the result:
I tried like 3x the same video

How to make my slider responsive

I have a problem and this isn't really my area and am not able to find a good solution, please help me. I want to make my slider on my website responsive. Do you have any idea how I should do it?
The slider needs to be smaller or be shaped differently when I make the window smaller. Can I use the #media rule or is it something else I should do?
Thanx for helping a beginner like me:)!
<ul class="slides">
<input type="radio" name="radio-btn" id="img-1" checked />
<li class="slide-container">
<div class="slide">
<img src="bilder/blommor.jpg" />
</div>
<div class="nav">
<label for="img-6" class="prev">‹</label>
<label for="img-2" class="next">›</label>
</div>
</li>
<input type="radio" name="radio-btn" id="img-2" />
<li class="slide-container">
<div class="slide">
<img src="bilder/Berg.jpg" />
</div>
<div class="nav">
<label for="img-1" class="prev">‹</label>
<label for="img-3" class="next">›</label>
</div>
</li>
<input type="radio" name="radio-btn" id="img-3" />
<li class="slide-container">
<div class="slide">
<img src="bilder/water.jpg" />
</div>
<div class="nav">
<label for="img-2" class="prev">‹</label>
<label for="img-4" class="next">›</label>
</div>
</li>
<input type="radio" name="radio-btn" id="img-4" />
<li class="slide-container">
<div class="slide">
<img src="bilder/ros.jpg" />
</div>
<div class="nav">
<label for="img-3" class="prev">‹</label>
<label for="img-5" class="next">›</label>
</div>
</li>
<input type="radio" name="radio-btn" id="img-5" />
<li class="slide-container">
<div class="slide">
<img src="bilder/glasogon.jpg" />
</div>
<div class="nav">
<label for="img-4" class="prev">‹</label>
<label for="img-6" class="next">›</label>
</div>
</li>
<li class="nav-dots">
<label for="img-1" class="nav-dot" id="img-dot-1"></label>
<label for="img-2" class="nav-dot" id="img-dot-2"></label>
<label for="img-3" class="nav-dot" id="img-dot-3"></label>
<label for="img-4" class="nav-dot" id="img-dot-4"></label>
<label for="img-5" class="nav-dot" id="img-dot-5"></label>
</li>
Css:
#import url(https://fonts.googleapis.com/css?family=Varela+Round);
html, body { background: #333 url("https://codepen.io/images/classy_fabric.png"); }
.slides {
padding: 0;
width: 609px;
height: 420px;
display: block;
margin: 0 auto;
position: relative;
}
.slides * {
user-select: none;
-ms-user-select: none;
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-webkit-touch-callout: none;
}
.slides input { display: none; }
.slide-container { display: block; }
.slide {
top: 0;
opacity: 0;
width: 609px;
height: 420px;
display: block;
position: absolute;
transform: scale(0);
transition: all .7s ease-in-out;
}
.slide img {
width: 100%;
height: 100%;
}
.nav label {
width: 200px;
height: 100%;
display: none;
position: absolute;
opacity: 0;
z-index: 9;
cursor: pointer;
transition: opacity .2s;
color: #FFF;
font-size: 156pt;
text-align: center;
line-height: 380px;
font-family: "Varela Round", sans-serif;
background-color: rgba(255, 255, 255, .3);
text-shadow: 0px 0px 15px rgb(119, 119, 119);
}
.slide:hover + .nav label { opacity: 0.5; }
.nav label:hover { opacity: 1; }
.nav .next { right: 0; }
input:checked + .slide-container .slide {
opacity: 1;
transform: scale(1);
transition: opacity 1s ease-in-out;
}
input:checked + .slide-container .nav label { display: block; }
.nav-dots {
width: 100%;
bottom: 9px;
height: 11px;
display: block;
position: absolute;
text-align: center;
}
.nav-dots .nav-dot {
top: -5px;
width: 11px;
height: 11px;
margin: 0 4px;
position: relative;
border-radius: 100%;
display: inline-block;
background-color: rgba(0, 0, 0, 0.6);
}
.nav-dots .nav-dot:hover {
cursor: pointer;
background-color: rgba(0, 0, 0, 0.8);
}
input#img-1:checked ~ .nav-dots label#img-dot-1,
input#img-2:checked ~ .nav-dots label#img-dot-2,
input#img-3:checked ~ .nav-dots label#img-dot-3,
input#img-4:checked ~ .nav-dots label#img-dot-4,
input#img-5:checked ~ .nav-dots label#img-dot-5,
input#img-6:checked ~ .nav-dots label#img-dot-6 {
background: rgba(0, 0, 0, 0.8);
}

pseudo class preceded by an element

I'm trying to customize the radio and checkboxes using only css. I'm almost there except 2 little details:
here is a markup sample:
<section>
<label class="cbox radio">
<input name="how" type="radio" checked="checked" /> My first radio box
</label>
<label class="cbox radio">
<input name="how" type="radio" /> My second radio box
</label>
<label class="cbox radio">
<input name="how" type="radio" /> My third radio box
</label>
</section>
<section>
<label class="cbox box">
<input name="check1" type="checkbox" checked="checked" /> My first box
</label>
<label class="cbox box">
<input name="check2" type="checkbox" /> My second box
</label>
</section>
Every thing works fine but i can't make it work when the box is checked. I'm trying to use this pseudo class:
*::before, *::after {
box-sizing: border-box;
}
.cbox {
display: block;
position: relative;
margin: 10px 0;
padding-left: 35px;
cursor: pointer;
}
.cbox > input {
position: absolute;
left: -9999px;
}
.cbox::before, .cbox::after {
content: '';
position: absolute;
top: 0;
left: 0;
}
.cbox.radio::before, .cbox.radio::after {
border-radius: 50%;
}
.cbox::before {
display: block;
width: 20px;
height: 20px;
border: 1px solid #c1caca;
}
.cbox::after {
display: none;
width: 12px;
height: 12px;
margin: 4px;
background-color: #2e4a5d;
box-shadow: inset 0 15px 23px -10px rgba(187,230,240,.3),0 2px 2px rgba(0,0,0,.1);
}
/*input:checked + .cbox::before, input:hover + .cbox::before, */
.cbox.on::before, .cbox:hover::before {
background-color: #eaf1f6;
border-color: #a0afbb;
}
/* input:checked + .cbox::after, */
.cbox.on::after {
display: block;
}
And here the jquery
$(".cbox input").change(function() {
if($(this).is(':checked')) $(this).parent('label').toggleClass('on');
});
1- is there a way to make this css work?
2- since the selector :checked is only supported on IE9+, is it recommended to use selectivizr ? or is there a better fallback solution?
Thanks a lot
Just ditch the ::after pseudo class:
.cbox.radio input:checked { display: none; }
<label class="cbox radio">
<input name="how" type="radio" checked="checked" /> My first box
<input name="how2" type="radio" /> My first box
</label>
Fiddle: https://jsfiddle.net/84x66oux/
Btw, you won't be able to customize radios/checkboxes without hiding them in the first place, and adding the whole style yourself. Check this codepen for example
You can try this one
<style>
/*****************************************
RADIO BUTTONS
******************************************/
input[type="radio"] {
display: none;
}
input[type="radio"] + span {
background-color: #fefefe;
border: 1px solid;
border-color: #ccc #fff #fff #ccc;
border-radius: 50px;
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
display: inline-block;
float: left;
margin-right: 7px;
padding: 7px;
position: relative;
-webkit-appearance: none;
}
input[type="radio"]:checked + span {
color: #f00;
}
input[type="radio"]:checked + span:after {
background: #f00;
border-radius: 50px;
box-shadow: inset 1px 1px 1px rgba(255, 255, 255, 0.75), inset -1px -1px 1px rgba(0, 0, 0, 0.75);
content: " ";
height: 10px;
left: 2px;
position: absolute;
top: 2px;
width: 10px;
}
label:hover input[type="radio"] + span {
border-color: #900 #f00 #f00 #900;
}
</style>
<label>
<input type="radio" name="radio" value="1" checked> <span></span> Option first
</label>
$(".radio input").click(function() {
if ($(this).is(':checked')) {
$(".radio ").removeClass('on')
$(this).parent('label').addClass('on');
}
});
$(".box input").click(function() {
if ($(this).is(':checked')) {
$(this).parent('label').addClass('on');
} else {
$(this).parent('label').removeClass('on');
}
});
*::before,
*::after {
box-sizing: border-box;
}
.cbox {
display: block;
position: relative;
margin: 10px 0;
padding-left: 35px;
cursor: pointer;
}
.cbox > input {
position: absolute;
left: -9999px;
}
.cbox::before,
.cbox::after {
content: '';
position: absolute;
top: 0;
left: 0;
}
.cbox.radio::before,
.cbox.radio::after {
border-radius: 50%;
}
.cbox::before {
display: block;
width: 20px;
height: 20px;
border: 1px solid #c1caca;
}
.cbox::after {
display: none;
width: 12px;
height: 12px;
margin: 4px;
background-color: #2e4a5d;
box-shadow: inset 0 15px 23px -10px rgba(187, 230, 240, .3), 0 2px 2px rgba(0, 0, 0, .1);
}
/*input:checked + .cbox::before, input:hover + .cbox::before, */
.cbox.on::before,
.cbox:hover::before {
background-color: #eaf1f6;
border-color: #a0afbb;
}
/* input:checked + .cbox::after, */
.cbox.on::after {
display: block;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<section>
<label class="cbox radio">
<input name="how" type="radio" /> My first radio box
</label>
<label class="cbox radio">
<input name="how" type="radio" /> My second radio box
</label>
<label class="cbox radio">
<input name="how" type="radio" /> My third radio box
</label>
</section>
<section>
<label class="cbox box">
<input name="check1" type="checkbox" /> My first box
</label>
<label class="cbox box">
<input name="check2" type="checkbox" /> My second box
</label>
</section>

Need bootstrap input field background image to be "full bleed", no border

I have this form:
It doesn't matter how large I make the images, or how much I fiddle with the size of the fields, the white border is there, always. How do I make it so the white border is not around the top, left, and bottom of the blue icon on the left side of each input field.
Here is the HTML:
<form role="form" class="">
<fieldset class="">
<div class="form-group">
<input type="email" class="form-control no-shadow margin-bottom20 email-field form-group" id="InputEmail" placeholder="email" required="" style="border-radius:0px;">
<input type="password" class="form-control no-shadow password-field" id="InputPassword" placeholder="password" required="" style="border-radius:0px;">
<button type="submit" class="btn margin-top45 btn-lg bg-transparent bg-transparent-hover no-shadow text-center" data-toggle="tooltip" style="border : solid 3px #99cc33;color:#ffffff;">Log In</button>
</div>
</fieldset>
</form>
Here is the CSS:
.email-field
{
background-image: url('../images/email-input-icon.png');
background-repeat: no-repeat;
background-position: null;
background-clip: border-box;
}
.password-field
{
background-image: url('../images/password-input-icon.png');
}
.margin-bottom20
{
margin-bottom: 20px !important;
}
.form-control
{
color: #34495e;
font-size: 16px;
line-height: 1.467;
padding: 8px 12px 8px 66px;
height: 54px;
-webkit-appearance: none;
-webkit-box-shadow: none;
box-shadow: none;
-webkit-transition: border .25s linear, color .25s linear, background-color .25s linear;
transition: border .25s linear, color .25s linear, background-color .25s linear;
background-repeat: no-repeat;
}
.form-group
{
position: relative;
margin-bottom: 20px;
}
.form-group.focus .form-control, .form-control:focus
{
border-color: #1abc9c;
outline: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
.form-control, .form-control:focus {
border-color:Transparent;
}

Fixed div modal not scrolling with page

I have a html/css modal on my page which is hosted here:
http://yousolutions.co.za/#openModalViewCreateClient
However, I need to be able to use the main scroller on the page to scroll down and view the rest of this form. My current CSS doesn't allow for this, and I don't want to add another scroll bar within the div. My code looks like this:
HTML:
<div id="openModalViewCreateClient" class="modalDialog">
<div>
X
<h2>Add A Client</h2>
<form class="contact_form" action="#" method="post" name="contact_form">
<ul>
<li>
<h2>Add New Client</h2>
</li>
<li>
<label for="name">First Name:</label>
<input type="text" placeholder="John" required />
</li>
<li>
<label for="name">Last Name:</label>
<input type="text" placeholder="Doe" required />
</li>
<li>
<label for="email">Email:</label>
<input type="email" name="email" placeholder="john_doe#example.com" required />
<span class="form_hint">Proper format "name#something.com"</span>
</li>
<li>
<label for="website">Website:</label>
<input type="url" name="website" placeholder="http://johndoe.com" required pattern="(http|https)://.+"/>
<span class="form_hint">Proper format "http://someaddress.com"</span>
</li>
<li>
<label for="message">Message:</label>
<textarea name="message" cols="40" rows="6" required ></textarea>
</li>
<li>
<button class="submit" type="submit">Submit Form</button>
</li>
</ul>
</form>
</div>
</div>
CSS:
.modalDialog:target {
opacity:1;
pointer-events: auto;
}
.modalDialog {
position: fixed;
font-family: Arial, Helvetica, sans-serif;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0,0,0,0.8);
z-index: 99999;
opacity:0;
-webkit-transition: opacity 400ms ease-in;
-moz-transition: opacity 400ms ease-in;
transition: opacity 400ms ease-in;
pointer-events: none;
}
.modalDialog > div {
width: 630px;
position: relative;
margin: 10% auto;
padding: 5px 20px 13px 20px;
border-radius: 10px;
background: #fff;
background: -moz-linear-gradient(#fff, #999);
background: -webkit-linear-gradient(#fff, #999);
background: -o-linear-gradient(#fff, #999);
}
.close {
background: #606061;
color: #FFFFFF;
line-height: 25px;
position: absolute;
right: -12px;
text-align: center;
top: -10px;
width: 24px;
text-decoration: none;
font-weight: bold;
-webkit-border-radius: 12px;
-moz-border-radius: 12px;
border-radius: 12px;
-moz-box-shadow: 1px 1px 3px #000;
-webkit-box-shadow: 1px 1px 3px #000;
box-shadow: 1px 1px 3px #000;
}
.close:hover { background: #00d9ff; }
You are using
position: fixed;
on .modalDialog, the viewport scrolling does not have any effect in this case on the modal
Try with absolute positioning -
position: absolute;

Resources