Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

:after not positioning correctly in Safari

I’ve added a graphic arrow after "Register" in the nav bar. It’s displaying correctly in Chrome, but in Safari it’s in the bottom right of the browser window.

Anyone have some insight? I feel like I’ve tried everything…

Website: https://rtrx.co/

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

.nav-register {
  margin-right: 9px;
}
.nav-register:after {
  content: "";
  background: url("https://rtrx.wpenginepowered.com/wp-content/uploads/2024/01/button-arrow-black.svg") no-repeat;
  background-size: contain;
  display: inline-block;
  height: 1.2222222222222223rem;
  width: 1.2222222222222223rem;
  position: fixed;
  bottom: 20px;
  right: 20px;
}

>Solution :

I think you will find that if you modify it to use position: relative and position: absolute you will get better results

playing around with your linked website, this spacing appears to give the expected result.

.nav-register {
  margin-right: 9px;
  position: relative;
}
.nav-register:after {
  content: "";
  background: url("https://rtrx.wpenginepowered.com/wp-content/uploads/2024/01/button-arrow-black.svg") no-repeat;
  background-size: contain;
  height: 1.2222222222222223rem;
  width: 1.2222222222222223rem;
  position: absolute;
  bottom: 22px;
  right: -20px;
}

As a note to this, there is really no reason you need this to be added
via CSS as it’s just adding an image to a button. Seems like it might
make more sense to just add the image to the html. Feels like using a
hammer with screws to me.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading