css3 - CSS:Fix image outside the body of container -


i have fix blue colored 'lock' image outside of container below:

enter image description here

so far have achieved below:

enter image description here

i setting image background-image of container , css container wrote is:

.container{ margin: 0 auto; max-width: 620px; background-color: $white; box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2); object-fit: contain; margin-top: 30px; padding: 40px; min-height: 100px; object-fit: contain; overflow: hidden; border-radius: 5px; background-repeat: no-repeat; background-image: url("../lock.svg"); }   <body> <div class="container">  </div> </body> </html> 

if give background-position, image hiding behind container,

enter image description here

please advice how achieve this? approach correct?

if want set lock button depending on container, have set relative position container , absolute position button.

then set top , right property button depending on container.

.container {     position: relative; }  .button {     position: absolute;     top: px;     right: px; } 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -