Warning: This data is provided under the Google User Data Policy. Please review and comply with the policy. Failure to do so may result in project suspension or account suspension.

Change One Tap prompt position

By default, on desktop web browsers, One Tap prompt is displayed at the top right corner of the window. You can display the One Tap prompt inside a container element, by specifying the DOM ID of the container element into the data-prompt_parent_id attribute.

The following code example reuses the g_id_onload element as the container element, and displays One Tap prompt in the specified position:

<div id="g_id_onload"
     data-client_id="YOUR_GOOGLE_CLIENT_ID"
     data-login_uri="https://your.domain/your_login_endpoint"
     data-prompt_parent_id="g_id_onload"
     style="position: absolute; top: 100px; right: 30px;
         width: 0; height: 0; z-index: 1001;">
</div>

The data-prompt_parent_id attribute will be ignored on mobile web browsers.