1
.upper-menu .search-form::after {
  content: url('../images/search.png');
  position: absolute;
  height: 10px;
  top: 5px;
  right: 22px;
}

I have pseudo-element that looks like this. I would like to change the size of the image by scaling it down 50% so that it works on high-res-screens as well. How can I do this?

BoltClock
  • 665,005
  • 155
  • 1,345
  • 1,328
Himmators
  • 13,568
  • 33
  • 122
  • 214

2 Answers2

0

You simply have to set the width and height property to 50%. This will scale it according to the browser window.

Good Luck!

0

also, you could set the content to empty string and use a background image. Just alternatively...

.upper-menu .search-form::after {
  content: ' ';
  display: inline-block;
  position: absolute;
  background: #bada55 url("img_2x.png") no-repeat;
  background-size: contain;
  height: 10px;
  width: 10px;
  top: 5px;
  right: 22px;
}
Todd
  • 5,173
  • 3
  • 27
  • 45