How to set the banner inside a container?

79 views Asked by At

I am working with flutter. I am trying to add a banner across the container as shown in the image. The have some padding I gave.so it is affect the correct fitting of banner. How I do this banner without affecting the padding of the container like showing in the picture?

2

There are 2 answers

0
Klas On

Add css object fit:

img {
object-fit: contain;
}
1
John Grace On

Create a container element with the desired width and center it on the page. Inside the container, position the banner element using CSS, ensuring it's centered both horizontally and vertically. Customize the banner's appearance, such as background color and text color, to suit your design. Add your banner content, such as text or additional elements, inside the banner element.