Setting a fixed size to the background color

This isn’t working:
background-size: 160px 100px;


<div class=" wrap"">

</div>

.wrap {
  position: relative;
  width: 266px;
  height: 168px;
  cursor: pointer;
  margin-top: 8px;
  border: 3px solid #0059dd;
  box-sizing: border-box;
  background:red;
  background-size: 160px 100px;
}

Use…

    background-image: linear-gradient(  to bottom, red 0,  red 100%  );
    background-size: 160px 100px;
    background-repeat: no-repeat;

…instead. :biggrin:

coothead

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.