3

I have this element with this style added:

.checkout-step.current .number {
  background-color: #d26d51;
  outline: 1px solid #d26d51;
  outline-offset: 4px;
}

enter image description here

But I not want square corners in the outline, I want round the corners, like this example: enter image description here

How can I do this?

Funny Frontend
  • 3,807
  • 11
  • 37
  • 56

3 Answers3

6

My approach is as follows. Please check JSFiddle. I have added following HTML.

<a href="#">2</a>

I have added following css.

a {
  background: #999;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  text-decoration: none;
  color: #fff;
  display: inline-block;
  line-height: 40px;
  position: relative;
  border: 2px solid #000;
  text-align: center;
}
a:after {
  content: '';
  display: block;
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: -10px;
  right: -10px;
  border-radius: 30px;
  border: 2px solid #f00;
}
Harshal Sawant
  • 607
  • 3
  • 7
-1

Use border-radius property to do this. http://www.w3schools.com/cssref/css3_pr_border-radius.asp

-1

**use this code **
outline we cant use radius property Instead of outline make as border and radius so i changed code like this Try This .

Html

<div class="usecode"><div class=".checkout-step.current .number">2</div></div>

css

    .checkout-step.current .number {
      background-color: #d26d51;
     margin:15px;

      }

.usecode
 {
 border:1px solid #d26d51;
border-radius:25px !important;
 }
Raj Rana
  • 90
  • 6