I need to make this using only css and css3 drop shadows
Please help to make like this using css...
Image : http://technocodes.us/Lab/Html/vidbees/img/frame.png
ADDED MORE TO THE ANSWER:
I looked into this. I believe this is the solution. Not using images at all, only CSS.
This is not the full solution, but I believe this is the solution. You should get the idea and solution to run from from here I think:
This is the result:
(Here is the fiddle: http://jsfiddle.net/uwfL5azw/3/ )
Here is the place that inspired me, and I lend code from: http://www.themeshock.com/css-drop-shadow/
The HTML:
<div class="main-box">
<div class="box_shadow">Here is my content
<div class="sh_bottom"></div>
</div>
</div>
The CSS:
.main-box {
padding: 0 0 0 30px; /*just for the box's content*/
}
.sh_bottom:before {
content: "";
position: absolute;
left: 0;
bottom: 0;
width: 150px;
height: 100px;
z-index: -1;
background: rgba(0, 0, 0, 0.2);
box-shadow: -20px 30px 10px rgba(0, 0, 0, 0.3);
-moz-box-shadow: -20px 30px 10px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: -20px 30px 10px rgba(0, 0, 0, 0.3);
-webkit-transform: skew(-10deg,-10deg) translate(40px,-15px);
transform: skew(-10deg,-10deg) translate(40px,-15px);
-moz-transform: skew(-10deg,-10deg) translate(40px,-15px);
}
.sh_bottom:after {
content: "";
position: absolute;
right: 0;
bottom: 0;
width: 150px;
height: 100px;
z-index: -1;
background: rgba(0, 0, 0, 0.2);
-moz-box-shadow: 20px 30px 10px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 20px 30px 10px rgba(0, 0, 0, 0.3);
box-shadow: 20px 30px 10px rgba(0, 0, 0, 0.3);
-moz-transform: skew(10deg,10deg) translate(-40px,-15px);
-webkit-transform: skew(10deg,10deg) translate(-40px,-15px);
transform: skew(10deg,10deg) translate(-40px,-15px);
}
.box_shadow {
padding:20px;
width: 374px;
min-height: 200px;
margin: auto;
background: #ccc;
border: 5px solid white;
position: relative;
-webkit-box-shadow: rgba(0, 0, 0, 0.8) 0px 0px 1px; box-shadow: rgba(0, 0, 0, 0.8) 0px 0px 1px;
}
MORE:
See fiddle: http://jsfiddle.net/uwfL5azw/5/
This is only a little example of drop shadows.
For an example more helpful, I need of you code, or a web page with a result similar at your.
div {
width: 300px;
height: 100px;
background-color: yellow;
box-shadow: 10px 10px 5px #888888;
}
<div>Hello world!</div>
Thank you and bye,
Giacomo
How about this it is made of two divs
#box {
width:200px;
height:200px;
background:grey;
margin:20px;
border:2px solid white;
box-shadow:0px 16px 20px black;
}
#b {
position:absolute;
width: 0px;
height: 0px;
border-left: 250px solid transparent;
border-right: 250px solid transparent;
border-bottom: 100px solid white;
margin-left:-130px;
margin-top:-17px;
}
<div id="box"></div>
<div id="b"></div>
Without using two divs [Fiddle]http://jsfiddle.net/udq412fe/3/)
#box {
width:200px;
height:200px;
background:grey;
margin:20px;
border:2px solid white;
box-shadow:0px 16px 20px black;
}
#b {
position:absolute;
width: 0px;
height: 0px;
border-left: 250px solid transparent;
border-right: 250px solid transparent;
border-bottom: 100px solid white;
margin-left:-130px;
margin-top:-17px;
}
<div id="box"></div>
Related
Hi everyone thank you for taking the time. I am trying to add the nav-bar that is out of place inside of a container. This is the HTML
<div class="container-login100" style="background-image: url('images/packages.jpg');">
<div class="wrap-login100 p-l-55 p-r-55 p-t-80 p-b-30">
<div class="nav-container">
<nav class="nav-bar-outer">
<buttton type="button" class="hamburger-btn"> HERE </buttton>
</nav>
</div>
<form class="login100-form validate-form">
<!--css form content-->
And this is the CSS.
[ Nav-Bar ]*/
.nav-container{
position: absolute;
width: auto;
}
.nav-bar-outer{
background-color: #ffbf00;
padding:5px;
height:50px;
width:390px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
background-position: center;
background-size: cover;
position: relative;
}
.wrap-login100 {
border-bottom-right-radius: 10px;
border-bottom-right-radius: 10px;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
width: 390px;
background: rgba(0, 0, 0, 1);
overflow: hidden;
box-shadow: 0 3px 20px 0px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0 3px 20px 0px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0 3px 20px 0px rgba(0, 0, 0, 0.1);
-o-box-shadow: 0 3px 20px 0px rgba(0, 0, 0, 0.1);
-ms-box-shadow: 0 3px 20px 0px rgba(0, 0, 0, 0.1);
}
.login100-form {
width: 100%;
}
.p-l-55 {padding-left: 55px;}
.p-b-30 {padding-bottom: 30px;}
.p-r-55 {padding-right: 55px;}
.p-t-80 {padding-top: 80px;}
.p-b-37 {padding-bottom: 37px;}
So I think because there is padding in the black container the bar is not positioning itself like I would like to how could it fit inside the container without me having to change the padding (since the content inside would get messed up)
Please add this new CSS to your CSS file.
.wrap-login100 {
position: relative;
}
.nav-container {
position: absolute;
width: auto;
left: 55px;
right: 55px;
}
.nav-bar-outer {
width: 100%;
padding: 0;
}
I'm trying to figure out how to beautifully group divs together to create more creative shapes outline. Basically I wanted to make a textbox with shared border. I've maded a ugly sample over THERE
.white-box{
width: 300px;
}
.white-box-tab{
position: relative;
left: 8px;
width: 45%;
height: 25px;
background: #fff;
box-shadow: 1px -1px 1px rgba(0, 0, 0, 0.1), -1px 0px 1px rgba(0, 0, 0, 0.1);
border-radius: 3px 3px 0px 0px;
text-align: center;
}
.white-box-tab:after{
content:'';
width:100%;
height:1px;
position:absolute;
background:white;
bottom: -0.5px;
left: 0px;
}
.white-box-body{
width: 100%;
height: 200px;
background: #fff;
box-shadow: 1px 1px 1px 0px rgba(0, 0, 0, 0.1), -1px -1px 1px 0px rgba(0, 0, 0, 0.1);
border-radius: 0px 3px 3px 3px;
}
<div class="white-box">
<div class="white-box-tab">
The title
</div>
<div></div>
<div class="white-box-body">
</div>
</div>
However, the way I acheive it just feels quite ugly and unexpandable. Is there a better way to complete task like that?
I would simply do not apply bottom border to element and move it down by other div border width:
.white-box {
width: 300px;
}
.white-box .box {
border: 1px solid #ddd;
background-color: white;
}
.white-box .box.white-box-tab {
border-bottom: none;
position: relative;
top: 1px;
margin-left: 5%;
width: 70%;
z-index: 10;
}
.white-box-body {
height: 300px;
}
<div class="white-box">
<div class="box white-box-tab">
The title
</div>
<div></div>
<div class="box white-box-body">
</div>
</div>
I'm trying to make a line that almost looks like it has serifs at the ends. Essentially, I want to make it wider at the very ends and thin in the middle, just using css. This has actually proven to be quite a challenge.
Any help would be appreciated.
Thus far I've been able to get the bottom to look how I want using the :after pseudo selector, but no luck with the top, which I can only seem to get concave, rather than convex.
Here's the code of what I've done so far
.line {
background:none;
height: 8px;
position:relative;
overflow:hidden;
z-index:1;
top: 50px;
left: 50px;
width: 140px;
box-shadow: 11px 12px 16px -3px rgba(0,0,0,0.6);
-webkit-transform: rotate(38deg);
transform: rotate(38deg);
}
.line:after {
content: '';
position: absolute;
left: 0%;
width: 100%;
padding-bottom: 10%;
top: 50%;
border-radius: 35%;
box-shadow: 0px 0px 0px 150px rgba(0,0,0,0.6);
z-index: -1;
}
.line:before {
content: '';
position: absolute;
left: 0%;
width: 100%;
padding-bottom: 8%;
top: -30%;
border-radius: 35%;
box-shadow: 0px 0px 0px 150px rgba(255,255,255, 1);
z-index: 24 !important;
}
and the HTML
<section class="stage">
<figure class="line"></figure>
</section>
Here's the fiddle of what I have thus far (also, I'm gonna need to rotate it for certain areas)
http://jsfiddle.net/speo9bfv/1/
Thanks for the help!
If you have a plain background color, you can do this with pseudo elements :
DEMO
HTML :
<section class="stage">
<figure class="line"></figure>
</section>
CSS :
.line {
height: 8px;
position:relative;
overflow:hidden;
z-index:1;
top: 50px;
left: 50px;
width: 140px;
-webkit-transform: rotate(38deg);
transform: rotate(38deg);
background:rgba(0,0,0,0.6);
}
.line:after, .line:before {
content:'';
position: absolute;
left:0;
width:100%;
height:100%;
border-radius: 35%;
background:#fff;
}
.line:after{
top:5px;
}
.line:before{
bottom:5px;
}
I would try using gradients to create the illusion of a pinched line.
black -> white -> black
black line
black -> white -> black
I wanted this to just be a comment, but I couldn't make new lines like I wanted.
Here's a fiddle for you:
http://jsfiddle.net/qaqafc6f/
Here is a better one, with rotate applied.
http://jsfiddle.net/qaqafc6f/2/
Note this does not use :before or :after, and is probably more cross-browser compatible (as long as you add the vendor prefixes).
If you need a transparency around this shape you could use two pseudo elements with a curved border-radius and multiple box-shadows to colour in the space between them:
.line {
height: 8px;
position:relative;
overflow:hidden;
z-index:1;
top: 50px;
left: 50px;
width: 140px;
-webkit-transform: rotate(38deg);
transform: rotate(38deg);
}
.line:after, .line:before {
content:'';
position: absolute;
left:-10px;
right:-10px;
height:100%;
border-radius: 50%;
background:transparent;
box-shadow: 0 0 1px 1px rgba(0, 0, 0, .5), 5px 0 0px 2px rgba(0, 0, 0, .5), -5px 0 0px 2px rgba(0, 0, 0, .5), 10px 0 0px 2px rgba(0, 0, 0, .5), -10px 0 0px 2px rgba(0, 0, 0, .5), 15px 0 0px 2px rgba(0, 0, 0, .5), -15px 0 1px 2px rgba(0, 0, 0, .5), 20px 0 0px 2px rgba(0, 0, 0, .5), -20px 0 0px 2px rgba(0, 0, 0, .5), 25px 0 0px 2px rgba(0, 0, 0, .5), -25px 0 0px 2px rgba(0, 0, 0, .5), 30px 0 1px 1px rgba(0, 0, 0, .5), -30px 0 1px 1px rgba(0, 0, 0, .5);
}
Or - if an inline svg datauri is acceptable - you could do something like:
.svg-stick {
margin-top:200px;
display:block;
width:140px;
height:8px;
background: transparent url(data:image/svg+xml;
base64, PD94bWwgdmVyc2lvbj0iM...etc...) center center no-repeat;
background-size:100% 100%;
-webkit-transform: rotate(38deg);
transform: rotate(38deg);
}
Both demoed here: http://jsfiddle.net/eqaL4g5q/
This is what i have got so far
After after checking out tutorial
I want know how curved effect is generated on divs the only question that i found near to what i was looking for was At here at stackoverlow but that too dint help
How folded edge effect is created on as in the above picture
Css
#MenuShape{
height:50px;
background-color:orange;
width:200px;
position:relative;
text-align:center;
left:100px;
}
#MenuShape:after{
content:"";
position: absolute;
width: 0;
height: 0;
left:200px;
border-top: 50px solid transparent;
border-left: 100px solid orange;
border-bottom: 0px solid transparent;
}
#MenuShape:before{
content:"";
position: absolute;
width: 0;
height: -50;
left:-100px;
border-top: 50px solid transparent;
border-right: 100px solid orange;
border-bottom: 0px solid transparent;
}
HTML
<div id="MenuShape" >
sachin
</div>
https://css-tricks.com/ this the site on inspecting it i found its span wrapped
anchor tag along with svg tag
<a href="/" class="home">
<svg viewBox="0 0 100 25" class="shape-tab">
<use xlink:href="#shape-tab"></use>
</svg>
<span>Blog</span></a>
Click here to see the unexpected behaviour it works fine in codepen
Here is a final demo (archived) on the folded corners:
and the following code is how you can create them:
.note {
position: relative;
width: 30%;
padding: 1em 1.5em;
margin: 2em auto;
color: #fff;
background: #97C02F;
overflow: hidden;
}
.note:before {
content: "";
position: absolute;
top: 0;
right: 0;
border-width: 0 16px 16px 0;
border-style: solid;
border-color: #fff #fff #658E15 #658E15;
background: #658E15;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), -1px 1px 1px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), -1px 1px 1px rgba(0, 0, 0, 0.2);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), -1px 1px 1px rgba(0, 0, 0, 0.2);
/* Firefox 3.0 damage limitation */
display: block;
width: 0;
}
.note.rounded {
-moz-border-radius: 5px 0 5px 5px;
border-radius: 5px 0 5px 5px;
}
.note.rounded:before {
border-width: 8px;
border-color: #fff #fff transparent transparent;
-moz-border-radius: 0 0 0 5px;
border-radius: 0 0 0 5px;
}
<div class="note"></div>
To create a curved wave effect you can use this code:
#wave {
position: relative;
height: 70px;
width: 600px;
background: #e0efe3;
}
#wave:before {
content: "";
display: block;
position: absolute;
border-radius: 100% 50%;
width: 340px;
height: 80px;
background-color: white;
right: -5px;
top: 40px;
}
#wave:after {
content: "";
display: block;
position: absolute;
border-radius: 100% 50%;
width: 300px;
height: 70px;
background-color: #e0efe3;
left: 0;
top: 27px;
}
<div id="wave"></div>
To achieve the curve you’ll need to inverse where it starts. Follow the same demo, just reverse your values.
See a live demonstration (archived) of how border radius can create the shapes and effects you want and adjust each corner to see it in action.
Im creating a ribbon using css. the page it is on is FOUND HERE
I know the rest of my page needs more work but right this second I am focusing on the ribbon.
I need it to be auto 90% and center no matter what the screen size. at the moment it is cut off on the left a little and not center.
my css code:
.ribbon {
width: 90%;
position: absolute;
text-align: center;
font-size: 15px!important;
background: #2cdb1c;
background: -webkit-gradient(linear, left top, left bottom, from(#2cdb1c), to(#618028));
background: -webkit-linear-gradient(top, #2cdb1c, #618028);
background: -moz-linear-gradient(top, #2cdb1c, #618028);
background: -ms-linear-gradient(top, #2cdb1c, #618028);
background: -o-linear-gradient(top, #2cdb1c, #618028);
background-image: -ms-linear-gradient(top, #2cdb1c 0%, #618028 100%);
-webkit-box-shadow: rgba(000,000,000,0.3) 0 1px 1px;
-moz-box-shadow: rgba(000,000,000,0.3) 0 1px 1px;
box-shadow: rgba(000,000,000,0.3) 0 1px 1px;
font-family: 'Helvetica Neue',Helvetica, sans-serif;
}
.ribbon h1 {
font-size: 23px!important;
color: #000000;
text-shadow: #b9c9b5 0 1px 0;
margin:0px;
padding: 15px 10px;
}
.ribbon:before, .ribbon:after {
content: '';
position: absolute;
display: block;
bottom: -1em;
border: 1.5em solid #379c27;
z-index: -1;
}
.ribbon:before {
left: -2em;
border-right-width: 1.5em;
border-left-color: transparent;
-webkit-box-shadow: rgba(000,000,000,0.4) 1px 1px 1px;
-moz-box-shadow: rgba(000,000,000,0.4) 1px 1px 1px;
box-shadow: rgba(000,000,000,0.4) 1px 1px 1px;
}
.ribbon:after {
right: -2em;
border-left-width: 1.5em;
border-right-color: transparent;
-webkit-box-shadow: rgba(000,000,000,0.4) -1px 1px 1px;
-moz-box-shadow: rgba(000,000,000,0.4) -1px 1px 1px;
box-shadow: rgba(000,000,000,0.4) -1px 1px 1px;
}
.ribbon .ribbon-content:before, .ribbon .ribbon-content:after {
border-color: #000000 transparent transparent transparent;
position: absolute;
display: block;
border-style: solid;
bottom: -1em;
content: '';
}
.ribbon .ribbon-content:before {
left: 0;
border-width: 1em 0 0 1em;
}
.ribbon .ribbon-content:after {
right: 0;
border-width: 1em 1em 0 0;
}
.ribbon-stitches-top {
margin-top:2px;
border-top: 1px dashed rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.5);
-webkit-box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.5);
box-shadow: 0px 0px 2px rgba(255, 255, 255, 0.5);
}
.ribbon-stitches-bottom {
margin-bottom:2px;
border-top: 1px dashed rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.3);
box-shadow: 0px 0px 2px rgba(255, 255, 255, 0.3);
}
Can someone please help me? thank you.
It can't be positioned as absolute. Remove that. Make sure its parent has 100% width and then set margin:0 auto;
You could put your entire ribbon inside a divide. Then instead of centering the ribbon just give it a width of 100%.
ribbon_divide {
margin: 0 auto;
width: 90%;
}
You should wrap ribbon element and set width=100% for ribbon.
.ribbon-wrapper {
position: relative;
width: 90%;
margin: 0 auto;
}
.ribbon {
width: 100%
}
<div class="ribbon-wrapper">
<!-- Your ribbon html code -->
</div>
Just wrap your ribbon with a div.
<div style="width:90%;margin:0 auto;">
<div class="ribbon"><div class="ribbon-stitches-top"></div><strong class="ribbon-content"><h1>Xclo.mobi</h1></strong><div class="ribbon-stitches-bottom"></div></div>
</div>
You could actually center it based on percentage and absolutely:
.ribbon {
position: absolute;
width: 90%;
left: 50%;
margin-left: -45%;
}