unwanted border when using background-url, I added the background-url because I needed to add triangle but couldn’t achieve that using only html and css so I created a design in figma with a while triangle and put it in html.
html:
<div class="p-dialog-header-icons ng-tns-c71-0">
<button type="button" tabindex="-1" pripple="" class="ng-tns-c71-0 p-dialog-header-icon p-dialog-header-close p-link p-ripple ng-star-inserted"><span class="p-dialog-header-close-icon pi pi-times" ng-reflect-ng-class="pi pi-times"></span></button>
</div>
css:
.p-dialog-header-icons::before {
width: 31px;
height: 31px;
background-color: red;
background-image: url("/assets/triangle.svg");
content: "";
display: block;
position: absolute;
top: 0;
right: 0;
}
2
Answers
You can get the desired effect with a CSS gradient
My first idea is this ;
Instead of this ;
Try this;
Secondly, I think about this ;
Change the background position ( the red part) and size for the clean left part of image. for example;
Find the one which is fit you;
https://cssreference.io/property/background-size/#:~:text=background%2Dsize%3A%20contain%3B,sure%20it%20remains%20fully%20visible.&text=background%2Dsize%3A%20cover%3B,the%20element%20is%20fully%20covered.
Last one is use all of them together ;