How to create a popup with partial left border? - css

I have to create this modal with same style:
This is what I have right now:
.notification {
position: fixed;
top: 32px;
right: 32px;
width: 460px;
height: 150px;
border-radius: 36px;
box-shadow: 0 7px 8px -4px rgba(0, 0, 0, 0.2), 0 5px 22px 4px rgba(0, 0, 0, 0.12), 0 12px 17px 2px rgba(0, 0, 0, 0.14);
background-color: white;
z-index: 999999;
}
.notification > .border {
background-color: #3fb4e4;
margin-left: 20px;
border-radius: 36px;
width: 34px;
height: 150px;
}
<div class="notification"><div class="border"></div>Hello</div>
But I cant find a way to create the blue border on the left.

Use multiple background like below:
.notification {
border-radius: 36px;
padding:50px;
width:100px;
box-shadow:
0 7px 8px -4px rgba(0, 0, 0, 0.2),
0 5px 22px 4px rgba(0, 0, 0, 0.12),
0 12px 17px 2px rgba(0, 0, 0, 0.14);
/* Relevant code*/
border:3px solid transparent; /* Control the thickness*/
background:
/* Cover only the padding area*/
linear-gradient(#fff,#fff) padding-box,
/* Cover the border area: adjust the 50px to control the size */
linear-gradient(to right, #3fb4e4 50px,transparent 0) border-box;
}
<div class="notification">Hello</div>
Another syntax where you can control the size outside the gradient:
.notification {
border-radius: 36px;
padding:50px;
width:100px;
box-shadow:
0 7px 8px -4px rgba(0, 0, 0, 0.2),
0 5px 22px 4px rgba(0, 0, 0, 0.12),
0 12px 17px 2px rgba(0, 0, 0, 0.14);
/* Relevant code*/
border:3px solid transparent; /* Control the thickness*/
background:
/* Cover only the padding area*/
linear-gradient(#fff,#fff) padding-box,
/* Cover the border area */
linear-gradient(#3fb4e4,#3fb4e4) left border-box no-repeat;
background-size:50px 100%;
transition:0.6s;
}
.notification:hover {
background-size: 100px 100%;
}
<div class="notification">Hello</div>

Why not just add a border on the container itself:
.notification {
position: fixed;
top: 32px;
right: 32px;
width: 460px;
height: 150px;
border-radius: 36px;
box-shadow: 0 7px 8px -4px rgba(0, 0, 0, 0.2), 0 5px 22px 4px rgba(0, 0, 0, 0.12), 0 12px 17px 2px rgba(0, 0, 0, 0.14);
background-color: white;
z-index: 999999;
border-left: 3px solid #3fb4e4;
}

Related

Jquery auto complete hover css

Hi im trying to style my jquery autocomplete, all is well but when i tried to hover on the items its displaying on a bottom left side of my page, any suggestions to fix this? here is my css code.
.ui-autocomplete {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
float: left;
display: none;
min-width: 160px;
padding: 4px 0;
margin: 0 0 10px 25px;
list-style: none;
background-color: #ffffff;
border-color: #ccc;
border-color: rgba(0, 0, 0, 0.2);
border-style: solid;
border-width: 1px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
*border-right-width: 2px;
*border-bottom-width: 2px;
}

Blur the join of 2 borders of different colors?

I have a div with borders with different colors. The design that im working towards blends the point at which these 2 borders join. Can this be done with CSS?
<div class="panel">
dfds
</div>
body {
background: green;
}
.panel {
margin: auto;
width: 300px;
height: 300px;
background: white;
border-radius: 10px;
padding: 10px;
border-right: 6px solid #D7D7D7;
border-bottom: 6px solid #B9B9B9;
box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
}
http://codepen.io/anon/pen/XJEWqp
Below you can see the bottom right corner has a sharp diagonal join:
This is the same detail in the design that im creating:
Howsabout this:
body {
background: green;
}
.panel {
margin: auto;
width: 100px;
height: 100px;
background: white;
border-radius: 10px;
padding: 10px;
-webkit-box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2)
, inset -6px 0px 0 rgba(255, 0, 0, 0.5)
, inset 0px -6px 0 rgba(0, 0, 255, 0.5);
-moz-box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2)
, inset -6px 0px 0 rgba(255, 0, 0, 0.5)
, inset 0px -6px 0 rgba(0, 0, 255, 0.5);
box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2)
, inset -6px 0px 0 rgba(255, 0, 0, 0.5)
, inset 0px -6px 0 rgba(0, 0, 255, 0.5);
}
<div class="panel">
dfds
</div>
Used red and blue to highlight the overlapping
You can use a border-image for this purpose.
div {
margin: 30px;
width: 50px;
height: 50px;
background: #DDD;
border: 10px solid transparent;
-webkit-border-image: url('http://i.imgur.com/7qsGJvm.png') 30 30 round;
-o-border-image: url(http://i.imgur.com/7qsGJvm.png'') 30 30 round;
border-image: url('http://i.imgur.com/7qsGJvm.png') 30 30 round;
}
<div></div>

CSS - Variations of DIV settings?

I am using the same CSS sheet for all the html pages on our website.
This is the CSS container:
#Container {
position: relative;
top: 5px;
width: 1000px;
height: 600px;
margin: 0 auto 0;
background: #FFF;
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 10px rgba(0, 0, 0, 0.1) inset;
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 10px rgba(0, 0, 0, 0.1) inset;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 10px rgba(0, 0, 0, 0.1) inset;
border-color: #CCC;
-moz-border-radius: 0px 0px 20px 20px;
border-radius: 0px 0px 20px 20px;
}
This is fine on all the pages except one, which needs the height to be 1000px.
How would I make a variation of the code for one page, instead of copying the entire container settings again for the one html page?
On the page in question give the body a class e.g. 'myPage' then add the below to your css
body.mypage #container{
height:1000px;
}

CSS circles with text inline

I'm trying to make a couple of css circles with text inside in one line. When I use circle class to img, circles are inline, but I cannot add any text. When I use circle class to div, I can add text, but they don't display inline, even when I add display:inline to circle class.
CSS
img.galeria{
border-style: solid;
border-width: 3px;
border-color: yellow;
width: 12%;
height: 75.825%;
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
box-shadow: 0 0 8px rgba(0,0,0, .8);
-webkit-box-shadow: 0 0 8px rgba(0, 0, 0, .8);
-moz-box-shadow: 0 0 8px rgba(0,0,0, .8);
margin-right: 2%;
}
HTML for the first option (img)
<img class="galeria" src="../images/backgrounds/light-blue.png"/>
HTML for the second option (div)
<div class="galeria"/>text
What am I doing wrong?
In your style, replace display: inline; with display:inline-block;. It worked for me!
Try this
.galeria {
border-style: solid;
border-width: 3px;
border-color: yellow;
width: 50px;
height: 50px;
text-align:center;
line-height:50px;
background:url('...imgsrc.jpg');
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
box-shadow: 0 0 8px rgba(0, 0, 0, .8);
-webkit-box-shadow: 0 0 8px rgba(0, 0, 0, .8);
-moz-box-shadow: 0 0 8px rgba(0, 0, 0, .8);
}
You say that you tried display: inline, but it isn't in your code.
If you try it, it works
.galeria{
border-style: solid;
border-width: 3px;
border-color: yellow;
width: 12%;
height: 75.825%;
border-radius: 50%;
box-shadow: 0 0 8px rgba(0,0,0, .8);
-webkit-box-shadow: 0 0 8px rgba(0, 0, 0, .8);
-moz-box-shadow: 0 0 8px rgba(0,0,0, .8);
margin-right: 2%;
display: inline;
}
demo

css background-position not working in IE 7 and 8

This page renders great in FF, Chrome, etc.. However in IE 7 and 8, the close "X" which is a background image does not line up. Any ideas? I tried to set the background-position etc..
The code I have:
.startup-container
{
width: 455px;
}
.close-startup-home
{
background: #c00 url("http://spotlightonhealthyliving.com/btn_closex.png") 0px -8px no-repeat;
float: right;
height: 52px;
width: 60px;
}
.menu-outer
{
background: #545454;
-moz-border-radius:5px;
border-radius:5px;
-moz-box-shadow: 0px 0px 5px 3px rgba(0, 0, 0, .4);
box-shadow: 0px 0px 5px 3px rgba(0, 0, 0, .4);
}
.menu-inner
{
background: #3f3f3f;
-moz-box-shadow: inset 0px 0px 4px 3px rgba(0, 0, 0, .1);
box-shadow: inset 0px 0px 4px 3px rgba(0, 0, 0, .1);
-moz-border-radius:5px;
border-radius:5px;
}
.startup-box
{
width:439px;
line-height:20px;
text-align: center;
color:#fff;
padding-top:5px;
padding-bottom:5px;
}
.startup-box-inner
{
width:389px;
height:99px;
padding:20px;
margin-left:5px;
margin-right:5px;
}
<div class="startup-container">
<div class="close-startup-home"></div>
<div class="menu-outer startup-box">
<div class="menu-inner startup-box-inner"></div>
</div>
</div>
Give a position: absolute to your div containing the close button and position it according to that.
.startup-container {
width: 455px;
position: relative
}
.close-startup-home {
background: #c00 url("http://spotlightonhealthyliving.com/btn_closex.png") 0px -8px no-repeat;
float: right;
height: 52px;
width: 60px;
position: absolute;
right: 0;
}

Resources