Menu bar with outside border - css

I want to make this menu bar. I already managed to do the ghost buttons, but how can I make this outline border for the menu:
http://i.stack.imgur.com/wwBVw.jpg
This is my code: https://jsfiddle.net/ivailo/3q6ej7cc/
.button {
position:relative;
display: inline-block;
padding: .5em 1em;
font-size: 18px;
font-family: Arial, 'Arial Unicode MS', Helvetica, Sans-Serif;
border: 1px solid rgba(122, 112, 82, 0.2);
color: #877B5A;
text-align: center;
text-decoration: none;
outline: none ;
overflow: hidden;
border-radius: 7px;
}
.button::after {
position: absolute;
top: 50%;
left: 50%;
z-index: -1;
color #fffff;
display: block;
content: '';
width: 15em;
height: 15em;
border-radius: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
transition: all 0s;
}
.button:hover::after {
box-shadow: inset 0 0 0 10em rgba(242, 189, 99,.2);
}
.button:hover {
color: #000000;
}
.button1 {
position:relative;
display: inline-block;
padding: .5em 1em;
font-size: 18px;
font-family: Arial, 'Arial Unicode MS', Helvetica, Sans-Serif;
border: 1px solid rgba(122, 112, 82, 0.2);
color: #877B5A;
text-align: center;
text-decoration: none;
outline: none ;
overflow: hidden;
border-radius: 7px;
}
.button1::after {
position: absolute;
top: 50%;
left: 50%;
z-index: -1;
display: block;
content: '';
width: 15em;
height: 15em;
transform: translate(-50%, -50%);
transition: all 0s;
}
.button1:hover::after {
box-shadow: inset 0 0 0 10em rgba(242, 189, 99,.2);
}
.button1:hover {
color: #000000;
}

Check the code below, I enclosed the 2 buttons with a div and styled it to act as a border :-)
.button {
position:relative;
display: inline-block;
padding: .5em 1em;
font-size: 18px;
font-family: Arial, 'Arial Unicode MS', Helvetica, Sans-Serif;
border: 1px solid rgba(122, 112, 82, 0.2);
color: #877B5A;
text-align: center;
text-decoration: none;
outline: none ;
overflow: hidden;
border-radius: 7px;
}
.button::after {
position: absolute;
top: 50%;
left: 50%;
z-index: -1;
color #fffff;
display: block;
content: '';
width: 15em;
height: 15em;
border-radius: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
transition: all 0s;
}
.button:hover::after {
box-shadow: inset 0 0 0 10em rgba(242, 189, 99,.2);
}
.button:hover {
color: #000000;
}
.button1 {
position:relative;
display: inline-block;
padding: .5em 1em;
font-size: 18px;
font-family: Arial, 'Arial Unicode MS', Helvetica, Sans-Serif;
border: 1px solid rgba(122, 112, 82, 0.2);
color: #877B5A;
text-align: center;
text-decoration: none;
outline: none ;
overflow: hidden;
border-radius: 7px;
}
.button1::after {
position: absolute;
top: 50%;
left: 50%;
z-index: -1;
display: block;
content: '';
width: 15em;
height: 15em;
transform: translate(-50%, -50%);
transition: all 0s;
}
.button1:hover::after {
box-shadow: inset 0 0 0 10em rgba(242, 189, 99,.2);
}
.button1:hover {
color: #000000;
}
.theborder {
text-align : center;
width: 600px;
padding: 20px 25px;
}
.theborder:before, .theborder:after {
content: "";
height: 1px;
background: linear-gradient(to right, rgba(0,0,0,0) 0%,rgba(160,160,160,1) 50%,rgba(0,0,0,0) 100%);
display: block;
margin : 10px 0px;
}
<div class="theborder">
<a class="button" href="#"> Button </a>
<a class="button1" href="#"> Button1 </a>
</div>

Related

Trying to unstyle an a tag

I am trying to remove the neon glow of the tags in my navigation slide. The problem is that those tag also applies to the tags for other elements on my html page that I actually want to keep neon. Is there a way I can still style those elements while unstyling the tags in my navigation slide? I'm 99% sure its the class - #navigation ul li a { that I am trying to make it look normal, but it's not working at all. I have tried text-decoration: none, I've tried renaming it as well. So far nothing is working. Any advise would be great. Thanks!
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="UTF-8" />
<title>Responsive Portfolio Landing Page</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<!-- Header -->
<section class="banner" id="sec">
<header>
<div id="toggle" onclick="toggle()"></div>
</header>
<div class="content">
<h2>Hello World,<br />I'm <span>Chaz Carothers </span></h2>
<p>
A front-end developer who focuses on writing clean code while
producing beautiful and user-friendly applications.
</p>
<br />
<button>
<a
href="https://chaz-carothers.netlify.app"
class="button"
style="margin-top: 0"
>Tree.Link</a
>
</button>
</div>
<ul class="sci">
<li>
<a href="https://github.com/Baobab-Prince"
><img src="img/git.png"
/></a>
</li>
<li>
<a href="https://twitter.com/BaobabPrince"
><img src="img/twitter.png"
/></a>
</li>
<li>
<a href="https://www.linkedin.com/in/chaz-carothers-169117194/"
><img src="img/linkedin.png"
/></a>
</li>
</ul>
</section>
<div id="navigation">
<ul>
<li>Home</li>
<li>About</li>
<li>Projects</li>
<li>Contact</li>
</ul>
</div>
<script type="text/javascript">
function toggle() {
var sec = document.getElementById('sec');
var nav = document.getElementById('navigation');
sec.classList.toggle('active');
nav.classList.toggle('active');
}
</script>
</body>
</html>
-------------------------------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;
}
header {
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 40px 100px;
z-index: 1000;
transition: 0.6s;
}
header .logo {
margin: 0px;
padding: 0px;
position: relative;
font-weight: 700;
color: #fff;
text-decoration: none;
font-size: 2em;
text-transform: uppercase;
letter-spacing: 2px;
transition: 0.6s;
}
header #toggle {
position: relative;
width: 30px;
height: 30px;
cursor: pointer;
}
header #toggle:before {
content: '';
position: absolute;
top: 7px;
width: 100%;
height: 2px;
background: #fff;
}
header #toggle:after {
content: '';
position: absolute;
bottom: 7px;
width: 100%;
height: 2px;
background: #fff;
}
.banner.active #toggle:before {
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(45deg);
}
.banner.active #toggle:after {
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(-45deg);
}
.banner {
position: relative;
width: 100%;
padding: 100px;
min-height: 100vh;
background: url(inline_image_preview.jpeg);
background-size: cover;
display: flex;
align-items: center;
transition: 0.5s;
z-index: 2;
}
.banner.active {
transform: translate(-400px);
}
.banner .content {
max-width: 600px;
}
.banner .content h2 {
color: #fff;
font-size: 2.5em;
}
.banner .content h2 span {
color: #87ceeb;
font-size: 1.2em;
}
.banner .content p {
font-size: 1.2em;
color: white;
font-weight: 300;
}
.banner .content a {
position: relative;
display: inline-block;
margin-top: 20px;
background: #fff;
color: #000;
padding: 10px 30px;
text-decoration: none;
font-size: 1.2em;
font-weight: 500;
}
button {
--glow-color: rgb(217, 176, 255);
--glow-spread-color: rgba(191, 123, 255, 0.781);
--enhanced-glow-color: rgb(231, 206, 255);
--btn-color: rgb(100, 61, 136);
outline: none;
border: 0.25em solid var(--glow-color);
padding: 0.5em 0.5em;
color: var(--glow-color);
font-size: 15px;
font-weight: bold;
background-color: var(--btn-color);
border-radius: 1em;
outline: none;
box-shadow: 0 0 1em 0.25em var(--glow-color), 0 0 4em 1em var(--glow-spread-color), inset 0 0 0.75em 0.25em var(--glow-color);
text-shadow: 0 0 0.5em var(--glow-color);
position: relative;
transition: all 0.3s;
}
button::after {
pointer-events: none;
content: '';
position: absolute;
top: 120%;
left: 0;
height: 100%;
width: 100%;
background-color: var(--glow-spread-color);
filter: blur(2em);
opacity: 0.7;
transform: perspective(1.5em) rotateX(35deg) scale(1, 0.6);
}
button:hover {
color: var(--btn-color);
background-color: var(--glow-color);
box-shadow: 0 0 1em 0.25em var(--glow-color), 0 0 4em 2em var(--glow-spread-color), inset 0 0 0.75em 0.25em var(--glow-color);
}
button:active {
box-shadow: 0 0 0.6em 0.25em var(--glow-color), 0 0 2.5em 2em var(--glow-spread-color), inset 0 0 0.5em 0.25em var(--glow-color);
}
.sci {
position: absolute;
display: flex;
flex-direction: column;
right: 100px;
}
.sci li {
list-style: none;
}
.sci li a {
position: relative;
display: grid;
place-items: center;
width: 50px;
height: 50px;
text-decoration: none;
border: 1px solid #fff;
margin: 10px 0 0;
}
.sci li a:hover {
background: #0f2537;
}
.sci li a img {
filter: invert(1);
max-width: 20px;
mix-blend-mode: difference;
}
#navigation {
position: fixed;
top: 0;
right: -200px;
width: 400px;
height: 100vh;
background: #643d88;
z-index: 1;
display: grid;
place-items: center;
transition: 0.5s;
}
#navigation.active {
right: 0;
}
#navigation ul {
display: flex;
flex-direction: column;
}
#navigation ul li {
list-style: none;
}
#navigation ul li a {
color: #ebebeb;
text-decoration: none;
display: inline-block;
font-size: 2em;
font-weight: 600;
text-transform: uppercase;
}
a {
--glow-color: rgb(217, 176, 255);
--glow-spread-color: rgba(191, 123, 255, 0.781);
--enhanced-glow-color: rgb(231, 206, 255);
--btn-color: rgb(100, 61, 136);
outline: none;
color: var(--glow-color);
background-color: var(--btn-color);
outline: none;
box-shadow: 0 0 1em 0.25em var(--glow-color), 0 0 4em 1em var(--glow-spread-color), inset 0 0 0.75em 0.25em var(--glow-color);
text-shadow: 0 0 0.5em var(--glow-color);
position: relative;
transition: all 0.3s;
}
a:hover {
color: var(--btn-color);
background-color: var(--glow-color);
}
a.logo {
style: none;
text-decoration: none;
color: inherit;
}
#media (max-width: 767px) {
header {
padding: 20px 50px;
}
.banner {
padding: 100px 50px 150px;
}
.banner .content h2 {
font-size: 1.8em;
}
.banner .content p,
.banner .content a {
font-size: 1em;
}
.banner.active {
transform: translate(-250px);
}
#navigation {
width: 300px;
}
#navigation ul li a {
font-size: 1.5em;
margin: 5px 0;
}
.sci {
position: absolute;
bottom: 50px;
right: initial;
flex-direction: row;
}
.sci li a {
margin: initial;
margin-right: 10px;
}
}
You neon style are applied to all <a>. That's why all your nav link have this style.
Change your neon style applied to your a{} tag to the right selector. It will resolve the issue.
a{ //change your selector here.
--glow-color: rgb(217, 176, 255);
--glow-spread-color: rgba(191, 123, 255, 0.781);
--enhanced-glow-color: rgb(231, 206, 255);
--btn-color: rgb(100, 61, 136);
outline: none;
color: var(--glow-color);
background-color: var(--btn-color);
outline: none;
box-shadow: 0 0 1em 0.25em var(--glow-color),
0 0 4em 1em var(--glow-spread-color),
inset 0 0 0.75em 0.25em var(--glow-color);
text-shadow: 0 0 0.5em var(--glow-color);
position: relative;
transition: all 0.3s;
}

How to modify CSS float label on per input basis

In my project I am using some CSS code to create a floating label for my form inputs. The original code for the floating label can be found here for reference.
However since this code contains a number of floating label examples I have extracted the compiled CSS for the one I am interested in (balloon) and created an example below with my modifications. Specifically I have added a value to the input fields.
.balloon {
display: inline-block;
width: 600px;
padding: 10px 0 10px 15px;
font-family: "Open Sans", sans;
font-weight: 400;
color: #377D6A;
background: #efefef;
border: 0;
border-radius: 3px;
outline: 0;
text-indent: 60px;
transition: all .3s ease-in-out;
}
.balloon::-webkit-input-placeholder {
color: #efefef;
text-indent: 0;
font-weight: 300;
}
.balloon + label {
display: inline-block;
position: absolute;
top: 8px;
left: 0;
bottom: 8px;
padding: 5px 15px;
color: #032429;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
text-shadow: 0 1px 0 rgba(19, 74, 70, 0);
transition: all .3s ease-in-out;
border-radius: 3px;
background: rgba(122, 184, 147, 0);
}
.balloon + label:after {
position: absolute;
content: "";
width: 0;
height: 0;
top: 100%;
left: 50%;
margin-left: -3px;
border-left: 3px solid transparent;
border-right: 3px solid transparent;
border-top: 3px solid rgba(122, 184, 147, 0);
transition: all .3s ease-in-out;
}
.balloon:focus,
.balloon:active {
color: #377D6A;
text-indent: 0;
background: #fff;
}
.balloon:focus::-webkit-input-placeholder,
.balloon:active::-webkit-input-placeholder {
color: #aaa;
}
.balloon:focus + label,
.balloon:active + label {
color: #fff;
text-shadow: 0 1px 0 rgba(19, 74, 70, 0.4);
background: #7ab893;
transform: translateY(-40px);
}
.balloon:focus + label:after,
.balloon:active + label:after {
border-top: 4px solid #7ab893;
}
#import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,600,300,800);
* {
box-sizing: border-box;
}
html,
body {
overflow-x: hidden;
font-family: "Open Sans", sans-serif;
font-weight: 300;
color: #fff;
background: #efefef;
}
.row {
max-width: 800px;
margin: 0 auto;
padding: 60px 30px;
background: #032429;
position: relative;
z-index: 1;
text-align: center;
}
.row:before {
position: absolute;
content: "";
display: block;
top: 0;
left: -5000px;
height: 100%;
width: 15000px;
z-index: -1;
background: inherit;
}
.row:first-child {
padding: 40px 30px;
}
.row span {
position: relative;
display: inline-block;
margin: 30px 10px;
}
<div class="row">
<span>
<input class="balloon" id="state" type="text" value="AR" placeholder="Liquid, solid, gaseous..." /><label for="state">State</label>
</span>
<span>
<input class="balloon" id="planet" value="Earth" type="text" placeholder="Probably Earth" /><label for="planet">Planet</label>
</span>
<span>
<input class="balloon" id="galaxy" type="text" value="This is a test" placeholder="Milky Way?" /><label for="galaxy">Guardians of the Galaxy</label>
</span>
</div>
The question I have, if you look at the third input, is how to adjust spacing for the label so they dont overlap. I realize that I can change the text-indent in the balloon class but that will change the spacing for all the inputs.
Is there a way on an individual basis I can adjust the spacing to account for different lengths in labels?
Add an extra class to "Gardians" and style that to have a little more with.
Then (and I can't believe I'm about to say this) use !important on the active text-indent to overcome the extra specificity of the new class.
.balloon {
display: inline-block;
width: 600px;
padding: 10px 0 10px 15px;
font-family: "Open Sans", sans;
font-weight: 400;
color: #377D6A;
background: #efefef;
border: 0;
border-radius: 3px;
outline: 0;
text-indent: 60px;
transition: all .3s ease-in-out;
}
/*Wide Version - can be applied to more elements*/
.balloon.wide {
text-indent: 200px;
}
.balloon::-webkit-input-placeholder {
color: #efefef;
text-indent: 0;
font-weight: 300;
}
.balloon + label {
display: inline-block;
position: absolute;
top: 8px;
left: 0;
bottom: 8px;
padding: 5px 15px;
color: #032429;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
text-shadow: 0 1px 0 rgba(19, 74, 70, 0);
transition: all .3s ease-in-out;
border-radius: 3px;
background: rgba(122, 184, 147, 0);
}
.balloon + label:after {
position: absolute;
content: "";
width: 0;
height: 0;
top: 100%;
left: 50%;
margin-left: -3px;
border-left: 3px solid transparent;
border-right: 3px solid transparent;
border-top: 3px solid rgba(122, 184, 147, 0);
transition: all .3s ease-in-out;
}
.balloon:focus,
.balloon:active {
color: #377D6A;
/*Note !important*/
text-indent: 0 !important;
background: #fff;
}
.balloon:focus::-webkit-input-placeholder,
.balloon:active::-webkit-input-placeholder {
color: #aaa;
}
.balloon:focus + label,
.balloon:active + label {
color: #fff;
text-shadow: 0 1px 0 rgba(19, 74, 70, 0.4);
background: #7ab893;
transform: translateY(-40px);
}
.balloon:focus + label:after,
.balloon:active + label:after {
border-top: 4px solid #7ab893;
}
#import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,600,300,800);
* {
box-sizing: border-box;
}
html,
body {
overflow-x: hidden;
font-family: "Open Sans", sans-serif;
font-weight: 300;
color: #fff;
background: #efefef;
}
.row {
max-width: 800px;
margin: 0 auto;
padding: 60px 30px;
background: #032429;
position: relative;
z-index: 1;
text-align: center;
}
.row:before {
position: absolute;
content: "";
display: block;
top: 0;
left: -5000px;
height: 100%;
width: 15000px;
z-index: -1;
background: inherit;
}
.row:first-child {
padding: 40px 30px;
}
.row span {
position: relative;
display: inline-block;
margin: 30px 10px;
}
<div class="row">
<span>
<input class="balloon" id="state" type="text" value="AR" placeholder="Liquid, solid, gaseous..." /><label for="state">State</label>
</span>
<span>
<input class="balloon" id="planet" value="Earth" type="text" placeholder="Probably Earth" /><label for="planet">Planet</label>
</span>
<span>
<input class="balloon wide" id="galaxy" type="text" value="This is a test" placeholder="Milky Way?" /><label for="galaxy">Guardians of the Galaxy</label>
</span>
</div>
I normally avoid !important like the plague but in this case it makes sense. You could avoid it by using more specific selectors for your active state
.balloon:focus,
.balloon:active,
.balloon.wide:focus,
.balloon.wide:active, {
color: #377D6A;
text-indent: 0;
background: #fff;
}
target the input value
input[value="This is a test"] {text-indent:170px; }
.balloon {
display: inline-block;
width: 600px;
padding: 10px 0 10px 15px;
font-family: "Open Sans", sans;
font-weight: 400;
color: #377D6A;
background: #efefef;
border: 0;
border-radius: 3px;
outline: 0;
text-indent: 60px;
transition: all .3s ease-in-out;
}
.balloon::-webkit-input-placeholder {
color: #efefef;
text-indent: 0;
font-weight: 300;
}
.balloon + label {
display: inline-block;
position: absolute;
top: 8px;
left: 0;
bottom: 8px;
padding: 5px 15px;
color: #032429;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
text-shadow: 0 1px 0 rgba(19, 74, 70, 0);
transition: all .3s ease-in-out;
border-radius: 3px;
background: rgba(122, 184, 147, 0);
}
.balloon + label:after {
position: absolute;
content: "";
width: 0;
height: 0;
top: 100%;
left: 50%;
margin-left: -3px;
border-left: 3px solid transparent;
border-right: 3px solid transparent;
border-top: 3px solid rgba(122, 184, 147, 0);
transition: all .3s ease-in-out;
}
.balloon:focus,
.balloon:active {
color: #377D6A;
text-indent: 0;
background: #fff;
}
.balloon:focus::-webkit-input-placeholder,
.balloon:active::-webkit-input-placeholder {
color: #aaa;
}
.balloon:focus + label,
.balloon:active + label {
color: #fff;
text-shadow: 0 1px 0 rgba(19, 74, 70, 0.4);
background: #7ab893;
transform: translateY(-40px);
}
.balloon:focus + label:after,
.balloon:active + label:after {
border-top: 4px solid #7ab893;
}
#import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,600,300,800);
* {
box-sizing: border-box;
}
html,
body {
overflow-x: hidden;
font-family: "Open Sans", sans-serif;
font-weight: 300;
color: #fff;
background: #efefef;
}
.row {
max-width: 800px;
margin: 0 auto;
padding: 60px 30px;
background: #032429;
position: relative;
z-index: 1;
text-align: center;
}
.row:before {
position: absolute;
content: "";
display: block;
top: 0;
left: -5000px;
height: 100%;
width: 15000px;
z-index: -1;
background: inherit;
}
.row:first-child {
padding: 40px 30px;
}
.row span {
position: relative;
display: inline-block;
margin: 30px 10px;
}
<div class="row">
<span>
<input class="balloon" id="state" type="text" value="AR" placeholder="Liquid, solid, gaseous..." /><label for="state">State</label>
</span>
<span>
<input class="balloon" id="planet" value="Earth" type="text" placeholder="Probably Earth" /><label for="planet">Planet</label>
</span>
<span>
<input class="balloon" id="galaxy" type="text" value="This is a test" placeholder="Milky Way?" /><label for="galaxy">Guardians of the Galaxy</label>
</span>
</div>

menu bar effect between the lines

how can I make this effect of the inner side of the lines?This is the menu bar I am trying to make: http://i.stack.imgur.com/Mvuer.jpg I cant do the effect between the lines. This is my code: https://jsfiddle.net/ivailo/3q6ej7cc/4/
.button {
position: relative;
display: inline-block;
padding: .5em 1em;
font-size: 18px;
font-family: Arial, 'Arial Unicode MS', Helvetica, Sans-Serif;
border: 1px solid rgba(122, 112, 82, 0.2);
color: #877B5A;
text-align: center;
text-decoration: none;
outline: none;
overflow: hidden;
border-radius: 7px;
}
.button::after {
position: absolute;
top: 50%;
left: 50%;
z-index: -1;
color #fffff;
display: block;
content: '';
width: 15em;
height: 15em;
border-radius: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
transition: all 0s;
}
.button:hover::after {
box-shadow: inset 0 0 0 10em rgba(242, 189, 99, .2);
}
.button:hover {
color: #000000;
}
.button1 {
position: relative;
display: inline-block;
padding: .5em 1em;
font-size: 18px;
font-family: Arial, 'Arial Unicode MS', Helvetica, Sans-Serif;
border: 1px solid rgba(122, 112, 82, 0.2);
color: #877B5A;
text-align: center;
text-decoration: none;
outline: none;
overflow: hidden;
border-radius: 7px;
}
.button1::after {
position: absolute;
top: 50%;
left: 50%;
z-index: -1;
display: block;
content: '';
width: 15em;
height: 15em;
transform: translate(-50%, -50%);
transition: all 0s;
}
.button1:hover::after {
box-shadow: inset 0 0 0 10em rgba(242, 189, 99, .2);
}
.button1:hover {
color: #000000;
}
.theborder {
text-align: center;
width: 600px;
padding: 20px 25px;
}
.theborder:after {
content: "";
height: 1px;
background: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(160, 160, 160, .7) 50%, rgba(0, 0, 0, 0) 100%);
display: block;
margin: 10px 0px;
}
.theborder:before {
content: "";
height: 1px;
background: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(160, 160, 160, .7) 50%, rgba(0, 0, 0, 0) 100%);
display: block;
margin: 10px 0px;
}
Step 1: The inner glow
You can achieve this effect by using a variant of the curved drop-shadow trick. That trick is explained here:
http://nicolasgallagher.com/css-drop-shadows-without-images/demo/
But instead of putting the shadow behind, we can:
make it white
leave it in front
set overflow: hidden on the menu to hide the parts of the "shadow" we don't want to see.
This produces the interior glow effect that you want.
BODY {
background-color: tan;
}
.menu {
background-color: tan;
width: 500px;
height: 60px;
position: relative;
overflow: hidden;
}
.menu::before {
content: "";
position: absolute;
top: -50%;
bottom: 100%;
left: 10%;
right: 10%;
border-radius: 50% / 30%;
box-shadow: 0 0 50px rgba(255,255,255,0.8);
}
.menu::after {
content: "";
position: absolute;
top: 100%;
bottom: -50%;
left: 10%;
right: 10%;
border-radius: 50% / 30%;
box-shadow: 0 0 40px rgba(255,255,255,0.7);
}
<div class="menu">
</div>
You can see more clearly how it works if you remove the overflow: hidden from the menu rule.
Step 2: The fading top border
To make this we can just add a new <div> element at the top that is 1px height and has a CSS gradient background.
The final result:
BODY {
background-color: tan;
}
.menu {
background-color: tan;
width: 500px;
height: 60px;
position: relative;
overflow: hidden;
}
.menu::before {
content: "";
position: absolute;
top: -50%;
bottom: 100%;
left: 10%;
right: 10%;
border-radius: 50% / 30%;
box-shadow: 0 0 50px rgba(255,255,255,0.8);
}
.menu::after {
content: "";
position: absolute;
top: 100%;
bottom: -50%;
left: 10%;
right: 10%;
border-radius: 50% / 30%;
box-shadow: 0 0 40px rgba(255,255,255,0.7);
}
.topborder {
width: 100%;
height: 1px;
background: linear-gradient(to right, rgba(0,0,0,0) 0%,rgba(0,0,0,0.5) 25%,rgba(0,0,0,0.5) 75%,rgba(0,0,0,0) 100%);
}
<div class="menu">
<div class="topborder"></div>
</div>
Note: in both of the above examples I have simplified things by just using the unprefixed CSS properties. These should work on the latest Chrome and FF at least. But if you need to support older browser versions, you should add the prefixed versions of the CSS properties as well.
For example for the gradients, you might want to add -moz-linear-gradient and -webkit-linear-gradient, plus the fallback filter gradients for older versions of IE.
See: full version of this gradient

Checkbox not aligned with text

Hello does anyone know why my left green checkbox is not aligned on left of the text ? Here is my code and what I see right now.
I want something like this "V Etendre le linge X" for one row (V is the checkbox and X is the destroy button)
html,
body {
margin: 0;
padding: 0;
}
button {
margin: 0;
padding: 0;
border: 0;
background: none;
font-size: 100%;
vertical-align: baseline;
font-family: inherit;
color: inherit;
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
-o-appearance: none;
appearance: none;
}
body {
font: 14px 'Helvetica Neue', Helvetica, Arial, sans-serif;
line-height: 1.4em;
background: #eaeaea url('../bower_components/todomvc-common/bg.png');
color: #4d4d4d;
width: 550px;
margin: 0 auto;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
-ms-font-smoothing: antialiased;
-o-font-smoothing: antialiased;
font-smoothing: antialiased;
}
.sapUiTv, .sapUiBtnS {
font: inherit;
font-size: inherit;
}
#todoapp {
background: #fff;
background: rgba(255, 255, 255, 0.9);
margin: 130px 0 40px 0;
border: 1px solid #ccc;
position: relative;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.2),
0 25px 50px 0 rgba(0, 0, 0, 0.15);
}
#todoapp:before {
content: '';
border-left: 1px solid #f5d6d6;
border-right: 1px solid #f5d6d6;
width: 2px;
position: absolute;
top: 0;
left: 40px;
height: 100%;
}
#todoapp input::-webkit-input-placeholder {
font-style: italic;
}
#todoapp input:-moz-placeholder {
font-style: italic;
color: #a9a9a9;
}
#todoapp h1 {
position: absolute;
top: -120px;
width: 100%;
font-size: 70px;
font-weight: bold;
text-align: center;
color: #b3b3b3;
color: rgba(255, 255, 255, 0.3);
text-shadow: -1px -1px rgba(0, 0, 0, 0.2);
-webkit-text-rendering: optimizeLegibility;
-moz-text-rendering: optimizeLegibility;
-ms-text-rendering: optimizeLegibility;
-o-text-rendering: optimizeLegibility;
text-rendering: optimizeLegibility;
}
#header {
padding-top: 15px;
border-radius: inherit;
}
#main {
position: relative;
z-index: 2;
border-top: 1px dotted #adadad;
}
#new-todo,
.sapUiTfBrd.sapUiTfRo.todo,
.sapUiTfBrd.sapUiTfStd.todo {
position: relative;
margin: 0;
margin-right: 153px;
width: 100%;
font-size: 24px;
font-family: inherit;
line-height: 1.4em;
background-color: transparent;
border: 0;
outline: none;
color: #4D4D4D;
padding: 6px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
-o-box-sizing: border-box;
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
-ms-font-smoothing: antialiased;
-o-font-smoothing: antialiased;
font-smoothing: antialiased;
}
#new-todo {
padding: 15px 15px 16px 60px;
border: none;
background: rgba(0, 0, 0, 0.02);
z-index: 2;
box-shadow: none;
}
#todo-list {
margin: 0;
padding: 0;
list-style: none;
}
#todo-list li {
position: relative;
font-size: 24px;
border-top: 1px dotted #ccc;
}
#todo-list input[type='checkbox'] {
text-align: center;
width: 40px;
/* auto, since non-WebKit browsers doesn't support input styling */
height: auto;
position: absolute;
top: 0;
bottom: 0;
margin: auto 0;
-webkit-appearance: none;
/*-moz-appearance: none;*/
-ms-appearance: none;
-o-appearance: none;
appearance: none;
}
#todo-list input[type='checkbox']:after {
content: '✔';
line-height: 62px;
font-size: 20px;
color: #d9d9d9;
text-shadow: 0 -1px 0 #bfbfbf;
}
#todo-list input[type='checkbox']:checked:after {
color: #85ada7;
text-shadow: 0 1px 0 #669991;
bottom: 1px;
position: relative;
}
#todo-list input:not([type='checkbox']) {
word-break: break-word;
padding: 15px;
margin-left: 45px;
display: block;
line-height: 1.2em;
-webkit-transition: color 0.4s;
-moz-transition: color 0.4s;
-ms-transition: color 0.4s;
-o-transition: color 0.4s;
transition: color 0.4s;
}
#todo-list li .destroy {
outline: none;
background-color: transparent;
display: none;
position: absolute;
top: 0;
right: 10px;
bottom: 0;
width: 40px;
height: 40px;
margin: auto 0;
font-size: 22px;
color: #a88a8a;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
}
#todo-list li .destroy:hover {
text-shadow: 0 0 1px #000,
0 0 10px rgba(199, 107, 107, 0.8);
-webkit-transform: scale(1.3);
-moz-transform: scale(1.3);
-ms-transform: scale(1.3);
-o-transform: scale(1.3);
transform: scale(1.3);
}
#todo-list li .destroy:after {
content: '✖';
}
#todo-list li:hover .destroy {
display: block;
}
#todo-list .sapUiRrNoData,
#todo-list .sapUiRrPtb,
#todo-list .sapUiRrFtr {
display: none;
}
<html>
<head>
<meta charset="UTF-8"/>
<title>MyTodoList</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<section id = "todoapp">
<header id="header">
<h1>MyTodoList</h1>
<form action="#" id="todo-form">
<input type="text" id="new-todo" placeholder="New task" autofocus autocomplete="off">
</form>
</header>
<section id = "main">
<u1 id = "todo-list">
<li>
<div class="view">
<input type="checkbox" class="toggle">
<label>Etendre le linge</label>
<button class="destroy"></button>
</div>
</li>
</u1>
</section>
</section>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/angularjs/1.0.3/angular.min.js"></script>
</body>
</html>
You have position:absolute on your checkbox. Removing it fixes the issue.
#todo-list input[type='checkbox'] {
text-align: center;
width: 40px;
height: auto;
/* position: absolute; */
/* top: 0; */
/* bottom: 0; */
margin: auto 0;
-webkit-appearance: none;
-ms-appearance: none;
-o-appearance: none;
appearance: none;
}

How can I insert a small rectangle inside the rectangle?

.
Here is my link http://jsfiddle.net/ashadee/xhaLqvav/.
Html code
Eat your lunch<br>
CSS
a{
font-size: 1.2em;
white-space: normal;
}
a.rectangle
{
width: 70%;
height: 5%;
border: 1px solid black;
padding: 5%;
margin-top: 0%;
background-color: #FAFAFA;
opacity: 0.4;
display: block;
text-decoration: none;
text-align: center;
font-family: Comic Sans MS;
box-shadow: 10px 10px 5px #888888;
}
how will I make the design like the one in the image? Should I use canvas property.
demo - http://jsfiddle.net/victor_007/xhaLqvav/2/
use pseudo element :after and :before for styling right box and rounded
a {
font-size: 1.2em;
white-space: normal;
}
a.rectangle {
width: 70%;
height: 5%;
border: 2px solid black;
padding: 5%;
margin-top: 0%;
background-color: #FAFAFA;
opacity: 0.4;
display: block;
text-decoration: none;
text-align: center;
font-size: 32px;
font-family: Comic Sans MS;
box-shadow: 10px 10px 5px #888888;
position: relative;
}
a:before {
content: '';
border-right: 2px solid black;
height: 100%;
position: absolute;
background: orange;
width: 50px;
top: 0;
bottom: 0;
left: 0;
}
a:after {
content: '';
width: 30px;
height: 30px;
border-radius: 50%;
background: black;
position: absolute;
left: 35px;
top: 50%;
transform: translatey(-50%)
}
Stanford
<br>

Resources