banner image is on the right side

0

How do I make the image to be on the right side of the div? See below:

ThecodeI'mtryinghereisthis:

<divclass="img img-responsive" style="background-color: #1F356A;" align="right"> 
   <div style="background-image: url('banner/banner.png'); height: 100px;  margin-top: -23px; line-height: 100px; color: #BCA828; font-family: Arial; font-size: 48px; text-align: center">
       HISTÓRIA
    </div>
</div>
    
asked by anonymous 26.07.2017 / 21:02

2 answers

1

To do this use the background-position property with the value right , following example:

seletor{
    background-position: right;
}

As you want to position the background of the element, not the element itself, float: right does not work!

    
26.07.2017 / 21:38
0

Use the FlexBox to adjust your elements with incredible simplicity!

.sua-classe-pai {
  display: flex;
  justify-content: flex-end; // flex-start é o padrão // center centraliza...
}

I recommend researching more about it!

    
26.07.2017 / 21:32