.vertical {
height: 0;
border-left: 122px solid transparent;
border-right: 108px solid rgba(0, 0, 0, .0001);
border-top: 100px solid #222222;
/* width: 13px; */
position: absolute;
/* text-align: center; */
/* vertical-align: middle; */
margin-left: 40%;
z-index: -99;
margin-top: -86px;
}
Vertical
How do i make this responsive bottom arrow of navigation
Here try this
Markup
<ul class="nav">
<li class="nav-item">Portfolio</li>
<li class="nav-item">About</li>
<li class="nav-item is-active">Blog</li>
<li class="nav-item">Get in Touch</li>
</ul>
SCSS
$nav-background: #2a2a2a;
$nav-item-padding: 10px;
$nav-item-color: #c0c0c0;
$nav-item-active-color: #f1f1f1;
.nav {
height: 60px;
background-color: $nav-background;
display: flex;
justify-content: center;
align-items: center;
font-family: arial;
}
.nav-item {
list-style: none;
padding: $nav-item-padding;
color: $nav-item-color;
&.is-active {
color: $nav-item-active-color;
background: darken($nav-background, 20%);
border-radius: 4px;
position: relative;
&:after {
content: "";
width: 0;
height: 0;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
border-top: 30px solid $nav-background;
position: absolute;
bottom: 0;
left: 50%;
transform: translate(-50%, 100%);
}
}
}
https://jsfiddle.net/robi_osahan/fj6at1cd/
Related
I'm trying to draw a circle with tick/checkmark inside it using pure css3
.success-checkmark {
content: '✔';
position: absolute;
left:0; top: 2px;
width: 17px; height: 17px;
border: 1px solid #aaa;
background: #f8f8f8;
border-radius: 50%;
box-shadow: inset 0 1px 3px rgba(0,0,0,.3)
}
How can i achieve i have tried with the above code?
You can use content: '✔'; only on pseudo elements, so try using the following selector:
.success-checkmark:after {
content: '✔';
position: absolute;
left:0; top: 2px;
width: 20px;
height: 20px;
text-align: center;
border: 1px solid #aaa;
background: #f8f8f8;
border-radius: 50%;
box-shadow: inset 0 1px 3px rgba(0,0,0,.3)
}
<div class="success-checkmark"></div>
.wrapper {
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
}
.circle {
position: relative;
background: #00B01D;
border-radius: 100%;
height: 120px;
width: 120px;
}
.checkMark {
position: absolute;
transform: rotate(50deg) translate(-50%, -50%);
left: 27%;
top: 43%;
height: 60px;
width: 25px;
border-bottom: 5px solid #fff;
border-right: 5px solid #fff;
}
<div class="wrapper">
<div class="circle">
<div class="checkMark"></div>
</div>
</div>
I found a template online to which I made modifications. Kindly check if this works for you.
:root {
--borderWidth: 7px;
--height: 25px;
--width: 12px;
--borderColor: white;
}
body {
padding: 20px;
text-align: center;
}
.check {
display: inline-block;
transform: rotate(45deg);
height: var(--height);
width: var(--width);
border-bottom: var(--borderWidth) solid var(--borderColor);
border-right: var(--borderWidth) solid var(--borderColor);
}
.behind {
border-radius: 50%;
width: 40px;
height: 40px;
background: black;
}
<div class="behind">
<div class="check">
</div>
</div>
css
.success-checkmark:after {
content: '✔';
position: absolute;
text-align: center;
line-height:20px;
}
vertical adjustment
line-height:20px;<--- adjust vertical alignment
.success-checkmark:after {
content: '✔';
position: absolute;
text-align: center;
line-height:20px;
width: 90px;
height: 90px;
border: 1px solid #aaa;
background: #f8f8f8;
border-radius: 50%;
box-shadow: inset 0 1px 3px rgba(0,0,0,.3)
}
<div class="success-checkmark"></div>
I'm trying to create a button.
How can I create a border left like this image?
<a class="genericBtn">
<span>Click Me</span>
</a>
.genericBtn {
cursor: pointer;
background: #ffffff;
color: #c40009;
border: 1px solid #c40009;
font-size: 20px;
margin: 10px 0 0;
padding: 20px 50px 20px 50px;
width: auto;
}
You can consider a gradient coloration for the left side:
.genericBtn {
cursor: pointer;
background: #ffffff;
color: #c40009;
border: 1px solid #c40009;
/**/
border-left:none;
background:linear-gradient(to bottom,#c40009 20%,transparent 20%,transparent 80%,#c40009 0) left/1px 100% no-repeat;
/**/
font-size: 20px;
margin: 10px 0 0;
padding: 20px 50px 20px 50px;
display:inline-block;
}
<a class="genericBtn">
<span>Click Me</span>
</a>
Another syntax for the same effect:
.genericBtn {
cursor: pointer;
background: #ffffff;
color: #c40009;
border: 1px solid #c40009;
/**/
border-left:none;
background:
linear-gradient(#c40009,#c40009) top left,
linear-gradient(#c40009,#c40009) bottom left;
background-size:1px 20%;
background-repeat:no-repeat;
/**/
font-size: 20px;
margin: 10px 0 0;
padding: 20px 50px 20px 50px;
display:inline-block;
}
<a class="genericBtn">
<span>Click Me</span>
</a>
A quick hack with :before
.genericBtn {
position: relative;
cursor: pointer;
background: #ffffff;
color: #c40009;
border: 1px solid #c40009;
font-size: 20px;
padding: 0 50px;
height: 50px;
display: inline-block;
width: auto;
line-height: 50px;
}
.genericBtn:before {
position: absolute;
top: 10px;
left: -1px;
width: 1px;
height: 30px;
background: #fff;
content: "";
display: block
}
<a class="genericBtn">
<span>Click Me</span>
</a>
Adjust heights according to requirements.
I'm trying to create a CSS based value chain look-a-like:
After doing a little research I could find out, that I should use pseudo elements. So I managed to add them, but I can't make them overlap each other.
(Don't mind the colors, I'm using them for dev purposes.)
li {
display: inline-block;
background: #c3c3c3;
width: 70px;
padding: 13px 0 10px;
text-align: center;
font-family: sans-serif;
}
.chain-link {
position: relative;
}
.chain-link:after,
.chain-link:before {
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
top: 0;
}
.chain-link:after {
border-color: rgba(0, 0, 0, 0);
border-left-color: black;
border-width: 20px;
margin-left: 35px;
}
.chain-link:before {
border-color: rgba(0, 0, 0, 0);
border-left-color: white;
border-width: 20px;
margin-left: -35px;
}
.chain-link:first-child:before {
border-left-color: red;
}
.chain-link:last-child:after {
border-left-color: yellow;
}
<ul>
<li class="chain-link">10</li>
<li class="chain-link">20</li>
<li class="chain-link">30</li>
<li class="chain-link">40</li>
</ul>
Can anyone help? Any help appreciated.
demo - http://jsfiddle.net/7t9ruxgr/
li {
display: inline-block;
background: #c3c3c3;
width: 70px;
padding: 13px 0 10px;
text-align: center;
font-family: sans-serif;
text-align: center;
}
.chain-link {
position: relative;
}
.chain-link:after,
.chain-link:before {
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
top: 0;
}
.chain-link:after {
border-color: transparent transparent transparent #c3c3c3;
margin-left: 35px;
border-width: 20px 16px 21px 20px;
margin-left: 35px;
z-index: 2;
}
.chain-link:before {
border-color: rgba(0, 0, 0, 0);
border-left-color: white;
border-width: 20px;
margin-left: -35px;
}
<ul>
<li class="chain-link">10</li>
<li class="chain-link">20</li>
<li class="chain-link">30</li>
<li class="chain-link">40</li>
</ul>
I created arrow(triangle)-style breadcrumbs with CSS, no images.
jsFiddle
html:
<ul class="breadcrumb">
<li>Home</li>
<li>First item</li>
<li>Second item</li>
<li>Last item</li>
</ul>
css:
.breadcrumb {
list-style: none;
overflow: hidden;
}
.breadcrumb li {
background: #F6F6F6;
padding: 5px 0 5px 36px;
background: #F6F6F6;
position: relative;
display: block;
float: left;
}
.breadcrumb li:before {
content:" ";
display: block;
width: 0;
height: 0;
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 20px solid #DDDDDD;
position: absolute;
top: 50%;
margin-top: -25px;
margin-left: 1px;
left: 100%;
z-index: 1;
}
.breadcrumb li:after {
content:" ";
display: block;
width: 0;
height: 0;
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 20px solid #F6F6F6;
position: absolute;
top: 50%;
margin-top: -25px;
left: 100%;
z-index: 2;
}
The problem is when parent's width is not enough to display breadcrumbs in 1 line and it takes 2 lines (or more), overflow:hidden stops working and unwanted parts of triangles get visible (http://screencloud.net/v/fQEq).
Is there a way to fix that?
Try with this style:
.breadcrumb {
list-style: none;
overflow: hidden;
}
.breadcrumb li:before {
border-bottom: 15px solid transparent;
border-left: 20px solid #dddddd;
border-top: 15px solid transparent;
content:" ";
display: block;
height: 0;
left: 100%;
margin-left: 1px;
margin-top: -15px;
position: absolute;
top: 50%;
width: 0;
z-index: 1;
}
.breadcrumb li:after {
border-bottom: 15px solid transparent;
border-left: 20px solid #f6f6f6;
border-top: 15px solid transparent;
content:" ";
display: block;
height: 0;
left: 100%;
margin-top: -15px;
position: absolute;
top: 50%;
width: 0;
z-index: 2;
}
.breadcrumb li {
background: none repeat scroll 0 0 #f6f6f6;
display: block;
float: left;
height: 20px;
padding: 5px 0 5px 33px;
position: relative;
}
Hope it helps!
How to add arrow shaped under active tab?
.nav-tabs2 .active { background-image:url(http://www.asiarooms.com/assets/themes/v1/images/areas/details/menu-arrow.png); background-repeat:no-repeat; background-position:bottom center; }
http://jsfiddle.net/DJHZb/13/
<div class="box-head tabs">
<ul class="nav2 nav-tabs2">
<li class="active">
Active Tab</li>
<li>Inactive Tab</li>
<li>Inactive Tab #2</li>
</ul>
</div>
Take a look at "css speech bubble" the idea is the same: http://nicolasgallagher.com/pure-css-speech-bubbles/demo
You have to mess with pseudo css ::after and ::before (which doesn't work in some IE), and borders to create a square or an triangle that overlapping each other.
Example:
.active::after {
content: "";
position: absolute;
bottom: -15px;
left: 50px;
border-width: 15px 15px 0;
border-style: solid;
border-color: #F3961C transparent;
display: block;
width: 0;
}
Here is an explanation how to create triangle with a box and border: http://www.sitepoint.com/pure-css3-speech-bubbles/
For a code like this (which uses bootstrap):
<body>
<div class="panel panel-primary">
<div class="panel-heading" style="font-size:large">
Klujo
</div>
<div class="panel-body">
<div class="wizard">
<a >
Step 1<br>
Authorize the app
</a>
<a class="active">
Step 2<br>
Post your jobs
</a>
</div>
</div>
</div>
</body>
you can use css like this:
.wizard a {
background: #efefef;
display: inline-block;
margin-right: 5px;
min-width: 150px;
outline: none;
padding: 10px 40px 10px;
position: relative;
text-decoration: none;
}
.wizard .active {
background: #007ACC;
color: #fff;
}
.wizard a:before {
width: 0;
height: 0;
border-top: 25px inset transparent;
border-bottom: 35px inset transparent;
border-left: 20px solid #fff;
position: absolute;
content: "";
top: 0;
left: 0;
}
.wizard a:after {
width: 0;
height: 0;
border-top: 35px inset transparent;
border-bottom: 25px inset transparent;
border-left: 21px solid #efefef;
position: absolute;
content: "";
top: 0;
right: -20px;
z-index: 2;
}
.wizard a:first-child:before,
.wizard a:last-child:after {
border: none;
}
.wizard a.active:after {
border-left: 21px solid #007ACC;
}
to get the desired result
</body>
<style>
.tool {
position: relative;
display: inline-block;
border-bottom: 1px dotted red;
}
.tool .text {
visibility: hidden;
width: 100%;
background-color: blue;
color: white;
text-align: center;
border-radius: 5px;
padding: 5px 0;
position: absolute;
top: -1px;
left: 110%;
}
.tool .text::after {
content: "";
position: absolute;
top: 10%;
right: 99%;
margin-top: -2px;
border-width: 5px;
border-style: solid;
border-color: transparent blue transparent transparent;
}
.tool:hover .text {
visibility: visible;
}
</style>
<div class="tool">Mouse Hover
<span class="text">I Can pop up on the right side of these words</div>
</body>