What is the best way to align this in the middle on iOS?

Screenshot

Greetings, I am facing an issue with centering an element on Apple devices. In the screenshots provided, you can see how it appears on iOS, Android, and a Windows PC. Despite trying various methods, I have been unable to solve the problem. Can you spot any issues in my code or offer any suggestions? Your assistance is greatly appreciated.

Edit: The image at the center of this circle was rounded using Photoshop, no additional code was used. My focus is solely on the centering issue. While everything works fine on Android and PC, it seems like I may be missing specific lines of code for iOS. Centering also fails on Google Chrome for iOS.

Code:

<style>
#rotatingText {
  animation-name: rotate-circle;
  animation-duration: 22s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

u/keyframes rotate-circle {
  to {
    transform: rotate(1turn);
  }
}

 .text {
      font-weight: 300;
      letter-spacing: 3.3px;
      text-transform: uppercase;
      font-family: 'Outfit';
      font-size: 14px;
      fill: white;
      text-shadow: white 1px 0 10px;;
    }

    .main {
      display: grid;
      align-items: center;
      justify-items: center;
    }
  
     .main img {
      position: absolute;
    }

    .main img {
      position: absolute;
      border-radius: 500px;
      z-index: 0;
      box-shadow: rgba(245, 72, 243, 0.3) 1px 0 50px;;
    }
    
</style>

  <a target=”_blank” href="https://9ypjmq3pbhg.typeform.com/to/vz0yqohg">
  <div class="main">
<img class="img1" src="https://polygonstudio.eu/wp-content/uploads/2024/06/imgrotate2.png" width="120" height="50">

<svg id="rotatingText" viewBox="0 0 200 200" width="200" height="200">
  <defs>
    <path id="circle" d="M 100, 100
            m -75, 0
            a 75, 75 0 1, 0 150, 0
            a 75, 75 0 1, 0 -150, 0
            ">
    </path>
  </defs>
  <text width="400">
    <textPath alignment-baseline="top" xlink:href="#circle" class="text">
      Fill out the form - fill out the form -
    </textPath>
  </text>
</svg>
  </div>
  </a>

Despite trying various CSS approaches and searching online for solutions, I have not been able to resolve this issue.

Answer №1

Consider updating your .main styles to:

.main {
  display: flex;
  justify-content: center;
}

#rotatingText {
  animation-name: rotate-circle;
  animation-duration: 22s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes rotate-circle {
  to {
    transform: rotate(1turn);
  }
}

.text {
  font-weight: 300;
  letter-spacing: 3.3px;
  text-transform: uppercase;
  font-family: 'Outfit';
  font-size: 14px;
  fill: white;
  text-shadow: white 1px 0 10px;;
}

.main {
  display: flex;
  justify-content: center;
}

.main img {
  position: absolute;
  border-radius: 500px;
  z-index: 0;
  box-shadow: rgba(245, 72, 243, 0.3) 1px 0 50px;
}
<a target="_blank" href="https://9ypjmq3pbhg.typeform.com/to/vz0yqohg">
  <div class="main">
    <img class="img1" src="https://polygonstudio.eu/wp-content/uploads/2024/06/imgrotate2.png" width="200" height="200">
    <svg id="rotatingText" viewBox="0 0 200 200" width="200" height="200">
      <defs>
        <path id="circle" d="M 100, 100
        m -75, 0
        a 75, 75 0 1, 0 150, 0
        a 75, 75 0 1, 0 -150, 0
        ">
        </path>
      </defs>
      <text width="400">
        <textPath alignment-baseline="top" xlink:href="#circle" class="text">
        Wypełnij formularz - wypełnij formularz -
        </textPath>
      </text>
    </svg>
  </div>
</a>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Automatically changing the color of the navigation bar text

I am experiencing an issue with the navigation bar on my webpage. Currently, it is styled with white text against a dark background color using the following CSS code snippet: a{ color: white; text-decoration:none; font-weight:bold; font-s ...

Utilize JavaScript or JQuery to create a dynamic pop-up window that appears seamlessly on the

Looking to create a unique feature on an HTML page? Want a clickable link that opens a "pop-up" displaying a specific image, right within the page rather than in a new tab or window? Ideally, this pop-up should be movable around the page like a separate ...

Is it possible to switch variations in WP-Commerce from drop-down menus to text input

Currently exploring ways to customize the size variations on an e-commerce website similar to Using WP Commerce, the size variations are originally displayed in select fields by default. <select class="wpsc_select_variation ...

The Regex.Replace function is not functioning as expected

I am currently faced with the challenge of replacing HTML tags within a string. For example, I need to convert <strong>text</strong> to <b>text</b>, among other similar replacements (although I understand that the b tag is considere ...

Encountering an "lldb" error while testing an in-app purchase

Learning something new can be challenging, especially when setting up an in-app purchase for the first time. After struggling with outdated resources and missing project files, I decided to share my process of adding a non-renewing subscription in-app purc ...

I'm encountering an unexpected error as I attempt to incorporate a bootstrap template into my Angular application. What could be causing this issue

I am not very experienced with front-end development, so for my current project, I have decided to utilize a pre-made Bootstrap template. I am in the process of integrating it into my project, relying more on my intuition rather than technical expertise du ...

The alignment of the floating left element is creating conflicts with the styling of other div

As I embark on a design project, I find myself juggling three divs for distinct products, alongside a payment method image div and a copyright div. The product divs are aligned to the left within their specific wrapper, ensuring they center and display sea ...

Conceal All Other Divs upon Clicking on a New Div Bearing the Identical Class

I'm having trouble implementing the feature that closes other divs when I click on a new div with the same class. It seems like it should be straightforward, but for some reason, it's not working for me. Here is the link to the fiddle where I&apo ...

Issue with displaying fonts from @font-face on 000webhost

I recently set up my own website. Originally, I was using webs.com as my hosting provider, but they started adding an ad bar to their html-only hosting which I didn't like. So, I switched over to 000webhost. However, after moving everything to 000webh ...

How come the div element is not rendering the CSS styles?

What could be the reason for .header not displaying the background color and height settings? https://jsfiddle.net/f3puaeq6/1/ .header{ background-color: black; height: 300px; } ...

Discover the height of a UILabel as the number of lines changes in real-time

I am attempting to dynamically calculate the height/space taken up by a UILabel on the screen. The number of lines in the label can vary based on different devices and string internalization, so I need a reliable method to determine its height. I have trie ...

Setting up Bootstrap 4 SCSS with React webpack: A comprehensive guide

Embarking on a new project with ReactJS ES6 and webpack. Utilizing the react-static-boilerplate starter. My main query lies in how to import Bootstrap4 into the build process? Avoiding the use of the generated bootstrap.css file, I aim to have webpack co ...

Is it possible to refine an HtmlNodeCollection by the content of a specific child element's InnerText?

I am working with an HtmlNodeCollection named var searchResults that I extracted from a website using HtmlAgilityPack. Below is a snippet showing 3 Nodes from the collection (there are more of course): /* HTML code snippet here */ My goal is to filter ou ...

What steps can I take to ensure that my website is properly displayed and that my navbar appears beneath the logo on smaller screens? It is currently functioning well on desktops

Currently exploring web development for a new restaurant site, I've encountered an issue with the display on smaller screens. The page doesn't show full width and the navbar disappears entirely. How can I adjust the layout to ensure it looks good ...

Tab Buttons with Scroll Feature

I'm working on a tabpanel that dynamically generates an unknown number of tabs. To accommodate more tabs than the screen size can display, I've added navigation using the margin style instead of fixed widths. However, I'm struggling to move ...

Layering Text onto Images with Bootstrap

Recently, while delving into the world of bootstrap, I encountered a puzzling issue - my text kept overlapping the image. After some trial and error, it became clear that the problem stemmed from either my misuse of the "col" within the row, or the intrica ...

Refresh your textarea content using the replace method in jQuery

My goal is to extract and manipulate specific values within a user-entered code using jQuery. The code includes custom tags called setting, which I want to extract and display in input fields for easy editing. I have successfully retrieved and displayed th ...

Designing a responsive two-column table layout

My current challenge involves a small table structured as a bullet list with two columns. To enhance mobile display, I am seeking a way to collapse it down to a single column: https://i.sstatic.net/LqbA6.png The current implementation includes the follow ...

Issues with CSS columns in Firefox version 22 have been causing some problems

Trying out css columns: implementing columned content with a wrapper div: Click here to view the demo Everything seems to work fine in webkit and older versions, but in Firefox v22 there seems to be an issue (no columns displayed and behavior varies with ...

How can I apply an underline effect when hovering over navigation links in a responsive menu?

I've successfully added an underline effect on hover for the navigation menu. However, I encountered an issue with the responsiveness of the menu. When viewed on screens smaller than 600px, the underline effect covers the entire width of the block ins ...