The peculiar actions of the CSS border property on the input element

Currently, I'm in the process of adjusting the appearance of my text field inputs within a contact form. My intention is to have only a bottom border visible, and while this displays correctly in Chrome, the same cannot be said for Safari on mobile devices where the entire border remains visible. To visually illustrate this discrepancy, please refer to the images provided below.

Chrome Version 91.0.4472.114 (MacOS)
https://i.sstatic.net/jw5zNl.png

The text field appears as intended with no issues on Chrome.

Safari iOS 14.6 https://i.sstatic.net/03PtJl.jpg

In comparison, when viewed on my mobile device via Safari, some portions of the top corners of the border are still visible, and the bottom border seems slightly curved, making it less aesthetically pleasing.

css

export const TextField = styled.input`
   width: 100%;
   background: #131d32;   
   border: none;
   border-bottom: 1px solid rgba(200, 200, 200, 0.7); 
   min-height: 35px;
   color: white;
   outline: 0;
   border-width: 0 0 2px;         
   :focus {        
       border-width: 0 0 1px;  
   }`;

Answer №1

Please make sure to set the border-radius property to 0;

export const CustomInput = styled.input`
   width: 100%;
   background: #131d32;
   border: none;
   border-bottom: 1px solid rgba(200, 200, 200, 0.7);
   min-height: 35px;
   color: white;
   outline: 0;
   border-width: 0 0 2px;
   border-radius: 0; // Ensure this is set to 0
   :focus {
       border-width: 0 0 1px;
   }`;

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

Gap between two div elements side by side

Take a look at this simple code - fiddle here. The CSS is as follows: .subcontent > div { display: table-cell; } .orangebox { width: 55%; background-color: red; padding-top: 6px; } .bluebox { width: 43%; background-color: blue; ...

Streamlined Navigation Bar Design for Websites

Struggling with aligning all the navbar options in a single row. Here is an example: https://jsfiddle.net/knyx2u8h/ ` Example Domain <meta charset="utf-8" /> <meta http-equiv="Content-type" content="text/html; char ...

The process is not functioning effectively

I've been attempting to submit this form, but for some reason it's not functioning correctly. The processor in jQuery : function processForm(id) { jQuery(function() { var $ = jQuery; $('.sp-poll-'+id+' form' ...

Positioning the CSS to place the bottom of the box directly on top of another box while keeping any overflow

Alright, here's what I have in my HTML: <div class="wrapper"> <div class="help_box">some text</div> <div id="unique_title">Some Title<div class="help">?</div> </div> I've got a JS setup that mak ...

Can you explain how to modify the hover color of a word with select letters already colored using CSS?

Changing colors of a link before and during hover state One problem I'm facing is having a link where the first and last letters are red while the ones in between are black. This color combination should remain the same, even if the link has been vis ...

"Enhancing the Spacing of Elements Using Margin and Padding in a Floating

I'm facing an issue with adding margins and padding to my paragraph tag. This problem seems to be related to floating the img element to the left. I am trying to position the paragraph on the right side of the image while adding both left and right pa ...

Is there a way to reorganize the image/text grid using a media query?

In my grid, each row contains text in one column and an image in the other. The order of these columns is determined by the user in a CMS and can vary for each row. https://i.sstatic.net/MwR5O.png On mobile devices, I always want the image to appear abov ...

Modifying the Vue.js Vue3-slider component for custom color schemes

Currently, I am using the vue-slider component and would like to customize the color of the slider itself. The specific class that needs to be styled is "vue-slider-dot-tooltip-inner". Below is a screenshot displaying the original CSS styling for vue-slid ...

CSS: Positioning footer at the bottom of ASP webpages (not fixed to the bottom of the screen)

After researching various methods for positioning footers in webpages using CSS, I have come across several solutions, including some on Stack Overflow. However, it seems that most of these approaches do not work with ASP pages. Therefore, my question is: ...

Attempting to replicate the action of pressing a button using Greasemonkey

I am currently working on a greasemonkey script to automate inventory updates for a group of items directly in the browser. I have successfully implemented autofill for the necessary forms, but I am facing challenges with simulating a click on the submissi ...

The comparison between AJAX and JSON passing and PHP generating HTML versus returning it

Currently, my code looks like this: <li onclick = " function CBAppData( callerObj, data ) { var string = ''; for( a in data ) { debug.push( data[ ...

What could be causing my buttons to not line up properly?

My buttons are refusing to line up horizontally for some unknown reason. I can't figure out what the issue is. They are all set to display as inline-block elements. The first image shows a website with the correctly aligned buttons, while the second o ...

Dynamic font sizing in CSS allows text on a webpage to

I am working on creating a dynamic screen using AngularJS. Within this screen, there are objects with a specific size: .item { margin: auto; margin-bottom: 10px; width: 11vw; height: 11vw; text-overflow: ellipsis; overflow: hidden; } These i ...

How can the Flickr API be utilized with JavaScript functions?

In preparation for a project, we are required to utilize the Flickr API in order to display a collection of photos when a specific category is selected. I have successfully set up my categories on the left side of a flexbox container. However, I am struggl ...

I am attempting to increase the date retrieved from my database by three years

I need assistance with updating dates in my PHP script. I want to add 3 years to the date stored in the database for each record. Specifically, I need to retrieve the date when a certain class was first taken (date_aerial) and then return a new date by add ...

The document scales down automatically as I decrease the size of the window, but does not adjust when I switch to a mobile viewport

I've been working on developing a web app with a focus on mobile-first design. When I scale down my Chrome window, everything looks responsive and functions well, adjusting objects to fit the smaller screen size. However, I noticed that when I switch ...

Datetimepicker cannot be displayed on this bootstrap version

I am looking to implement a datetime picker for a textbox, but I suspect that I am missing some necessary Bootstrap links. Could someone please point them out for me? Thank you in advance. <div class="form-group row align-items-center justify-conten ...

The view function is not receiving the dynamic Flask URL variable as expected

Trying to pass a dynamic variable from a Flask route into a view function is causing unexpected behavior. Although this should be a standard feature, the code is displaying odd results. Below is the function in question: @bp.route('/<id>/updat ...

Creating a responsive dropdown submenu with Bootstrap 4, utilizing HTML, CSS, and jQuery

My HTML code includes CSS, jQuery Bootstrap 4 elements. I am attempting to add a dropdown submenu to my main menu when hovering over it. However, I am facing issues in getting the dropdown submenu to work properly. When I hover over main menu items like Co ...

What mechanism does angularjs employ to detect the $dirty state in the absence of a form tag?

I have implemented $window.addEventListener('beforeunload' to detect changes on a page successfully. Additionally, I am using $transitions.onStart... to monitor navigation with the browser buttons. I find it puzzling though, as my HTML template l ...