I have problem with make process steps. It should look like this: http://imgur.com/a/fpMjy
I have problem with this "arrows", how to make border dashed?
How can I make to use different color on each step?
What I have:
.step > p {
margin: 0;
}
.step {
border: 1px solid #000;
text-align: center;
padding: 10px 10px 10px 30px;
min-width: 180px;
float: left;
position: relative;
background: #ebeef0;
}
.step:after,
.step:before {
content: " ";
position: absolute;
top: 0;
right: -17px;
width: 0;
height: 0;
border-top: 27px solid transparent;
border-bottom: 27px solid transparent;
border-left: 17px solid #ebeef0;
z-index: 2;
transition: border-color 0.2s ease;
}
.step:before {
border-top: 27px solid transparent;
border-bottom: 28px solid transparent;
border-left: 16px solid #000;
}
.actual-step {
background: #cfd6d9;
}
.actual-step:after {
border-left: 17px solid #cfd6d9;
}
.step-description {
font-size: 13px;
}
<div class="row text-center">
<div class="col-md-4 step actual-step">
<p class="step-number">Krok 1</p>
<p class="step-description">Podaj nazwę użytkownika</p>
</div>
<div class="col-md-4 step">
<p class="step-number">Krok 2</p>
<p class="step-description">Weryfikacja konta</p>
</div>
<div class="col-md-4 step">
<p class="step-number">Krok 3</p>
<p class="step-description">Zakończenie rejestracji</p>
</div>
</div>
https://jsfiddle.net/100dLq22/
.step > p {
margin: 0;
}
.step {
border: 1px dashed #000;
text-align: center;
padding: 10px 10px 10px 30px;
min-width: 180px;
float: left;
position: relative;
background: #ebeef0;
}
.step:after {
content: "";
position: absolute;
top: 9px;
right: -20px;
width: 40px;
transform: rotate(45deg);
height: 40px;
background-color: #ebeef0;
border-top: 1px dashed black;
border-right: 1px dashed black;
transition: border-color 0.2s ease;
}
.actual-step {
background: #cfd6d9;
}
.actual-step:after {
background-color: #cfd6d9;
}
.step-description {
font-size: 13px;
}
#step1:after {
z-index: 2;
}
#step2:after {
z-index: 4;
}
<div class="row text-center">
<div class="col-md-4 step actual-step" id="step1">
<p class="step-number">Step 1</p>
<p class="step-description">Etiam ullamcorper.</p>
</div>
<div class="col-md-4 step" id="step2">
<p class="step-number">Step 2</p>
<p class="step-description">Etiam ullamcorper.</p>
</div>
<div class="col-md-4 step">
<p class="step-number">Step 3</p>
<p class="step-description">Etiam ullamcorper.</p>
</div>
</div>
Related
I would like to create a Responsive vertical timeline as shown below.
sorry, I am backend developer not that strong in CSS.
I was able to achieve something as shown below
Currently, I am looking for help in positioning my div left right as shown in picture one.
I am planing to use bootstrap and fa Icon
My CSS:
$text-color: #373737;
$gray-base: #494949;
$gray-darker: #222;
$gray-dark: #333;
$gray: #555;
$gray-light: #777;
$gray-lighter: #eee;
$brand-primary: #1f9eba;
$brand-success: #59ba1f;
$brand-info: #5bc0de;
$brand-warning: #d1bd10;
$brand-danger: #ba1f1f;
/* Timeline */
.timeline {
list-style: none;
padding: 20px;
position: relative;
&:before {
top: 40px;
bottom: 0;
position: absolute;
content: " ";
width: 3px;
background-color: #eeeeee;
left: 50%;
margin-left: -1.5px;
}
.timeline-item {
margin-bottom: 20px;
position: relative;
&:before,
&:after {
content: "";
display: table;
}
&:after {
clear: both;
}
.timeline-badge {
color: #fff;
width: 54px;
height: 54px;
line-height: 52px;
font-size: 22px;
text-align: center;
position: absolute;
top: 18px;
left: 50%;
margin-left: -25px;
background-color: $gray-dark;
border: 3px solid #ffffff;
z-index: 100;
border-top-right-radius: 50%;
border-top-left-radius: 50%;
border-bottom-right-radius: 50%;
border-bottom-left-radius: 50%;
i,
.fa,
.glyphicon {
top: 2px;
left: 0px;
}
&.primary {
background-color: $brand-primary;
}
&.info {
background-color: $brand-info;
}
&.success {
background-color: $brand-success;
}
&.warning {
background-color: $brand-warning;
}
&.danger {
background-color: $brand-danger;
}
}
.timeline-panel {
position: relative;
text-align: right;
width: 46%;
float: left;
right: 16px;
// border: 1px solid $gray-light;
background: #ffffff;
border-radius: 2px;
padding: 20px;
-webkit-box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
&:before {
position: absolute;
top: 26px;
right: -16px;
display: inline-block;
border-top: 16px solid transparent;
border-left: 16px solid $gray-light;
border-right: 0 solid $gray-light;
border-bottom: 16px solid transparent;
// content: " ";
}
.timeline-title {
margin-top: 0;
color: inherit;
}
.timeline-body > p,
.timeline-body > ul {
margin-bottom: 0;
}
.timeline-body > p + p {
margin-top: 5px;
}
}
}
.timeline-item:last-child {
&:nth-child(even) {
float: right;
}
}
.timeline-item:nth-child(even) {
.timeline-panel {
float: right;
text-align: left;
left: 16px;
&:before {
border-left-width: 0;
border-right-width: 14px;
left: -14px;
right: auto;
}
}
}
}
// .timeline-horizontal:extend(.timeline) {
// list-style: none;
// position: relative;
// padding: 20px 0px 20px 0px;
// display: inline-block;
// &:before {
// height: 3px;
// top: auto;
// bottom: 26px;
// left: 56px;
// right: 0;
// width: 100%;
// margin-bottom: 20px;
// }
// .timeline-item {
// display: table-cell;
// height: 280px;
// width: 20%;
// min-width: 320px;
// float: none !important;
// padding-left: 0px;
// padding-right: 20px;
// margin: 0 auto;
// vertical-align: bottom;
// .timeline-panel {
// top: auto;
// bottom: 64px;
// display: inline-block;
// float: none !important;
// left: 0 !important;
// right: 0 !important;
// width: 100%;
// margin-bottom: 20px;
// &:before {
// top: auto;
// bottom: -16px;
// left: 28px !important;
// right: auto;
// border-right: 16px solid transparent !important;
// border-top: 16px solid $gray-light !important;
// border-bottom: 0 solid $gray-light !important;
// border-left: 16px solid transparent !important;
// }
// }
// &:before,
// &:after {
// display: none;
// }
// .timeline-badge {
// size: 3em;
// top: auto;
// bottom: 0px;
// left: 43px;
// }
// }
// }
My HTML:
<div class="row">
<div class="col-md-12">
<div class="page-header">
<h1>Timeline</h1>
</div>
<ul class="timeline">
<li class="timeline-item">
<div class="timeline-badge">
<fa-icon [icon]="faCheck"></fa-icon>
</div>
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title">Mussum ipsum cacilds 1</h4>
<p><small class="text-muted"><i class="glyphicon glyphicon-time"></i> 11 hours ago via Twitter</small></p>
</div>
</div>
<div style="float: right; position: relative;text-align: right;"> Hello </div>
</li>
<li class="timeline-item">
<div class="timeline-badge"><i class="glyphicon glyphicon-check"></i></div>
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title">Mussum ipsum cacilds 2</h4>
<p><small class="text-muted"><i class="glyphicon glyphicon-time"></i> 11 hours ago via Twitter</small></p>
</div>
<div class="timeline-body">
<p>Test</p>
</div>
</div>
</li>
<li class="timeline-item">
<div class="timeline-badge"><i class="glyphicon glyphicon-check"></i></div>
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title">Mussum ipsum cacilds 3</h4>
<p><small class="text-muted"><i class="glyphicon glyphicon-time"></i> 11 hours ago via Twitter</small></p>
</div>
<div class="timeline-body">
<p>Test Content 1 </p>
<p>Test Content 2 </p>
</div>
</div>
</li>
<li class="timeline-item">
<div class="timeline-badge"><i class="glyphicon glyphicon-check"></i></div>
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title">Mussum ipsum cacilds 4</h4>
<p><small class="text-muted"><i class="glyphicon glyphicon-time"></i> 11 hours ago via Twitter</small></p>
</div>
<div class="timeline-body">
<p>Test </p>
</div>
</div>
</li>
</ul>
</div>
</div>
Note: I took this sample from https://codepen.io/wdmg/pen/ZWmwNM
Any help is much appreciated.
This works for me
Result
Code:
<html><body>
<style>
.bold{font-weight:bold;}
.time{position:absolute; left:-110px;}
.timeline-wrapper {
padding-left:80px;
min-width: 400px;
font-family: 'Helvetica';
font-size: 14px;
/*border: 1px solid #CCC;*/
}
.StepProgress {
position: relative;
padding-left: 45px;
list-style: none;
}
.StepProgress::before {
display: inline-block;
content: '';
position: absolute;
top: 0;
left: 15px;
width: 10px;
height: 100%;
border-left: 2px solid #CCC;
}
.StepProgress-item {
position: relative;
counter-increment: list;
}
.StepProgress-item:not(:last-child) {
padding-bottom: 20px;
}
.StepProgress-item::before {
display: inline-block;
content: '';
position: absolute;
left: -30px;
height: 100%;
width: 10px;
}
.StepProgress-item::after {
content: '';
display: inline-block;
position: absolute;
top: 0;
left: -37px;
width: 12px;
height: 12px;
border: 2px solid #CCC;
border-radius: 50%;
background-color: #FFF;
}
.StepProgress-item.is-done::before {
border-left: 2px solid green;
}
.StepProgress-item.is-done::after {
/*content: "?";*/
font-size: 10px;
color: #FFF;
text-align: center;
border: 2px solid green;
background-color: green;
}
/*.StepProgress-item.current::before {
border-left: 2px solid green;
}
.StepProgress-item.current::after {
content: counter(list);
padding-top: 1px;
width: 19px;
height: 18px;
top: -4px;
left: -40px;
font-size: 14px;
text-align: center;
color: green;
border: 2px solid green;
background-color: white;
}*/
.StepProgress strong {
display: block;
}
</style>
<div class="timeline-wrapper">
<ul class="StepProgress">
<li class="StepProgress-item is-done">
<div class="bold time">10:00 Am</div>
<div class="bold">Step 1</div>
</li>
<li class="StepProgress-item is-done">
<div class="bold time">11:00 Am</div>
<div class="bold">Step 2</div>
<div>En proceso</div>
</li>
<li class="StepProgress-item current">
<div class="bold time">12:00 Pm</div>
<div class="bold">Step 3</div>
</li>
<li class="StepProgress-item">
<div class="bold time">01:00 Pm</div>
<div class="bold">Step 4</div>
</li>
<li class="StepProgress-item">
<div class="bold time">02:00 Pm</div>
<div class="bold">Step 5</div>
</li>
</ul>
</div>
</body></html>
HOME This is the code I have.
<div class="row">
<div class="col-sm">
</div>
<div class="col-sm">
<p align="center" class="savings-calculator-p">SAVINGS CALCULATOR</p>
</div>
<div class="col-sm">
</div>
</div>
How to make the UI like the below one
Like This
A bit of CSS trickery and you get an almost exact replica of what you are after.
*You can play around with the settings to get the look you want. See the 2 images for examples.
Pure & Simple - Quick & Easy CSS
No external scripts or javaScrtipt required. :)
body {
padding-top: 15px;
}
.myContent {
border: 0.8px solid #ddd;
}
#myPage .savings {
position: relative;
border: 1px solid #ddd;
border-bottom: none;
border-radius: 8px 8px 0 0;
box-shadow: 0 0 4px #ccc;
font-size: 14px;
text-align: center;
font-weight: bold;
color: #777;
font-family: arial;
margin: 0 auto;
padding: 8px 10px 6px 10px;
max-width: 180px;
}
#myPage .savings:after,
#myPage .savings:before {
position: absolute;
left: 50%;
top: 100%;
border: solid transparent;
content: "";
}
#myPage .savings:before {
margin-left: -14px;
border-width: 20px;
border-top-color: #eee;
}
#myPage .savings:after {
border-top-color: #ffffff;
border-width: 16px;
margin-left: -10px;
}
<div id="myPage">
<div class="savings">
SAVINGS CALCULATOR
</div>
<div class="myContent">
</div>
</div>
Try this and you're done...
p.savings-calculator-p {
background-color: #EEE;
width: max-content;
padding: 5px 20px;
margin: auto;
margin-top: 20px;
border-radius: 5px;
position: relative;
filter: drop-shadow(0px 0px 2px rgba(0,0,0,0.4));
}
p.savings-calculator-p:after {
display: block;
content: '';
position: absolute;
top: 70%;
left: 0;
right: 0;
margin: auto;
background: #EEE;
width: 20px;
height: 20px;
z-index: -1;
transform: rotateZ(45deg);
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row">
<div class="col-sm">
</div>
<div class="col-sm">
<p align="center" class="savings-calculator-p">SAVINGS CALCULATOR</p>
</div>
<div class="col-sm">
</div>
</div>
Use this tool to generate a custom css - http://www.cssarrowplease.com/, or use the below code snippet
.arrow_box {
font-size: 12px;
text-align: center;
max-width: 200px;
margin: 0 auto;
padding: 10px;
position: relative;
background: #ffffff;
font-family: sans-serif;
border: 1px solid #cccccc;
}
.arrow_box:after, .arrow_box:before {
top: 100%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.arrow_box:after {
border-color: rgba(255, 255, 255, 0);
border-top-color: #ffffff;
border-width: 10px;
margin-left: -10px;
}
.arrow_box:before {
border-color: rgba(204, 204, 204, 0);
border-top-color: #cccccc;
border-width: 11px;
margin-left: -11px;
}
<div class="arrow_box">
SAVINGS CALCULATOR
</div>
I guess this will be helpful for you.
$(document).ready(function(){
$('.col-sm-4').on('mouseover', function(ev) {
$('.savings-calculator-p').addClass('show');
$('.savings-calculator-p').css('left', ev.clientX - 80 + 'px');
})
$('.col-sm-4').on('mousemove', function(ev) {
$('.savings-calculator-p').css('left', ev.clientX - 80 + 'px');
})
$('.col-sm-4').on('mouseleave', function(ev) {
$('.savings-calculator-p').removeClass('show')
})
})
.row {
position: relative;
display: flex;
}
.col-sm-4 {
flex: 1;
display: flex;
justify-content: center;
margin-top: 50px;
}
.savings-calculator-p {
font-size: 12px;
display: inline-block;
text-align: center;
max-width: 200px;
margin: 0 auto;
padding: 10px;
position: fixed;
background: #ffffff;
font-family: sans-serif;
border: 1px solid #cccccc;
transition: all 0.3s ease;
opacity: 0;
visibility: visible;
}
.show {
opacity: 1;
visibility: visible;
}
.savings-calculator-p:after, .savings-calculator-p:before {
top: 100%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.savings-calculator-p:after {
border-color: rgba(255, 255, 255, 0);
border-top-color: #ffffff;
border-width: 10px;
margin-left: -10px;
}
.savings-calculator-p:before {
border-color: rgba(204, 204, 204, 0);
border-top-color: #cccccc;
border-width: 11px;
margin-left: -11px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="row">
<p align="center" class="savings-calculator-p">SAVINGS CALCULATOR</p>
<div class="col-sm-4">
Header 1
</div>
<div class="col-sm-4">
Header 2
</div>
<div class="col-sm-4">
Header 3
</div>
</div>
Use Bootstrap popover and always show it
Since you are already using bootstrap, you should go for popover. It is concise and hence easy to maintain.
$('.popover-visible') .popover('show') .off('click');
<div class="container">
<div class="row pt-5">
<div class="col-sm ">
</div>
<div class="col-sm popover-visible mt-5"
data-container="body"
data-toggle="popover"
data-placement="top"
data-content="SAVINGS CALCULATOR">
<p align="center" class="savings-calculator-p">CURRENT SAVING DONE(R)</p>
</div>
<div class="col-sm">
</div>
</div>
</div>
https://codepen.io/anon/pen/wYJERz
This my code, I having problem with my css. I have added photo to describe my issue , i hope that make issue clear.
<div class="col-xs-12 col-sm-6 col-md-3" style="margin-top: 20px;">
<div class="col-item" >
<div class="post-img-content">
<img src="<?php echo $post['p_image']; ?>" style="width: 100%; height: 100%;" class="img-responsive" />
<span class="post-title">
<b class="pull-left"><?php echo $post['p_title']?></b>
</span>
</div>
<div>
<div class="info" >
<div class="row">
<div class="col-md-12"></div>
<div class="price col-md-6">
<h5><b><?php echo $post['p_category']?></b></h5>
</div>
<div class=" hidden-sm col-md-6">
<h5 style="text-align: right;"><b ><?php echo $post['u_name']?></b></h5>
</div>
<div class=" hidden-sm col-md-12">
<h5><b>Date : </b><?php echo $post['p_date']?></h5>
</div>
</div>
<div class="separator clear-left">
<p style="text-align: left;">
<i class="fa fa-eye"></i>View</p>
</div>
<div class="clearfix">
</div>
</div>
</div>
</div>
</div>
and this is css i m using for above code
.col-item
{
border: 1px solid #E1E1E1;
border-radius: 10px;
background: #FFF;
}
.col-item:hover
{
box-shadow: 0px 2px 5px -1px #000;
-moz-box-shadow: 0px 2px 5px -1px #000;
-webkit-box-shadow: 0px 2px 5px -1px #000;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 10px;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
border-bottom:2px solid #52A1D5;
}
.col-item .photo img
{
margin: 0 auto;
width: 100%;
padding: 1px;
border-radius: 10px 10px 0 0 ;
}
.col-item .info
{
padding: 10px;
border-radius: 0 0 5px 5px;
margin-top: 1px;
}
.col-item .price
{
/*width: 50%;*/
float: left;
margin-top: 5px;
}
.col-item .price h5
{
line-height: 20px;
margin: 0;
}
.price-text-color
{
color: #219FD1;
}
.col-item .separator
{
border-top: 1px solid #E1E1E1;
}
.clear-left
{
clear: left;
}
.col-item .separator p
{
line-height: 20px;
margin-bottom: 0;
margin-top: 10px;
text-align: center;
}
.col-item .separator p i
{
margin-right: 5px;
}
.col-item .btn-add
{
width: 50%;
float: left;
}
.col-item .btn-add
{
border-right: 1px solid #E1E1E1;
}
.col-item .btn-details
{
width: 50%;
float: left;
padding-left: 10px;
}
.controls
{
margin-top: 20px;
}
[data-slide="prev"]
{
margin-right: 10px;
}
/*
Hover the image
*/
.post-img-content
{
height: 196px;
position: relative;
}
.post-img-content img
{
position: absolute;
padding: 1px;
border-radius: 10px 10px 0 0 ;
}
.post-title{
display: table-cell;
vertical-align: bottom;
z-index: 2;
position: relative;
}
.post-title b{
background-color: rgba(51, 51, 51, 0.58);
display: inline-block;
margin-bottom: 5px;
margin-left: 2px;
color: #FFF;
padding: 10px 15px;
margin-top: 10px;
font-size: 12px;
}
.post-title b:first-child{
font-size: 14px;
}
.round-tag{
width: 60px;
height: 60px;
border-radius: 50% 50% 50% 0;
border: 4px solid #FFF;
background: #37A12B;
position: absolute;
bottom: 0px;
padding: 15px 6px;
font-size: 17px;
color: #FFF;
font-weight: bold;}
`this img when i put the mouse over div
i need help for this issue and i hope you guys help me.
I am trying to do sharp corners in css, it works only 50%, if you check the jsfiddle you will notice that on border top left and top right on the blue ribbon banner a remaining border which should not be there. How can I remove that border?
http://jsfiddle.net/XSs9L/699/
HTML
<div class="wrap_post_course">
<div class="ribbon_banner mega_course"><span class="name_type"><span class="tl"></span><span class="tr"></span>MEGA COURSES</span>
</div>
<div class="post_item post_item_courses post_item_courses_3 post_format_standard odd">
<div class="course-preview -course post_content ih-item colored square effect_dir left_to_right">
<div class="course-image post_featured img">
<a href="http://newskillsacademy.co.uk/course/ultimate-writing-course/"><img width="331" height="166" sizes="(max-width: 331px) 100vw, 331px" srcset="http://newskillsacademy.co.uk/wp-content/uploads/2016/04/writing-course-1-331x166.jpg 331w, http://newskillsacademy.co.uk/wp-content/uploads/2016/04/writing-course-1-75x39.jpg 75w"
alt="Writing Course" class="attachment-homepage-thumb size-homepage-thumb wp-post-image" src="http://newskillsacademy.co.uk/wp-content/uploads/2016/04/writing-course-1-331x166.jpg"></a>
</div>
<div class="course-meta">
<header class="course-header">
<h5 class="nomargin">The Ultimate Writing Course</h5>
</header>
</div>
<div class="course-price product-price">
<div class="price-text"><del><span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">£</span>598.00</span></del> <ins><span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">£</span>399.00</span></ins></div>
</div>
<section class="find-more-now">
FIND OUT MORE
</section>
</div>
</div>
</div>
CSS
.ribbon_banner {
float: right;
position: relative;
width: 75px;
z-index: 99;
}
.ribbon_banner span.name_type {
background: #17a9ce none repeat scroll 0 0;
box-shadow: 0 3px 5px -7px rgba(0, 0, 0, 1);
color: #fff;
display: block;
font-size: 16px;
font-weight: bold;
line-height: 20px;
margin-left: -50px;
margin-top: 29px;
padding: 5px;
position: absolute;
text-align: center;
text-transform: uppercase;
transform: rotate(45deg);
width: 152px;
}
.ribbon_banner span.name_type:before {
content: "";
position: absolute;
left: 0px;
top: 100%;
z-index: -1;
border-color: #17a9ce transparent transparent #17a9ce;
border-style: solid;
border-width: 3px;
}
.ribbon_banner span.name_type:after {
content: "";
position: absolute;
right: 0px;
top: 100%;
z-index: -1;
border-color: #17a9ce transparent transparent #17a9ce;
border-style: solid;
border-width: 3px;
}
.ribbon_banner .tl,
.ribbon_banner .tr,
.ribbon_banner .bl,
.ribbon_banner .br {
width: 0;
height: 0;
position: absolute;
}
.ribbon_banner .tl {
top: 0;
left: 0;
border-top: 24px solid #f4f7f9;
border-right: 24px solid transparent;
}
.ribbon_banner .tr {
top: 0;
right: 0;
border-top: 24px solid #f4f7f9;
border-left: 24px solid transparent;
}
.wrap_post_course {
display: inline-block;
margin: 40px;
width: 335px;
}
it seems to be a bug when rendering a rotated element because there is no such effect when the degree is 0. So I suggest to move .tr and .tl one pixel outer to wrap the effect.
.ribbon_banner {
float: right;
position: relative;
width: 75px;
z-index: 99;
}
.ribbon_banner span.name_type {
background: #17a9ce none repeat scroll 0 0;
box-shadow: 0 3px 5px -7px rgba(0, 0, 0, 1);
color: #fff;
display: block;
font-size: 16px;
font-weight: bold;
line-height: 20px;
margin-left: -50px;
margin-top: 29px;
padding: 5px;
position: absolute;
text-align: center;
text-transform: uppercase;
transform: rotate(45deg);
width: 152px;
}
.ribbon_banner span.name_type:before {
content: "";
position: absolute;
left: 0px;
top: 100%;
z-index: -1;
border-color: #17a9ce transparent transparent #17a9ce;
border-style: solid;
border-width: 3px;
}
.ribbon_banner span.name_type:after {
content: "";
position: absolute;
right: 0px;
top: 100%;
z-index: -1;
border-color: #17a9ce transparent transparent #17a9ce;
border-style: solid;
border-width: 3px;
}
.ribbon_banner .tl,
.ribbon_banner .tr,
.ribbon_banner .bl,
.ribbon_banner .br {
width: 0;
height: 0;
position: absolute;
}
.ribbon_banner .tl {
top: -1px;
left: -1px;
border-top: 24px solid #f4f7f9;
border-right: 24px solid transparent;
}
.ribbon_banner .tr {
top: -1px;
right: -1px;
border-top: 24px solid #f4f7f9;
border-left: 24px solid transparent;
}
.wrap_post_course {
display: inline-block;
margin: 40px;
width: 335px;
}
<div class="wrap_post_course">
<div class="ribbon_banner mega_course"><span class="name_type"><span class="tl"></span><span class="tr"></span>MEGA COURSES</span>
</div>
<div class="post_item post_item_courses post_item_courses_3 post_format_standard odd">
<div class="course-preview -course post_content ih-item colored square effect_dir left_to_right">
<div class="course-image post_featured img">
<a href="http://newskillsacademy.co.uk/course/ultimate-writing-course/"><img width="331" height="166" sizes="(max-width: 331px) 100vw, 331px" srcset="http://newskillsacademy.co.uk/wp-content/uploads/2016/04/writing-course-1-331x166.jpg 331w, http://newskillsacademy.co.uk/wp-content/uploads/2016/04/writing-course-1-75x39.jpg 75w"
alt="Writing Course" class="attachment-homepage-thumb size-homepage-thumb wp-post-image" src="http://newskillsacademy.co.uk/wp-content/uploads/2016/04/writing-course-1-331x166.jpg"></a>
</div>
<div class="course-meta">
<header class="course-header">
<h5 class="nomargin">The Ultimate Writing Course</h5>
</header>
</div>
<div class="course-price product-price">
<div class="price-text"><del><span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">£</span>598.00</span></del> <ins><span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">£</span>399.00</span></ins></div>
</div>
<section class="find-more-now">
FIND OUT MORE
</section>
</div>
</div>
</div>
I want to make div like triangle. I describe clear my question by images in blow.
my code is:
<div class="rest_pack">
<img width="100%" src="<?= Yii::$app->request->baseUrl . '/files/upload/3.png' ?>">
<div class="row side_info">
<div class="top">
ساندویچ مخصوص
</div>
<div class="bottom">
5,500
تومان
</div>
</div>
</div>
css:
.rest_pack .side_info{
position: absolute;
width: 100%;
background-color: #FFF;
top: 100px;
opacity: 0.8;
}
.rest_pack .side_info .top{
text-align: center;
font-weight: bold;
font-size: 17px;
color: #3131AA;
padding-top:5px;
}
.rest_pack .side_info .bottom{
text-align: center;
font-weight: bold;
font-size: 16px;
color: #F63440;
padding-top:5px;
}
The result is:
but I want something like this.
I want to make red DIV.
Got it from CSS Tricks https://css-tricks.com/snippets/css/css-triangle/
<div class="arrow-up"></div>
<div class="arrow-down"></div>
<div class="arrow-left"></div>
<div class="arrow-right"></div>
CSS goes here :
.arrow-up {
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid black;
}
.arrow-down {
width: 0;
height: 0;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
border-top: 20px solid #f00;
}
.arrow-right {
width: 0;
height: 0;
border-top: 60px solid transparent;
border-bottom: 60px solid transparent;
border-left: 60px solid green;
}
.arrow-left {
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-right:10px solid blue;
}
Just change values and you get whatever Triangle you want
You can do it using :after selector and border-left, border-bottom to adjust triangle as you need.
like this:
.title{
position: absolute;
padding:25px;
bottom:0;
right:0;
z-index:1;
}
div {
position: relative;
width: 500px;
height: 300px;
background-image: url("http://i.stack.imgur.com/ys1Jo.png");
}
div:after {
position: absolute;
content: '';
width: 0;
height: 0;
bottom: 0;
border-left: 500px solid transparent;
border-bottom: 130px solid rgb(0, 114, 255);
-moz-transform: scale(0.999);
-webkit-backface-visibility: hidden;
}
<div class="test">
<span class="title">Enter Text Here</span>
</div>
Please try below code
HTML
<div class="main">
<a rel="nofollow" href="http://i.stack.imgur.com/ys1Jo.png"><img alt="enter image description here" src="http://i.stack.imgur.com/ys1Jo.png"> </a>
</div>
CSS
.main { border: 1px solid red; border-radius: 5px 0 5px 5px; }