css3 slide up transistion - html

Hi I've got a Div I wont to expose on Click of a link, it reveals a pop up at the bottom of the page... at the moment it looks like this:
http://jsfiddle.net/XPJC5/
body{margin:0;}
#lightbox {
display:none;
position:absolute;
bottom:5px;
z-index:1000;
width:100%;
background-color:#09F;
height:50px;
float:left;
font-family: 'helvetica_bqregular';
font-size:20px;
line-height:65px;
color:#FFF;
text-align:center;
}
/* works with IE8+, Firefox 2+, Safari, Chrome, Opera 10+ */
#lightbox:target {
display:block;
}
Register
<div id="lightbox">
<div style=" background-color:#CBE376; width:100%; line-height:65px; height:65px; border-bottom:solid #999 thin; -webkit-box-shadow: 4px 4px 4px 4px #333;box-shadow: 4px 4px 4px 4px #333; clear:both;">
Consumer
</div>
<div style=" background-color:#94C8F1; line-height:65px; width:100%; height:65px;">
Business</div>
<div style=" background-color:#333; width:100%; height:65px;">Close
</div></div>
but I want the box to slide up from the bottom similar to this:
http://jsfiddle.net/R8zca/4/
Can anyone help with accomplishment? seems to fail on trial.
Thanks

remove the heights from the inline styles in the html and set the boxes to an initial height of 0px in the css, then use the css transition to bring them to full height
html
Register
<div id="lightbox">
<div style=" background-color:#CBE376; width:100%; line-height:65px; border-bottom:solid #999 thin; -webkit-box-shadow: 4px 4px 4px 4px #333;box-shadow: 4px 4px 4px 4px #333; clear:both;">
Consumer
</div>
<div style=" background-color:#94C8F1; line-height:65px; width:100%; ">
Business</div>
<div style=" background-color:#333; width:100%;">Close
</div></div>
css
body{margin:0;}
#lightbox div
{
height: 0px;
}
#lightbox {
display:block;
position:absolute;
bottom:5px;
z-index:1000;
width:100%;
background-color:#09F;
float:left;
font-family: 'helvetica_bqregular';
font-size:20px;
line-height:65px;
color:#FFF;
text-align:center;
}
/* works with IE8+, Firefox 2+, Safari, Chrome, Opera 10+ */
#lightbox:target div
{
height: 65px;
-webkit-transition:all 1s ease;
-moz-transition:all 1s ease;
}
http://jsfiddle.net/axrwkr/XPJC5/2

Related

CSS triangle with inset shadow

I've made a "triangle" using CSS using the code outlined HERE
(jsFiddle example)
It works great, but I would like to have an inset shadow on the triangle and bar like this:
How?
HTML:
<div id="wrapper">
<div class="triLeft"></div>
<div class="triAngle"></div>
</div>
CSS:
.triLeft{
width:40px;
background:#fff;
margin:0;
float:left;
height:200px;
}
.triAngle{
width: 0;
height: 0;
border-style: solid;
border-width: 45px 0 45px 40px;
border-color: transparent transparent transparent #ffffff;
float:left;
margin-top:20px;
}
#wrapper{
height:200px;
background:brown;
}
you could try it another way, without borders but transform:rotate();
http://codepen.io/anon/pen/MymQMK
div.trgl {
position:relative;
margin:2em;
overflow:hidden;
}
div.trgl:after {
content:'';
position:absolute;
height:40px;
width:40px;
top:2em;
left:-20px;
background:white;
box-shadow: inset 0 0 5px black ;
transform:rotate(45deg);
}
div.trgl div{
position:relative;
min-height:200px;
padding:1em;
box-shadow: 0 0 5px black;
margin:3px;
background:lightgray;
}
<div class="trgl">
<div>
</div>
</div>

Display two divs inline

I need to display two divs one next to another on the same line, but I can't understand why the second one is slightly lower than the first one.
<div class="cont-title">
<div class="triang-header"></div>
<div class="h2-stripe">
<h2 itemprop="name">
Title
</h2>
</div>
</div>
This is the css:
.cont-title{
margin-right: -7px;
min-width: 90%;
max-width: 100%;
height:51px;
float:right;
text-align:right;
white-space: nowrap;
}
.triang-header{
position:relative;
width:39px;
height:38px;
display:inline-block;
background:url('../images/titlebar.png') no-repeat top left;
}
.h2-stripe{
position:relative;
z-index:10;
display:inline-block;
text-align:left;
background-color: #2A58AE;
margin:0;
height:38px;
min-width:80%;
line-height:38px;
box-shadow: 2px 3px 5px 0 #555;
}
What am I doing wrong?
I think you did not count the line-height,
should be like this the style for .h2-stripe:
.h2-stripe{
position:relative;
line-height: 23px; // <----
z-index:10;
display:inline-block;
text-align:left;
background-color: #2A58AE;
margin:0;
height:38px;
min-width:80%;
box-shadow: 2px 3px 5px 0 #555;
}
here it is an example with line-height:23px for .h2-stripe: http://jsfiddle.net/6a0ga3uq/
you misspelled your class
.h2-strispe{
position:relative;
z-index:10;
display:inline-block;
text-align:left;
background-color: #2A58AE;
margin:0;
height:38px;
min-width:80%;
line-height:38px;
box-shadow: 2px 3px 5px 0 #555;
}
should be
.h2-stripe{
position:relative;
z-index:10;
display:inline-block;
text-align:left;
background-color: #2A58AE;
margin:0;
height:38px;
min-width:80%;
line-height:38px;
box-shadow: 2px 3px 5px 0 #555;
}
The margin of your h2 element causes the second div to shift down. Also, you should vertical-align inline-block elements. See this updated snippet (also with corrected class name in CSS).
.cont-title{
margin-right: -7px;
min-width: 90%;
max-width: 100%;
height:51px;
float:right;
text-align:right;
white-space: nowrap;
}
.cont-title > * {
vertical-align: middle;
}
.triang-header{
position:relative;
width:39px;
height:38px;
display:inline-block;
background:url('http://placehold.it/39x38') no-repeat top left;
margin: 0;
}
.h2-stripe{
position:relative;
z-index:10;
display:inline-block;
text-align:left;
background-color: #2A58AE;
margin:0;
height:38px;
min-width:80%;
line-height:38px;
box-shadow: 2px 3px 5px 0 #555;
}
h2 {
margin:0;
}
<div class="cont-title">
<div class="triang-header"></div><div class="h2-stripe"><h2 itemprop="name">
Title
</h2>
</div>
</div>
In the second div, you have line height and lot of other stuff. So other elements can extend your div. If you want your div to be the same size regardless to its other elements you should change display attribute like this
.h2-strispe{
position:relative;
z-index:10;
display:inline-block;
box-sizing:border-box;
text-align:left;
background-color: #2A58AE;
margin:0;
height:38px;
min-width:80%;
line-height:38px;
box-shadow: 2px 3px 5px 0 #555;
}
You can see i added box-sizing to border-box and that will save the position of your div no matter what you do to inner elements

Position of the button is off on IE and FF

How do I match the style (and also the position is off) of the button on
http://jsfiddle.net/nA4P9/21/
using the compatible codes in CSS?
See image attached from different browsers - Chrome/IE/FF.
CSS -
.FindHome {background-color:#09F; width:300px; border:1px solid #09F; padding:10px 40px 10px 15px; border-radius:5px; display:block; margin-left:auto; margin-right:auto; background: #09F url('http://www.magnixsolutions.com/clients/tas/img/arrow.png') no-repeat; background-position:320px center; margin-bottom:35px; overflow: hidden; text-decoration:none; color:#ffffff;}
.FindHome:hover {border:1px solid #4d4d4d; background: #4d4d4d url('http://www.magnixsolutions.com/clients/tas/img/arrow.png') no-repeat; background-position:320px center;}
.FindHome-div{display:inline-block;}
HTML -
<div class="fluid FindHome-div">
<h1>Find your home </h1>
</div>

What CSS method would remove an outline of a div cross browser

I have two divs that join together that contain an image. The way the it is layered out the image is in two half's.
This works as intended but only views correctly in chrome. In the other browsers there is an outline or some layout error which causes the document to look different.
I presumed that outline:0; and border:0; would do the trick.
This is how the image should look. This is taken form chrome. As you can see there is nothing visually wrong with this.
Internet Explore
FireFox
Safari
CSS:
.login{
position:absolute;
left:50%;
margin-left:-150px;
top:50%;
margin-top:-200px;
width:300px;
height:400px;
border-radius:10px;
text-align:center;
display:table-cell;
vertical-align:central;
padding:0 0 0 0;
border:0;
border-style:none;
outline:0;
}
.login header{
height:75px;
width:100%;
margin-bottom:0;
padding:0 0 0 0;
border-style:none;
outline:0;
border:0;
}
.login header .logo{
width:150px;
height:75px;
outline:none;
margin-left:75px;
border:0;
border-style:none;
outline:0;
background:url(assests/logo_tiny.png) center 0px no-repeat;
background-color:#000;
border-radius:75px;
border-bottom-left-radius:0px;
border-bottom-right-radius:0px;
box-shadow:5px 5px 10px #000;
-moz-box-shadow:5px 5px 10px #000;
-webkit-box-shadow:5px 5px 10px #000;
-ms-box-shadow:5px 5px 10px #000;
-o-box-shadow:5px 5px 10px #000;
}
.login form{
outline:none;
width:100%;
height:245px;
padding:0 0 0 0;
padding-top:80px;
border:0;
border-style:none;
box-shadow:5px 5px 10px #000;
background:url(assests/logo_tiny.png) center -75px no-repeat;
background-color:#000;
-moz-box-shadow:5px 5px 10px #000;
-webkit-box-shadow:5px 5px 10px #000;
-ms-box-shadow:5px 5px 10px #000;
-o-box-shadow:5px 5px 10px #000;
border-radius:10px;
font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;
color:#FFF;
}
HTML:
<div class="login">
<header>
<div class="logo"></div>
</header>
<form>
</form>
</div>
Update: Fiddle
You made a mistake by flattening your logo.
It was 150px wide and only 75px high. Besides you've removed the border-radius at the bottom. On order to have a circle cast a circular shadow the whole div has to be square and the border-radius have to be equal.
See attached fiddle.
http://jsfiddle.net/mbh6W/2/
So the line you saw was in fact the box shadow of the circle that was flattened at the bottom.

How to create a background color based border in a circle div?

I tried to create a circle which border should look same color as div color and a space between the border and div. The in between space should show the background color of what ever div it is on. the background color is changeable so we shouldn't hardcode it.
Instead i have given transparency using rgba mode. All work fine am trying to get this effect on hover of the circle but i couldn't able to get the hover because i'm trying to display:block on hover and in normal state it is display:none; This are for the after selector hence i tried this effect with after selector.
CODE
CSS
.main{
width:80px;
height:80px;
border-radius:100%;
background-color:#007eff;
text-align:center;
line-height:80px;
}
.main:hover + .main:after{
display:block;
}
.main:after{
width:86px;
height:86px;
border-radius:100%;
background:rgba(255,255,255,0.1);
border:2px solid #007eff;
position:absolute;
content:"";
z-index:-1;
top:3px;
left:3px;
display:none;
}
body{
background-color:#888;
}
HTML
<div class="main"><i class="fa fa-camera-retro fa-lg"></i>
</div>
PROBLEM STATE
ON HOVER it should become like THIS with effects if possible
If there is any tutorial to do this i'll happy to learn. Thanks
set position:relative; to the .main and set left/right/top/bottom of the .main:after to zero and add transition:all ease 0.3s for animating.
in the .main:hover:after change left/right/top/bottom to -5px.
demo
.main{
width:80px;
height:80px;
border-radius:100%;
background-color:#007eff;
text-align:center;
line-height:80px;
position:relative;
margin:6px;
}
.main:after{
border-radius:100%;
background:rgba(255,255,255,0.1);
border:2px solid #007eff;
position:absolute;
content:"";
z-index:-1;
top:0px;
left:0;
bottom:0;
right:0;
transition:all ease 0.3s;
}
.main:hover:after{
top:-5px;
bottom:-5px;
right:-5px;
left:-5px;
}
Just add .main:hover:after to display it as block on hover WORKING FIDDLE
.main:hover:after{
display:block;
}
Try something like this
CSS :
.main{
width:80px;
height:80px;
border-radius:100%;
background-color:#007eff;
text-align:center;
line-height:80px;
}
.main:hover:after{
width:86px;
height:86px;
border-radius:100%;
background:rgba(255,255,255,0.1);
border:2px solid #007eff;
position:absolute;
content:"";
z-index:111;
top:3px;
left:3px;
}
body{
background-color:#888;
}
HTML :
<div class="main"><i class="fa fa-camera-retro fa-lg"></i>
</div>
FIDDLE
you could use box-shadow instead pseudo-element :
http://jsfiddle.net/Ku6BQ/24/
.main {
width:80px;
height:80px;
border-radius:100%;
background-color:#007eff;
text-align:center;
line-height:80px;
}
.main:hover {
box-shadow: 0 0 0 4px #888888, 0 0 0 6px #007eff;
}
body {
background-color:#888;
}
If you it it transparent and show behind a gradient or an image, you may still use box-shadow : http://jsfiddle.net/Ku6BQ/25/ http://jsfiddle.net/Ku6BQ/26/
.main {
width:80px;
height:80px;
border-radius:100%;
box-shadow:inset 0 0 0 100px #007eff;
text-align:center;
line-height:80px;
}
.main:hover {
border:4px transparent solid;
margin:-4px;
box-shadow: 0 0 0 2px #007eff,
inset 0 0 0 100px #007eff;;
}
html {
background :#888 url(http://lorempixel.com/200/200/nature) repeat;
height:100%;
}
An improvement (just for the record) on he idea of a box shadow as apported by GCyrillus
.main {
width:80px;
height:80px;
border-radius:100%;
background-color:#007eff;
text-align:center;
line-height:80px;
border: solid 4px transparent;
background-clip: padding-box;
box-shadow: 0 0 0 0px white;
-webkit-transition: all 1s;
transition: all 1s;
}
.main:hover {
box-shadow: 0 0 0 6px #007eff;
}
body {
background-color:#888;
}
fiddle