I want that when a user comes and tries to type text in "input" the label goes up, and if they leave that area blank it comes back to the original position. If user typed something over there it will stay up there.
I tried this code with input box with required it is working fine, but when I try to do this with input and add some content in input the label coming back down it need to be stay up there.
div{
margin-top:40px;
}
.btn-add input[type="text"]{
width: 90%;
padding: 10px 20px 0 20px;
border: none;
border-bottom:1px solid #999;
font-size: 140%;
color: #000;
}
.btn-add input:focus ~ .floating-label{
top: -20px;
bottom: 10px;
left: 10px;
font-size: 20px;
opacity: 1;
color: rgb(100, 6, 6);
}
.floating-label {
position: absolute;
pointer-events: none;
left: 20px;
top:10px;
transition: 0.2s ease all;
color: #999999;
font-size: 120%;
}
.form-float{
position: relative;
}
<div class="form-float btn-add">
<input type="text" class="inputText" placeholder="" >
<label class="floating-label" >Button text</label>
</div>
I remove input:not(:focus):valid~.floating-label so it can work with not required field
Try this code since because of placeholder happening.
.form-group {
position: relative;
margin-bottom: 1.5rem;
}
input + .form-control-placeholder {
position: absolute;
transition: all 200ms;
top: -20px;
bottom: 10px;
font-size: 20px;
opacity: 1;
color: rgb(100, 6, 6);
}
input:placeholder-shown + .form-control-placeholder {
position: absolute;
pointer-events: none;
left: 20px;
top:10px;
transition: 0.2s ease all;
color: #999999;
font-size: 120%;
}
.form-control:focus + .form-control-placeholder {
position: absolute;
transition: all 200ms;
top: -20px;
bottom: 10px;
font-size: 20px;
opacity: 1;
color: rgb(100, 6, 6);
}
input[type="text"]{
width: 90%;
padding: 10px 20px 0 20px;
border: none;
border-bottom:1px solid #999;
font-size: 140%;
color: #000;
}
label{
position: absolute;
pointer-events: none;
left: 20px;
top:10px;
transition: 0.2s ease all;
color: #999999;
font-size: 120%;
}
<br>
<br>
<div class="form-group">
<input type="text" class="form-control" placeholder=" " >
<label class="form-control-placeholder">Button text</label>
</div>
Add Space to you placeholder by default and after that use input:not(:placeholder-shown) property to check if input is empty or not. Here working example of your code
div{
margin-top:40px;
}
.btn-add input[type="text"]{
width: 90%;
padding: 10px 20px 0 20px;
border: none;
border-bottom:1px solid #999;
font-size: 140%;
color: #000;
}
.btn-add input:focus ~ .floating-label{
top: -20px;
bottom: 10px;
left: 10px;
font-size: 20px;
opacity: 1;
color: rgb(100, 6, 6);
}
.btn-add input:not(:placeholder-shown) ~ .floating-label{
top: -20px;
bottom: 10px;
left: 10px;
font-size: 20px;
opacity: 1;
color: rgb(100, 6, 6);
}
.floating-label {
position: absolute;
pointer-events: none;
left: 20px;
top:10px;
transition: 0.2s ease all;
color: #999999;
font-size: 120%;
}
.form-float{
position: relative;
}
<div class="form-float btn-add">
<input type="text" class="inputText" placeholder=" " >
<label class="floating-label" >Button text</label>
</div>
Since :placeholder-shown only works with placeholder text shown (no empty string) you could use visibility.
div {
margin-top:40px;
}
.btn-add input[type="text"] {
width: 90%;
padding: 10px 20px 0 20px;
border: none;
border-bottom:1px solid #999;
font-size: 140%;
color: #000;
}
.floating-label {
position: absolute;
pointer-events: none;
left: 20px;
top: -20px;
transition: 0.2s ease all;
color: #999999;
font-size: 120%;
}
.form-float input:placeholder-shown ~ label {
top: 0;
visibility: hidden;
}
.form-float {
position: relative;
}
<div class="form-float btn-add">
<input type="text" placeholder="Button Label" >
<label class="floating-label">Button Label</label>
</div>
These are two solutions. I think they need some adjustment because probably they are not correct.
Solution #1: Floating label on focus
.custom-form-input {
display: block;
width: 100%;
height:32px;
padding: 1rem .55rem .065rem .55rem;
font-weight: 400;
border: 1px solid #cad3d6;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
background-color: #fafafa;
font-size: 0.79em;
color:#000000;
border-radius: 2px;
font-family: Arial, Helvetica, sans-serif;
}
.custom-form-input:focus,
.custom-form-input:active {
color: #212529;
background-color: #fff;
border-color: #585d61;
outline: 0;
}
.custom-form-floating {
position:relative;
}
.custom-form-floating-label {
position:absolute;
color: #9aa0a9;
font-size: 0.85em;
height:100%;
width:100%;
top: 0px;
display:flex;
align-items: center;
padding: 0 .55rem 0 .55rem;
transition: 0.2s ease all;
-moz-transition: 0.2s ease all;
-webkit-transition: 0.2s ease all;
user-select: none;
pointer-events: none
}
.custom-form-input:focus ~ label,
.custom-form-input:valid ~ label {
font-size: 0.65rem;
height:55%;
}
.wrapper {
width:150px;
}
<div class="custom-form-floating">
<input id="test" class="custom-form-input" aria-label="usuario o correo electrónico" required=true aria-required="true"/>
<label for="test" class="custom-form-floating-label">Example 1</label>
</div>
<div class="wrapper">
<div class="custom-form-floating">
<input id="test" class="custom-form-input" aria-label="usuario o correo electrónico" required=true aria-required="true"/>
<label for="test" class="custom-form-floating-label">Example 2</label>
</div>
</div>
Solution #2: Floating label when type a letter
.custom-form-input {
display: block;
width: 100%;
height: 5px;
font-weight: 400;
border: 1px solid #cad3d6;
transition: border-color .15s ease-in-out;
background-color: #fafafa;
font-size: 1.2em;
color: #000000;
padding: 1rem .50rem 1rem .50rem;
border-radius: 2px;
font-family: Arial, Helvetica, sans-serif;
}
.custom-form-input:focus,
.custom-form-input:active {
color: #212529;
background-color: #fff;
border-color: #585d61;
outline: 0;
}
.custom-form-floating {
position: relative;
}
.custom-form-floating-label {
position: absolute;
color: #9aa0a9;
font-size: 0.85em;
height: 100%;
width: 100%;
top: 0px;
display: flex;
align-items: center;
padding: 0 .55rem 0 .55rem;
transition: 0.2s ease all;
-moz-transition: 0.2s ease all;
-webkit-transition: 0.2s ease all;
user-select: none;
pointer-events: none
}
.custom-form-input:valid {
padding: 1.50rem .50rem .50rem .50rem;
font-size: 0.79em;
}
.custom-form-input:valid~label {
font-size: 0.65rem;
height: 55%;
}
.wrapper {
width:250px;
}
<div class="wrapper">
<div class="custom-form-floating">
<input id="test" class="custom-form-input"
aria-label="usuario o correo electrónico" required=true aria-required="true"/>
<label for="test" class="custom-form-floating-label">Correo electrónico o
usuario</label>
</div>
</div>
Related
I am designing an app in Unqork. The issue I have is how to shape the radio button to look like the regular Learn More button. I only intend to style the radio button instead of making it into a multiple choice.
The style of the regular button is
.abc-quote-option-cta {
bottom: 38px;
left: 0;
right: 0;
padding-top: 24px;
position: absolute; }
.abc-quote-option-cta:before {
background-color: #979797;
content: '';
display: block;
height: 1px;
left: 62px;
opacity: .36;
position: absolute;
right: 56px;
top: 0;
}
.abc-quote-option-cta .btn.btn-primary {
border-radius: 6px;
border: solid 2px #01a7e1;
background-color: #FFFFFF;
border-radius: 6px;
color: #01a7e1;
display: block;
font-size: 1.8rem;
line-height: 1.44;
margin: 0 auto;
padding: 10px;
text-align: center;
transition: background-color .25s ease, width .13s ease-in, color .18s ease-out ;
width: 188px;
}
.abc-quote-option-cta .btn.btn-primary:hover,
.abc-quote-option-cta .btn.btn-primary:focus {
background-color: #0099cc;
color: #FFFFFF;
width: 251px;
}
Your help is very much appreciated. Thanks!
I hope this snippet will help you.
form {
max-width: 250px;
position: relative;
margin: 50px auto 0;
font-size: 15px;
}
.radiobtn {
position: relative;
display: block;
}
.radiobtn label {
display: block;
background: rgba(0, 0, 0, 0.2);
color: #000;
border-radius: 5px;
padding: 10px 20px;
border: 2px solid grey;
margin-bottom: 5px;
cursor: pointer;
}
.radiobtn label:after, .radiobtn label:before {
content: "";
position: absolute;
right: 11px;
top: 11px;
width: 20px;
height: 20px;
border-radius: 3px;
background:grey;
}
.radiobtn label:before {
background: transparent;
transition: 0.1s width cubic-bezier(0.075, 0.82, 0.165, 1) 0s, 0.3s height cubic-bezier(0.075, 0.82, 0.165, 2) 0.1s;
z-index: 2;
overflow: hidden;
background-repeat: no-repeat;
background-size: 13px;
background-position: center;
width: 0;
height: 0;
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNS4zIDEzLjIiPiAgPHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE0LjcuOGwtLjQtLjRhMS43IDEuNyAwIDAgMC0yLjMuMUw1LjIgOC4yIDMgNi40YTEuNyAxLjcgMCAwIDAtMi4zLjFMLjQgN2ExLjcgMS43IDAgMCAwIC4xIDIuM2wzLjggMy41YTEuNyAxLjcgMCAwIDAgMi40LS4xTDE1IDMuMWExLjcgMS43IDAgMCAwLS4yLTIuM3oiIGRhdGEtbmFtZT0iUGZhZCA0Ii8+PC9zdmc+);
}
input[type="radio"] {
display: none;
position: absolute;
width: 100%;
appearance: none;
}
input[type="radio"]:checked + label {
background:grey;
animation-name: blink;
animation-duration: 1s;
border-color: $accentcolor;
}
input[type="radio"]:checked + label:after {
background: $accentcolor;
}
input[type="radio"]:checked + label:before {
width: 20px;
height: 20px;
}
<form>
<div class="radiobtn">
<input type="radio" id="huey"
name="drone" value="huey" checked />
<label for="huey">Learn More</label>
</div>
<div class="radiobtn">
<input type="radio" id="dewey"
name="drone" value="dewey" />
<label for="dewey">Learn More</label>
</div>
</form>
Custom radio button without check mark.
form {
max-width: 200px;
position: relative;
margin: 50px auto 0;
font-size: 15px;
}
.radiobtn {
position: relative;
display: block;
text-align:center;
}
.radiobtn label {
display: block;
background:none;
color:#01a7e1;
border-radius: 5px;
padding: 10px 20px;
border: 2px solid #01a7e1;
margin-bottom: 5px;
cursor: pointer;
font-family:Arial, Helvetica, sans-serif;
}
input[type="radio"] {
display: none;
position: absolute;
width: 100%;
appearance: none;
}
input[type="radio"]:checked + label {
background:#01a7e1;
color:#fff;
}
<form>
<div class="radiobtn">
<input type="radio" id="huey"
name="drone" value="huey" checked />
<label for="huey">Learn More</label>
</div>
<div class="radiobtn">
<input type="radio" id="dewey"
name="drone" value="dewey" />
<label for="dewey">Learn More</label>
</div>
</form>
I hope this will help you.
form {
max-width: 250px;
position: relative;
margin: 50px auto 0;
font-size: 15px;
}
.radiobtn {
position: relative;
display: block;
}
.radiobtn label {
display: block;
background: rgba(0, 0, 0, 0.2);
color: #000;
border-radius: 5px;
padding: 10px 20px;
border: 2px solid grey;
margin-bottom: 5px;
cursor: pointer;
}
.radiobtn label:after,
.radiobtn label:before {
content: "";
position: absolute;
right: 11px;
top: 11px;
width: 20px;
height: 20px;
border-radius: 3px;
background: grey;
}
.radiobtn label:before {
background: transparent;
transition: 0.1s width cubic-bezier(0.075, 0.82, 0.165, 1) 0s, 0.3s height cubic-bezier(0.075, 0.82, 0.165, 2) 0.1s;
z-index: 2;
overflow: hidden;
background-repeat: no-repeat;
background-size: 13px;
background-position: center;
width: 0;
height: 0;
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNS4zIDEzLjIiPiAgPHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE0LjcuOGwtLjQtLjRhMS43IDEuNyAwIDAgMC0yLjMuMUw1LjIgOC4yIDMgNi40YTEuNyAxLjcgMCAwIDAtMi4zLjFMLjQgN2ExLjcgMS43IDAgMCAwIC4xIDIuM2wzLjggMy41YTEuNyAxLjcgMCAwIDAgMi40LS4xTDE1IDMuMWExLjcgMS43IDAgMCAwLS4yLTIuM3oiIGRhdGEtbmFtZT0iUGZhZCA0Ii8+PC9zdmc+);
}
input[type="radio"] {
display: none;
position: absolute;
width: 100%;
appearance: none;
}
input[type="radio"]:checked+label {
background: grey;
animation-name: blink;
animation-duration: 1s;
border-color: $accentcolor;
}
input[type="radio"]:checked+label:after {
background: $accentcolor;
}
input[type="radio"]:checked+label:before {
width: 20px;
height: 20px;
}
<form>
<div class="radiobtn">
<input type="radio" id="huey" name="drone" value="huey" checked />
<label for="huey">Learn More</label>
</div>
<div class="radiobtn">
<input type="radio" id="dewey" name="drone" value="dewey" />
<label for="dewey">Learn More</label>
</div>
</form>
I want to convert the label into floating style for textboxes in my form. I have performed the action on Hover and focus of the input box. The problem here is when the label floats and moves up the text is getting hidden.
Here is my HTML and CSS that i have tried so far.
.float-label {
position: absolute;
left: 0;
top: 0;
padding: 10px 6px;
color: #767676;
pointer-events: none;
transition: 0.2s ease all;
}
.form-control:focus ~ .float-label,
.form-control:not(:focus):valid ~ .float-label {
top: -18px;
margin-left:5px;
font-size: 12px;
opacity: 1;
z-index: 1;
background-color: white;
}
<div class="form-group border-lable-flt">
<input type="email" class="form-control" id="work_email" required>
<label class="float-label" for="workEmail">Work email</label>
</div>
You can use :placeholder-shown pseudo-class. If you don't want to make color: transparent the placeholder text, you can perfect-pixel match the styles for label and placeholder.
.form-group {
position: relative;
padding: 20px;
}
.float-label {
position: absolute;
left: 25px;
top: 21px;
color: #767676;
pointer-events: none;
transition: 0.2s ease all;
}
input::placeholder {
color: transparent;
}
.form-control:focus ~ .float-label,
.form-control:not(:focus):valid ~ .float-label,
input:not(:placeholder-shown) ~ .float-label {
top: 5px;
font-size: 12px;
opacity: 1;
z-index: 1;
background-color: transparent;
}
<div class="form-group border-lable-flt">
<input type="email" class="form-control" id="work_email" required placeholder="Work email">
<label class="float-label" for="workEmail">Work email</label>
</div>
Try to do the following changes :
.form-group{
margin-top:20px;
position:relative;
}
.float-label {
position: absolute;
left: 0;
top: 0;
padding:0;
color: #767676;
pointer-events: none;
transition: 0.2s ease all;
}
use this code:
Html:
<div class="form-group border-lable-flt textinput">
<input type="email" id="email" class="form-control" />
<label for="email">Email address</label>
</div>
CSS:
.textinput {
height: 3em;
margin: 1em 0;
position: relative;
width: 100%;
}
.textinput input,
.textinput label {
cursor: text;
font-size: 1.5em;
padding: 0.6em 1% 0.15em 1%;
position: absolute;
transition: all 0.15s ease;
width: 98%;
}
.textinput input {
border: solid black 1px;
border-radius: 0.15em;
}
.textinput label {
color: #BCB9B8;
padding: 0.5em 1%;
}
.textinput input.filled ~ label,
.textinput input:focus ~ label {
font-size: 0.6em;
font-weight: 600;
position: absolute;
}
.textinput input.filled ~ label {
color: #007932;
}
.textinput input[type="text"].filled,
.textinput input[type="email"].filled:valid {
background: #B8DB9B;
}
.textinput input[type="text"].filled ~label:after,
.textinput input[type="email"].filled:valid ~label:after {
color: #007932;
content: "\f058";
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: 3em;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
position: absolute;
top: 0.3em;
right: 0.3em;
transform: translate(0, 0);
}
I am trying to mimic the hover transitions for buttons as found on this page.
I have the following so far:
.hs-button {
font-size: 16px;
font-family: "Raleway", sans-serif;
text-transform: uppercase;
line-height: 1em;
color: #333333;
letter-spacing: 0;
background: #fff336;
display: inline-block;
position: relative;
cursor: pointer;
-webkit-transition: 0.3s;
transition: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
input[type="submit"]:hover {
text-decoration: none;
transform: translateY(0px);
-webkit-transform: translateY(0px);
}
input[type="submit"]:hover {
border: 3px solid #000;
background-color: #000;
color: #fff336;
}
input[type="submit"]:hover:after {
height: 100%;
}
input[type="submit"]:after {
content: "";
background: #000;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 0;
z-index: -1;
-webkit-transition: 0.3s;
transition: 0.3s;
}
<div class="hs_submit">
<div class="actions">
<input type="submit" value="DOWNLOAD NOW!" class="hs-button primary large">
</div>
</div>
The above button is the only button on my page and with the following above code, I'd expect it the black background to hover from bottom to top, but it's not - why?
Edit:
[Preview link to page][2]
You don't have to use pseudo-element with input tag (Can I use a :before or :after pseudo-element on an input field?). Consider adding pseudo element on a container. Also remove the background of your input. It need to be transparent so you can see the effect of pseudo-element behind.
Here is an example:
.actions {
display:inline-block;
position:relative;
}
.hs-button {
font-size: 16px;
font-family: "Raleway", sans-serif;
text-transform: uppercase;
line-height: 1em;
color: #333333;
letter-spacing: 0;
padding:20px;
border:none;
display: inline-block;
position: relative;
cursor: pointer;
z-index:1;
}
.actions:hover input[type="submit"] {
color: #fff336;
background:transparent;
}
.actions:before {
content: "";
background: #000;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 0;
z-index:0;
-webkit-transition: 0.3s;
transition: 0.3s;
}
.actions:hover::before {
height:100%;
}
<div class="hs_submit">
<div class="actions">
<input type="submit" value="DOWNLOAD NOW!" class="hs-button primary large">
</div>
</div>
input not support ::before ::after you can use
<Button>
than add ::before ::after .
LIke https://jsfiddle.net/ufL55gfw/1/
Try below
.slider-button {
margin-top: 70px;
}
#media (max-width: 1220px) {
.slider-button {
margin-top: 30px;
}
}
.slider-button .button {
text-align: left;
}
#media (max-width: 1220px) {
.slider-button .button {
text-align: center;
}
}
.slider-button .button {
text-align: left;
}
.button {
text-align: center;
}
.button a{text-decoration:none;}
.button__item {
font-family: "Raleway", sans-serif;
font-weight: 500;
text-transform: uppercase;
font-size: 1.313rem;
line-height: 1em;
color: #333333;
letter-spacing: 0;
background: #fff336;
padding: 32.5px 65px;
display: inline-block;
position: relative;
cursor: pointer;
-webkit-transition: 0.3s;
transition: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.button__item:hover {
text-decoration: none;
-webkit-transform: translateY(0px);
transform: translateY(0px);
}
.button__item:hover:after {
height: 100%;
}
.button__item:after {
content: "";
background: #fff;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 0;
z-index: -1;
-webkit-transition: 0.3s;
transition: 0.3s;
}
<div class="slider-button"><div class="button">DOWNLOAD NOW</div></div>
I am trying to make an on/off switch, but it works incorrectly. I have a few rows with the switch. It's auto generated so that when I click every row except the first it switches 1 row.
Here is the html:
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch" checked>
<label class="onoffswitch-label" for="myonoffswitch">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
and css:
.onoffswitch {
position: relative;
width: 88px;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select: none;
}
.onoffswitch-checkbox {
display: none;
}
.onoffswitch-label {
display: block;
overflow: hidden;
cursor: pointer;
border: 1px solid #D6D6D6;
border-radius: 5px;
}
.onoffswitch .onoffswitch-inner {
display: block;
width: 200%;
margin-left: -100%;
transition: margin 0.3s ease-in 0s;
}
.onoffswitch .onoffswitch-inner:before, .onoffswitch-inner:after {
display: block;
float: left;
width: 50%;
height: 33px;
padding: 0;
line-height: 33px;
color: white;
font-family: Trebuchet, Arial, sans-serif;
font-weight: bold;
box-sizing: border-box;
}
.onoffswitch-label .onoffswitch-inner:before {
content: "Yes";
padding-left: 10px;
background-color: blue; color: #FFFFFF;
}
.onoffswitch-label .onoffswitch-inner:after {
content: "No";
padding-right: 10px;
background-color: #ccc; color: #999999;
text-align: right;
}
.onoffswitch-label .onoffswitch-switch {
display: block;
width: 30px;
margin: 5px 0;
background: #FFFFFF;
position: absolute; top: 0; bottom: 0;
right: 53px;
border: 2px solid #D6D6D6; border-radius: 5px;
transition: all 0.3s ease-in 0s;
}
.onoffswitch > .onoffswitch-checkbox:checked + .onoffswitch-label > .onoffswitch-inner {
margin-left: 0;
}
.onoffswitch > .onoffswitch-checkbox:checked + .onoffswitch-label >.onoffswitch-switch {
right: 0px;
}
I try to do it with CSS only, without JS(JQuery, etc...)
Can you tell me what's wrong?
Your code is correct here's an example: https://jsfiddle.net/Lfv76omw/
You should set an unique id and name attribute for the elements
name="onoffswitch" id="myonoffswitch" and for="myonoffswitch" must be unique.
I simply added an incremental number like
name="onoffswitch1" id="myonoffswitch1" and for="myonoffswitch1"
name="onoffswitch2" id="myonoffswitch2" and for="myonoffswitch2"
name="onoffswitch3" id="myonoffswitch3" and for="myonoffswitch3"
I have these codes on my site
HTML-
<ul class="tabs">
<li>
<input type="radio" checked name="tabs" id="tab1">
<label for="tab1">Twitter</label>
<div id="tab-content1" class="tab-content animated fadeIn">
<a class="twitter-timeline" href="https://twitter.com/1THUGRadio" data-widget-id="521855935606583296">Tweets by #1THUGRadio</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab2">
<label for="tab2">Facebook</label>
<div id="tab-content2" class="tab-content animated fadeIn">
<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fthugcommunity&width=650&colorscheme=light&show_faces=true&border_color&stream=true&header=true&height=500" frameborder="0" scrolling="yes" style="background: white; border: currentColor; border-image: none; width: 650px; height: 500px; overflow: visible; float: left;" allowtransparency="true">
</iframe>
</div>
</li>
</ul>
as you can see it has the FB and Twitter feeds in it
CSS
.tabs input[type=radio] {
position: absolute;
top: -9999px;
left: -9999px;
}
.tabs {
width: 650px;
float: none;
list-style: none;
position: relative;
padding: 0;
margin: 75px auto;
}
.tabs li{
float: left;
}
.tabs label {
display: block;
padding: 10px 20px;
border-radius: 2px 2px 0 0;
color: #08C;
font-size: 24px;
font-weight: normal;
font-family: 'Lily Script One', helveti;
background: rgba(255,255,255,0.2);
cursor: pointer;
position: relative;
top: 3px;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.tabs label:hover {
background: rgba(255,255,255,0.5);
top: 0;
}
[id^=tab]:checked + label {
background: #08C;
color: white;
top: 0;
}
[id^=tab]:checked ~ [id^=tab-content] {
display: block;
}
.tab-content{
z-index: auto;
display: none;
text-align: left;
width: 100%;
font-size: 20px;
line-height: 140%;
padding-top: 10px;
background: #08C;
padding: 15px;
color: white;
position: absolute;
top: 53px;
left: 0;
box-sizing: border-box;
-webkit-animation-duration: 0.5s;
-o-animation-duration: 0.5s;
-moz-animation-duration: 0.5s;.tabs input[type=radio] {
position: absolute;
top: -9999px;
left: -9999px;
}
.tabs {
width: 650px;
float: none;
list-style: none;
position: relative;
padding: 0;
margin: 75px auto;
}
.tabs li{
float: left;
}
.tabs label {
display: block;
padding: 10px 20px;
border-radius: 2px 2px 0 0;
color: #08C;
font-size: 24px;
font-weight: normal;
font-family: 'Lily Script One', helveti;
background: rgba(255,255,255,0.2);
cursor: pointer;
position: relative;
top: 3px;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.tabs label:hover {
background: rgba(255,255,255,0.5);
top: 0;
}
[id^=tab]:checked + label {
background: #08C;
color: white;
top: 0;
}
[id^=tab]:checked ~ [id^=tab-content] {
display: block;
}
.tab-content{
z-index: 6;
display: none;
text-align: left;
width: 100%;
font-size: 20px;
line-height: 140%;
padding-top: 10px;
background: #08C;
position: relative;
padding: 15px;
color: white;
top: 53px;
left: 0;
box-sizing: border-box;
-webkit-animation-duration: 0.5s;
-o-animation-duration: 0.5s;
-moz-animation-duration: 0.5s;
animation-duration: 0.5s;
}
animation-duration: 0.5s;
}
When I put the coding in jfiddle.net everything shows up like it should. But when I drop it in the website only the tabs show up, not the content
First off, thanks for the lack of help I got from everyone. So I figured out it needed to have overflow: visible; not hidden.