Box outer shadow combine with white shadow - html

I want to create a page like in image
Problem:
Main box Shadow not coming as in image.
I have tried with my own HTMl and CSS code.
Here is fiddle
http://jsfiddle.net/EE6hU/
HTML
<div class='wrapper' id='id_wrapper'>
<div class='main'> <span class='online_survey'>Online Survey</span>
<div class='login_box'>
<div class='login'>
<form>
<div class='label'>username</div>
<input type='text' name='username' class='loginInput' placeholder='moderator' />
<div style='clear:both'></div>
<div class='label'>password</div>
<input type='password' name='password' class='loginInput' placeholder='*********' />
<div style="clear:both"></div>
<input type='checkbox' name='remember' class='check' />
<div class='remember'>Remember me</div>
<input type='submit' name='submit' class='submit_button' value='submit' />
</form>
</div>
<div class='forget_pass'><a href='#'>Forget Password</a>
</div>
</div>
</div>
</div>
CSS
.wrapper {
background:#313131;
height:645px;
}
.main {
margin: 0 auto;
position: relative;
top: 20%;
width: 500px;
}
.online_survey {
bottom: 10px;
color: #FFFFFF;
font-size: 20px;
margin-left: 15px;
position: relative;
}
.user_name {
}
.login_box {
background: none repeat scroll 0 0 #7D7D7D;
border: 1px solid #98B2C9;
border-radius: 20px;
padding: 8px;
box-shadow: 0px 0px 10px 4px rgba(69, 68, 68, 0.75);
-moz-box-shadow: 0px 0px 10px 4px rgba(69, 68, 68, 0.75);
-webkit-box-shadow: 0px 0px 10px 4px rgba(69, 68, 68, 0.75);
}
.loginInput {
background:#313131;
border-radius: 5px;
float: left;
height: 30px;
width: 200px;
margin: 5px;
padding:5px;
color:#ffffff;
}
.label {
float: left;
height: 30px;
width: 140px;
}
.login {
padding: 30px;
}
.forget_pass a {
color: white;
text-decoration:none;
}
.submit_button {
}
.check {
float: left;
margin-left: 140px;
margin-right: 5px;
}
ge.

Stacking shadows of various sizes might get you close.
http://jsfiddle.net/isherwood/EE6hU/1
.login_box {
box-shadow: 0px 0px 10px 4px rgba(69, 68, 68, 0.75),
0 0 150px rgba(255,255,255,0.5),
0 0 250px rgba(255,255,255,0.5);
}
I may have to eat my own words. Here's a way to get the narrower white shadow in your image:
http://jsfiddle.net/isherwood/EE6hU/4
.login_box {
...
box-shadow: 0px 0px 10px 4px rgba(69, 68, 68, 0.75);
margin: 0 -150px;
}
.login_box_shadow {
overflow: visible;
border-radius: 20px;
box-shadow: 0 0 150px rgba(255, 255, 255, 0.5),
0 0 250px rgba(255, 255, 255, 0.5);
margin: 0 150px;
}

Related

How can I make these two divs box shadow appear as one?

I have a banner right above a navigation menu. The two have their own container divs going horizontally across the screen. I have box shadows on both of them to make it look like outer glow. The issue is that the shadow breaks(as it's meant to) between the banner and the navigation. Is there any way that I can modify my code to make it look like the shadows are one? Thanks for your time.
http://i.imgur.com/dJ69OyV.gif
My HTML
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Blah Blah</title>
<link href="assets/css/theme.css" rel="stylesheet" type="text/css">
<link href="assets/css/font-awesome.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="wrapperOuter">
<header>
<div id="bannerContainer">
<div id="banner">
<h1>Scott <span class="green">H.</span> Lacey</h1>
<p>Web Developer <span class="green">♠</span> Photographer <span class="green">♠</span> Musician</p>
</div>
</div>
<div id="toolbarContainer">
<nav>
<ul>
<li>Home</li>
<li>Blog</li>
<li>Portfolio</li>
<li>Services</li>
<li>Resume</li>
<li>About</li>
<li>Contact</li>
</ul>
</nav>
<div id="toolbar">
<div id="social">
<label>Connect With</label>
<ul>
<li><i class="fa fa-facebook-square"></i></li>
<li><i class="fa fa-twitter-square"></i></li>
<li><i class="fa fa-facebook-"></i></li>
<li><i class="fa fa-linkedin-square"></i></li>
</ul>
</div>
<div id="search">
<form action="#" method="POST">
<input type="text" name="searchCriteria" size="30" placeholder="Enter search text, then press enter.">
</form>
</div>
</div>
</div>
</header>
</div>
</body>
</html>
My CSS:
#charset "utf-8";
/* CSS Document */
span.green {
color: #66cc00;
}
body {
background: url(../img/bodyBackground.gif) repeat-x #000;
padding: 0;
margin: 0;
font-family: Verdana;
font-size: 1em;
color: #666666;
}
a {
color: #66cc00;
text-decoration: none;
border-bottom: 1px dotted #66cc00;
}
a:hover {
color: #666666;
}
#wrapperOuter {
margin: 0;
padding: 0;
}
header {
margin: 0;
padding: 0;
}
#bannerContainer {
background: url(../img/themeSprite.gif) 0 0px;
height: 148px;
border-bottom: 1px solid #333;
margin: 0;
padding: 0;
}
#banner {
background-image: url(../img/themeSprite.gif);
background-position: 0px -210px;
height: 148px;
margin: 0px auto;
width: 960px;
border-width: 0px 1px;
border-color: #666;
border-style: solid;
background-repeat: repeat-x;
box-shadow: inset 5px 5px 26px 2px rgba(0, 0, 0, 0.5), 12px 0 15px -4px rgba(255, 255, 255, 0.2), -12px 0 8px -4px rgba(255, 255, 255, 0.2), 0px 10px 10px 0px rgba(255, 255, 255, 0.2);
text-align: center;
}
#banner h1 {
margin: 0px;
padding-top: 25px;
}
#banner p {
color; #999;
}
#toolbarContainer {
background-color: #222;
border-bottom: 1px solid #666;
box-shadow: inset 5px 5px 26px 2px rgba(0, 0, 0, 0.5);
margin: 0px;
padding: 0px;
}
nav {
background-image: url(../img/themeSprite.gif);
background-position: 0px -153px;
margin: 0px;
padding: 0px;
width: 960px;
margin: 0px auto;
height: 52px;
border: 1px solid #000;
box-shadow: 12px 0 15px -4px rgba(255, 255, 255, 0.2), -12px 0 8px -4px rgba(255, 255, 255, 0.2), 0px 5px 15px 0px rgba(255, 255, 255, 0.2), 0px -5px 15px 0px rgba(0, 0, 0, 0.2);
}
nav ul {
margin: 0px;
padding: 0px;
list-style: none;
}
nav ul li {
float: left;
display: inline;
border-left: 1px solid #333;
border-right: 1px solid #666;
height: 52px;
box-shadow: 15px 0 15px -2px rgba(0, 0, 0, .2);
}
nav ul li a {
display: block;
margin: 0px;
border-bottom: 0;
color: #333;
height: 52px;
padding: 15px 25px;
}
#toolbar {
width: 960px;
margin: 0px auto;
padding: 15px 0;
overflow: auto;
}
#social {
float: left;
}
#social label {
float: left;
display: block;
padding-right: 10px;
}
#social ul {
float: left;
list-style: none;
margin: 0;
padding: 0;
}
#social ul li {
float: left;
display: inline;
margin: 0px 5px;
padding: 0;
}
#social ul li a {
color: #666;
border: 0;
font-size: 18px;
}
#search {
float: right;
}
#search input {
background: #333;
border: 1px solid #666;
box-shadow: inset 5px 5px 26px 2px rgba(0, 0, 0, 0.5);
color: #666;
padding: 10px;
}
Take the drop shadows off of .bannerContainer and .toolbarContainer, then place a div around the outside of both of those and add the drop shadow there. You will have to put the <div id="toolbar"> outside of this div too.
The answer is yes but you'd need to rewrite your code and place the nav menu and center head banner in a wrapping div element then apply the shadow to that element. Right now you have 2 elements which are going to be stacked on one another.
<html>
<head></head>
<style>
.main {
width: 100%;
}
.box1 {
margin: 0 -2px;
width: 50%;
height: 400px;
background: red;
display: inline-block;
}
.box1inner {
margin: auto;
width: 70%;
height: 50px;
background: blue;
-webkit-box-shadow: -4px 10px 35px 0px rgba(0,0,0,0.75);
-moz-box-shadow: -4px 10px 35px 0px rgba(0,0,0,0.75);
box-shadow: -4px 10px 35px 0px rgba(0,0,0,0.75);
}
.box2 {
margin: 0 -2px;
width: 50%;
height: 400px;
background: orange;
display: inline-block;
}
.box2wrapper {
margin: auto;
width: 70%;
-webkit-box-shadow: -4px 10px 35px 0px rgba(0,0,0,0.75);
-moz-box-shadow: -4px 10px 35px 0px rgba(0,0,0,0.75);
box-shadow: -4px 10px 35px 0px rgba(0,0,0,0.75);
}
.box2inner {
height: 50px;
background: blue;
}
</style>
</head>
<body>
<div class="main">
<div class="box1">
<div class="box1inner">
</div>
<div class="box1inner">
</div>
</div>
<div class="box2">
<div class="box2wrapper">
<div class="box2inner">
</div>
<div class="box2inner">
</div>
</div>
</div>
<div class="box3">
</div>
</div>
</body>
</html>

Align a logo and a Search Box using CSS

I having problems trying to get a log and a search box to go side by side. The logo on the left and the search box on the right.
header {
background:#383838;
height: 130px;
border-top:10px solid #2C2C2C; border-bottom:1px solid #2C2C2C;
}
.wrap-header {
width:960px;
position:relative;
margin: 0px auto;
}
header #logo {
position:absolute;
top:40px;
left: 30px;
width: 100%;
}
header #search,
header #submit {
position: absolute;
top: 60px;
right: 20px;
width: 258px;
z-index: 15;
}
header #search {
padding: 5px 9px;
height: 20px;
width: 300px;
border: 1px solid #a4c3ca;
background: #f1f1f1;
border-radius: 50px 3px 3px 50px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) inset, 0 1px 0 rgba(255, 255, 255, 1);
}
header #submit
{
background-color: #6cbb6b;
background-image: linear-gradient(#95d788, #6cbb6b);
border-radius: 3px 50px 50px 3px;
border-width: 1px;
border-style: solid;
border-color: #7eba7c #578e57 #447d43;
box-shadow: 0 0 1px rgba(0, 0, 0, 0.3),
0 1px 0 rgba(255, 255, 255, 0.3) inset;
height: 35px;
margin: 0 0 0 10px;
padding: 0;
width: 90px;
cursor: pointer;
font: bold 14px Arial, Helvetica;
color: #23441e;
text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}
header #submit:hover {
background-color: #95d788;
background-image: linear-gradient(#6cbb6b, #95d788);
}
header #submit:active {
background: #95d788;
outline: none;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) inset;
}
header #submit::-moz-focus-inner {
border: 0; /* Small centering fix for Firefox */
}
header #search::-webkit-input-placeholder {
color: #9c9c9c;
font-style: italic;
}
<header>
<div class="wrap-header">
<div id="logo"><img src="./images/logo.png"/></div>
<form id="searchbox" action="search.php" method="post">
<input id="search" type="text" placeholder="Type here" name="search">
<input name="submit" type="submit" id="submit" formmethod="POST" value="Search">
</form>
</div>
</header>
What is happening is the logo is okay but the submit button for the search-box is inside the text-box for the search.
Just edit following css header #search class
header #search {
padding: 5px 9px;
height: 20px;
margin-right: 90px;
width: 300px;
border: 1px solid #a4c3ca;
background: #f1f1f1;
border-radius: 50px 3px 3px 50px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) inset, 0 1px 0 rgba(255, 255, 255, 1);
}
It will do the job well.. Here is the preview
Edit
You need toadd min-width to your header element
Here's working jsfiddle http://jsfiddle.net/otbay822/
<header>
<div class="wrap-header">
<div id="logo" class="inline-div">
<img src="./images/logo.png"/>
</div>
<div class="inline-div">
<form id="searchbox" action="search.php" method="post">
<input id="search" type="text" placeholder="Type here" name="search">
<input name="submit" type="submit" id="submit" formmethod="POST" value="Search">
</form>
</div>
</div>
</header>
CSS:
.inline-div{
display:inline-block;
}
I Wrapped the Form in a div and applied a class too both the form and the logo div. And then simply applied display:inline-block;
Hope it Helps.

CSS - Full diagonal transparent corner cut on div

How can I cut the full corner off a div, keeping it transparent.
This is what I've tried:
.well-corner {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background: rgba(8, 12, 23, 0.8);
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
border-top-right-radius: 50px;
}
.well-link {
float: right;
}
.diagonal {
float: left;
width: 50px;
transform: skewX(-10deg);
}
<div class="well-corner clearfix">
<div class="diagonal">
</div>
<a class="well-link" href="">Test</a>
</div>
Outcome:
Wanted outcome (Image edited):
I have created a JSFiddle here:http://jsfiddle.net/x7fnxu2w/
demo - http://jsfiddle.net/x7fnxu2w/3/
use :pseudo element :before for styling the triangle used yellow border to hide the other part of the div
and used border style dotted to fix the pix-elated issue
body {
background-color: yellow;
}
.well-corner {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background: rgba(8, 12, 23, 0.8);
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
border-top-right-radius: 50px;
position: relative;
width: 430px;
}
.well-corner:before {
content: '';
display: inline-block;
width: 0;
height: 0;
position: absolute;
top: 0;
left: 0;
border-style: dotted;
border-color: yellow rgba(56, 59, 18, 1) transparent transparent;
border-width: 58px 53px 0px 0px;
}
.well-link {
float: right;
}
.diagonal {
float: left;
width: 50px;
transform: skewX(-10deg);
}
<!-- What I've tried -->
<div class="well-corner clearfix">
<div class="diagonal"></div> <a class="well-link" href="">Test</a>
</div>
<!-- Edited image, wanted outcome -->
<img src="http://i.gyazo.com/7cb269f66e7b0bd3870c8b04ac52f4cd.png">
svg solution without any CSS:
The entire shape could be achieved without any CSS if you use svg.
<body style="background-color: yellow">
<svg height="60" width="470">
<path d="M0,60 L50,0 L420,0 A56,56 0 0,1 470,60z" fill="#374418" />
<a xlink:href="#">
<text x="410" y="37" font-size="18" font-weight="500" fill="yellow">Test</text>
</a>
</svg>
</body>
CSS Solution:
You can add a triangle to the :before element.
body {
background-color: yellow;
}
.well-corner {
width: 430px;
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background: rgba(8, 12, 23, 0.8);
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
border-top-right-radius: 50px;
}
.well-link {
float: right;
}
.well-corner:before {
content: '';
position: relative;
top: -39px;
left: -20px;
width: 0;
height: 0;
border-top: 0px solid transparent;
border-bottom: 65px solid transparent;
border-left: 55px solid yellow;
}
<div class="well-corner clearfix">
<a class="well-link" href="">Test</a>
</div>
<img src="http://i.gyazo.com/7cb269f66e7b0bd3870c8b04ac52f4cd.png" />
You can create a div and specify the border width and place it in the appropriate position
.triangle1 {
border-bottom: 58px solid #383B12;
border-left: 58px solid yellow;
font-size: 0px;
float: left;
line-height: 0%;
width: 0px;
}
.triangle2 {
border-bottom: 58px solid red;
border-left: 58px solid blue;
font-size: 0px;
float: left;
line-height: 0%;
width: 0px;
}
body {
background-color: yellow;
}
.well-corner {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background: rgba(8, 12, 23, 0.8);
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
border-top-right-radius: 50px;
}
.well-link {
float: right;
}
.diagonal {
float: left;
width: 50px;
transform: skewX(-10deg);
}
<h1>This is what you want</h1>
<div class="triangle1">
</div>
<div class="well-corner clearfix">
<div class="diagonal">
</div>
<a class="well-link" href="">Test</a>
</div>
<h1>Here is how it works</h1>
<div class="triangle2">
</div>
<div class="well-corner clearfix">
<div class="diagonal">
</div>
<a class="well-link" href="">Test</a>
</div>
I have created a JSBin with your existing code and added two divs with classes triangle1 and triangle2 to demonstrate what you require and how it works
http://jsbin.com/vesoko/4/edit?html,css,output

CSS not linking to my form for some reason

I am trying to get a form styled with css on my webpage, but i cant seem to get the form to recognize the css.As you can see below I am simply trying to stlye the element below is the code. Any thoughts? I am sure the solution is cake, new programmer over here.. any and all help is appreciated!
CSS
form {
background: -webkit-gradient(linear, bottom, left 175px, from(#CCCCCC), to(#EEEEEE));
background: -moz-linear-gradient(bottom, #CCCCCC, #EEEEEE 175px);
margin: auto;
position: relative;
width: 550px;
height: 450px;
font-family: Tahoma, Geneva, sans-serif;
font-size: 14px;
font-style: italic;
line-height: 24px;
font-weight: bold;
color: #09C;
text-decoration: none;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
padding: 10px;
border: 1px solid #999;
border: inset 1px solid #333;
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
}
input {
width: 375px;
display: block;
border: 1px solid #999;
height: 25px;
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
}
textarea#feedback {
width: 375px;
height: 150px;
}
textarea.message {
display: block;
}
input.button {
width: 100px;
position: absolute;
right: 20px;
bottom: 20px;
background: #09C;
color: #fff;
font-family: Tahoma, Geneva, sans-serif;
height: 30px;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
border: 1p solid #999;
}
input.button:hover {
background: #fff;
color: #09C;
}
textarea:focus, input:focus {
border: 1px solid #09C;
}
HTML
<form>
<div>
<h1>Contact Form :</h1>
<label>
<span>Your name</span><input id="name" type="text" name="name" />
</label>
<label>
<span>Email Address</span><input id="email" type="text" name="email" />
</label>
<label>
<span>Subject</span><input id="subject" type="text" name="subject" />
</label>
<label>
<span>Message</span><textarea id="feedback" name="feedback"></textarea>
<input type="button" value="Submit Form" />
</label>
</div>
</form>

Cant center form?

So #container is already centered, but I can't seem to get the <form> centered. I want to have everything inside the form horizontally centered and for some reason it's not working. I've tried every trick that I know.
<!-- Container Start -->
<div id="container">
<h1 class="signup-header-text">SIGN UP</h1>
<div class="clear"></div>
<form class="signup-form" action="#" method="post">
<div id="first_step">
<div class="form">
<label for="gender">You are:</label>
<br />
<select id="gender" name="gender" size="2">
<option value="1">Male</option>
<option value="2">Female</option>
</select>
<div class="clear"></div>
</div>
<div class="clear"></div>
<input class="submit" type="submit" name="submit_first" id="submit_first" value="" />
</div>
</form>
<div id="progress_bar">
<div id="progress"></div>
<div id="progress_text">0% Complete</div>
</div>
</div>
<!-- Container End -->
My CSS
#container {
height: 410px;
min-height: 410px;
min-width: 756px;
width: 756px;
overflow: hidden;
position: absolute;
top: 50%;
left: 50%;
margin-top: -205px; /* Half the height */
margin-left: -378px; /* Half the width */
background: #e9e5e5;
border: solid #dcdcdc 2px;
outline: solid #c4c4c4 1px;
-webkit-box-shadow: 0px 5px 15px rgba(48, 50, 50, 0.28);
-moz-box-shadow: 0px 5px 15px rgba(48, 50, 50, 0.28);
box-shadow: 0px 5px 15px rgba(48, 50, 50, 0.28);
}
Added text-align: center;
#container {
height: 410px;
min-height: 410px;
min-width: 756px;
width: 756px;
overflow: hidden;
position: absolute;
top: 50%;
left: 50%;
margin-top: -205px; /* Half the height */
margin-left: -378px; /* Half the width */
background: #e9e5e5;
border: solid #dcdcdc 2px;
outline: solid #c4c4c4 1px;
-webkit-box-shadow: 0px 5px 15px rgba(48, 50, 50, 0.28);
-moz-box-shadow: 0px 5px 15px rgba(48, 50, 50, 0.28);
box-shadow: 0px 5px 15px rgba(48, 50, 50, 0.28);
text-align: center;
}​
http://jsfiddle.net/xjL7t/
Simply center your text.
#container {
height: 410px;
min-height: 410px;
min-width: 756px;
width: 756px;
overflow: hidden;
position: absolute;
top: 50%;
left: 50%;
**text-align:center;**
margin-top: -205px; /* Half the height */
margin-left: -378px; /* Half the width */
background: #e9e5e5;
border: solid #dcdcdc 2px;
outline: solid #c4c4c4 1px;
-webkit-box-shadow: 0px 5px 15px rgba(48, 50, 50, 0.28);
-moz-box-shadow: 0px 5px 15px rgba(48, 50, 50, 0.28);
box-shadow: 0px 5px 15px rgba(48, 50, 50, 0.28);
}
Try this:
.signup-form {
margin: 0 auto;
}
Find the element you want to center, set a width, and set margin: 0 auto on it.
.signup-form {
margin: 0 auto;
width: 100px;
}
http://jsfiddle.net/EXLSJ/
If you don't want to set a fixed width, follow these instructions to 'shrinkwrap' your container: How to make div not larger than its contents?
add
text-align:center;
float:center;
clear:center;
also works with left and right
Add text-align: center;:
#container {
height: 410px;
min-height: 410px;
min-width: 756px;
width: 756px;
overflow: hidden;
position: absolute;
top: 50%; left: 50%;
margin-top: -205px; /* Half the height */
margin-left: -378px; /* Half the width */
background: #e9e5e5;
border: solid #dcdcdc 2px;
outline: solid #c4c4c4 1px;
-webkit-box-shadow: 0px 5px 15px rgba(48, 50, 50, 0.28);
-moz-box-shadow: 0px 5px 15px rgba(48, 50, 50, 0.28);
box-shadow: 0px 5px 15px rgba(48, 50, 50, 0.28);
**text-align: center;**
}