Tips for centering or aligning text on MobileSafari iPad1

I am trying to center or align the text and placeholder of an input field. While this works in most browsers using the text-align property, it seems to fail on mobile Safari for iPad 1. The main text itself aligns correctly, but the placeholder text remains on the left side consistently.

You can view the fiddle here: input-text-alignment

Is there a solution to aligning the placeholder text on iPad 1?

Answer №1

form input {
    height: 40px;
    width: 200px;
    font-size: 18px;
    font-weight: bold;
    border: 1px solid gray;
    text-align: center;

}

form {
    margin:auto;
    font-size: 18px;
    font-weight: bold;
    text-align: right;
}

Answer №2

Unfortunately, I do not currently have an iPad available for testing. However, considering that Safari utilizes the web-kit engine, you could experiment with the following code snippet:

::-webkit-input-placeholder{
text-align:right;
}

Answer №3

Consider adjusting the display properties of your input element to potentially resolve any issues you are experiencing. For example, try adding display: inline-block;.

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

What could be the reason for the meta viewport not functioning properly on Android devices with Cordova 5.1.1?

Ever since upgrading my app to cordova 5.1.1, I've noticed that the meta viewport no longer functions properly on Android devices. The app is not displaying correctly as a result. Despite trying various solutions, I am still facing this issue. Is ther ...

Tips for embedding a file within a text box in HTML and enabling users to make direct edits

I am currently working on a feature that allows users to open a .txt or .html file from their file explorer and paste the contents into a textarea for editing and saving purposes. My question is whether it's possible to read the file content and auto ...

How can I optimize webkit-mask-box-image with a high-resolution Retina image?

Hey there, wondering if it's possible to achieve high-quality Retina-level CSS masking with the -webkit-mask-box-image property. Specifically, I'm trying to round the corners of an element without using border-radius due to performance issues: . ...

Use PHP to evaluate code within quotation marks on a PHP file

Need help with displaying a dynamic variable inside an HTML element within a PHP if conditional. <?php $url = $thumb['0']; if ( in_category( 'News' )) { //nothing here } else { echo '<div class="image-holder&qu ...

Ways to delete a CSS attribute with jquery

Is there a way to eliminate a CSS property from a class without setting it to null? Let's say I have a class called myclass with the property right:0px. I want to completely remove right:0px from my class, not just set it to null. How can I achieve th ...

Adjust the content of a table cell using jQuery

<td>09 Mars 2020</td> Using the string above, I have created a div. Here are the Jquery variables I am working with: date1 = 09 Mars 2020 date2 = 18 Mars 2020 My goal is to combine the content from another date with the existing date to ach ...

What is the process for showing a duplicate image in a dialog box once it has been selected on an HTML page?

I am experiencing an issue where the dialog box is displaying when I use the button tag, but not when I use the image tag. Can someone please assist? <img src='image.png' height='200px' widht='200px' id='1'> ...

Placing buttons on top of a video within a div container

I am facing a challenge with implementing custom controls on a video embedded in my webpage. I have tried setting a div to absolute position for the buttons, but they are not clickable. Is there a way to achieve this without using jQuery? I need the butto ...

Play around with my design

I'm having trouble with my styling and need some assistance. Specifically, I want to make sure that my page_content_div appears under my header instead of below the right and left carousel controls. I tried using float:left on the page_content_div, bu ...

Enhancing the security of login procedures

My current admin login code allows access to loginhome.php only if the correct username and password are entered. However, I have realized that this approach is not secure as anyone can directly visit mywebsite/loginhome.php without logging in or use the b ...

Using jQuery to loop through divs, identify unique ones, and then add text from a specified value to a span element

I've been delving into the world of jQuery, asking numerous questions and providing some answers as a beginner myself. Currently, I have a good understanding of how to utilize jQuery for tasks such as adding CSS styles to a div and inserting text into ...

JavaScript - Locate and substitute particular words

Currently, I am facing the task of finding and replacing certain text on my online store website using CS. Specifically, I need to locate ,90 in the pricing section and replace it with superscript tags <sup>90</sup>. The current display of the ...

How to use HTML and CSS to resize images from a tileset

I need to resize an image that I am pulling from a tile set, originally sized at 50px x 50px. Is there a way to enlarge this image without adjusting the background size property? Perhaps by placing the image into a div and resizing the div instead? img.ti ...

Altering the dimensions of radio buttons

I am a newcomer to using material-ui. I am currently working on incorporating radio buttons in a component and would like to reduce its size. While inspecting it in Chrome, I was able to adjust the width of the svg icon (1em). However, I am unsure how to a ...

Styles applied in the child component will have a cascading effect on the entire webpage

My webpage is divided into two parts: child1 and child2. Page Hierarchy: Parent Child1 Child2 Here are the CSS styles included in the page: Child1 -> z-index: 1 Child2 -> z-index: 2 What I want to achieve is to add a backdrop to the entire ...

PHP page showcasing a dynamic list of products

Hello, I am fairly new to this platform. I have a question regarding how to display product data dynamically from a database in one row with 4 different products side by side rather than in one column. <div class="row"> <div class="col-sm-12 co ...

Discovering a particular string within a jQuery array object: Tips and tricks

One thing that is confusing me is the jQuery array object. To explain further: I have two arrays, one called brandsLink and the other called floorLink. When a user clicks on a link, I am saving the brand name in a variable called brandName, and then checki ...

How to display validation without jquery form appearing

Validation is set up to work - when the user clicks on search without entering a reference number, the validation message pops up along with the empty form. The form stays empty because nothing was entered into the input field. What I want is for only the ...

The arrangement of <source> tags within the <audio> element can cause issues with browser compatibility

I'm having a slight issue with the audio files on my webpage. I've set up both MP3 and Ogg Vorbis files using FFmpeg to ensure compatibility with modern browsers. However, I've noticed that Safari only plays the audio when the MP3 file is li ...

Ajax - Trouble with Updating DIV Content

As a beginner in AJAX, I am encountering difficulties creating a simple AJAX program. My goal is to have a button that, when clicked, changes the text of the div below it. Despite numerous attempts, I have not been able to identify the issue. Below is the ...