0

First is the code that I want to change.

<style>
  h1::after {
    content: url(sig01.png);
  }
</style>

Second is what I tried, but not working.

<style>
    h1::after {
        content: url(sig01.png);
        display: inline-block;
        width: 200px;
        height: 200px;
    }
</style>

What am I doing wrong?

aksappy
  • 3,400
  • 3
  • 23
  • 49
  • You won't be able to do it by using image directly inside content. You can set the image as background and then manipulate the background size instead. Please refer to https://stackoverflow.com/a/8978010/3345535 for an example. – ParaBolt Nov 17 '19 at 17:09
  • please read [mcve] and edit your post accordingly. Its very difficult to understand what is exact problem? what you tried? what error you got? what are the data samples if any etc etc.. things missing in the post. also along with this things elaborate the problem more. – Dev Nov 17 '19 at 19:18
  • Code formatting. – aksappy Nov 18 '19 at 18:14

1 Answers1

1

You can't resize a content-image, but you can work around by using background-image instead of content.

<style>
h1::after {
  content: '';
  display: inline-block;
  width: 200px;
  height: 200px;
  background-image: url(sig01.png);
  background-size: 200px;
}
</style>
Bruce
  • 109
  • 3