-4

I've been banging this problem for hours and still can't figure out how to achieve this arrow right type sidebar. I want the look of my sidebar like this. Sidebar UI I want to achieve

How can I achieve that arrow right sidebar? Is there similar code that I can used as basis?

Code101
  • 1
  • 3

2 Answers2

2

 .right-arrow {
 display: inline-block;
 position: relative;
 background: orange;
 padding: 20px;
}
.right-arrow:after {
 content: '';
 display: block;  
 position: absolute;
 left: 100%;
 top: 0;
 width: 0;
 height: 0;
 border-top: 20px solid transparent;
 border-right: 20px solid transparent;
 border-bottom: 20px solid transparent;
 border-left: 20px solid orange;
}
<div class="right-arrow"></div>
S.Bose
  • 46
  • 3
0

This can be done with the help of pseudo class ":before or :after"

li { width:200px; background:green; list-style-type:none; margin-bottom:20px; padding:5px; color:#fff; position:relative;}
li:before {
  content:"";
  position:absolute; 
  right:-14px; top:0px;
  width: 0; 
  height: 0; 
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 14px solid green;
}
<ul>
 <li>1</li>
  <li>2</li>
  <li>3</li>
  <li>4</li>
  <li>5</li>
  <li>6</li>
  <li>7</li>
  </ul>
Shahil M
  • 3,836
  • 4
  • 25
  • 44