Trouble arises with the right-to-left alignment of the drop down in the <select> form within the Ionic

I have been struggling with an RTL form issue, specifically with the <select> element. Despite successfully making all labels and inputs RTL, the <select> dropdown appears on top of its label. I have spent hours attempting to position it to the left of the label.

Here is the initial appearance:

RTL Form

After countless hours, I was able to adjust it to look like this:

RTL Form after CSS modification for select element

Although I successfully positioned it to the left of the label, the arrow now overlaps the label!

This small form is driving me insane.

Below is the HTML code:

 <div class="list list-inset">
                 <form name="registrationForm" class="parent">
  <div class="item item-divider">
    المعلومات الشخصية
  </div>
  <label class="item item-input">
    <span class="input-label">الإسم</span>
    <input type="text" name="nameInput" ng-model="newUser.first_name" required>
    </label>
  <label class="item item-input">
    <span class="input-label">الإيميل</span>
    <input class="emailinput" type="email" name="emailInput" ng-model="newUser.email" required>
  </label>
    <label class="item item-input item-select">
    <span class="input-label">المدينة</span>
    <select ng-model="newUser.billing_address.state" name="cityInput" ng-init="newUser.billing_address.state='الرياض'" required>
      <option>الرياض</option>
      <option>جدة</option>
      <option>الدمام</option>
    </select>
  </label>
</div>

This is the CSS for the initial case:

.parent {
  direction: rtl;
  text-align: right;
}
.parent span{

  direction: ltr;
}

This is the additional CSS I implemented to achieve the appearance in the second image:

.item-select select

{

  right: auto;
    top: 0px;
    width: 350px;
    direction: rtl;

}

Any suggestions would be greatly appreciated. Thank you!

Answer №1

If you're encountering a similar problem, here's a solution that may help:

.item-select select {
padding: 0 16px 0 48px;
right: auto;
left: 0;
direction: rtl;
width: 350px
}

.item-select:after {
left: 16px;
right: auto;
}

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

Determine if the HTML Application Cache is void

Our website uses a "manifest.appcache" file to manage the application cache. Some pages are designed to be accessed offline, so they have references in the html tag to the manifest, while others do not. Is there a way to determine if the cache is empty ac ...

How can I ensure that the size of the Dropdown Menu Item matches its parent in both Bootstrap and CSS styles?

I am working on a navigation bar that has a dropdown menu which appears on hover. I want the size of the dropdown menu items to match the size of the parent element. Here is an image for reference: https://i.stack.imgur.com/oNGmZ.png Currently, the "One ...

Executing JavaScript function from external SVG file globally

I am working on an HTML page that includes an external JavaScript module <script type="text/javascript" src="js/js.js"></script> and also an external SVG map called "img/map.svg". My goal is to create clickable objects on the map that will t ...

How to retrieve information from a pre-populated <textarea> using Google Maps script in AngularJS

Is there a way to transfer data from a prefilled <textarea> that is populated by accessing the Google Maps API in a JavaScript script, into an AngularJS controller? $scope.Add=function(msg){ $log.log(msg) } <div ng-app=""> <div ng-contro ...

What is the best way to add an ellipsis to the conclusion of a paragraph using .dotdotdot?

I'm struggling with implementing the ellipsis function on my website. My goal is to have the ellipsis appear at the end of each paragraph in the news_inner div (morgan, pia, and gold). I found the function on , but I'm having difficulty understan ...

CSS- The ultimate guide to perfectly centering a webpage without the need for extra margins!

Our SharePoint 2013 generated web page has a width of 1024. The main content div is styled as follows: #container_master { width:1024px !important; margin-left: auto !important; margin-right: auto !important; background-color:#FFF !impor ...

My image is being cropped on larger screens due to the background-size: cover property

I am currently in the process of designing a website with a layout consisting of a Header, Content, and Footer all set at 100% width. To achieve a background image that fills the screen in the content section, I utilized CSS3 with background-size:cover pr ...

Ways to prevent a div containing a lengthy content string from extending beyond other divs

Check out my Codepen project here Here is the HTML code for my personal website: <div id="splash" class="divider"> <h1 class="text-center text-uppercase">vincent/rodomista</h1> <p class="text-center text uppercase">Full Stack ...

Width of flex container overflowing from relative position is at its full capacity

I'm attempting to create a horizontal line across an overflowing flex container by using an absolutely positioned child element with both the left and right set to 0. This requires the container to have a relative position to contain the absolutely po ...

Changing the background of a Muitextfield input element conceals the label

Struggling to customize the Textfield from the global theme? Can't seem to achieve a colored background for the input only (white) without obscuring the label when it moves inside the input. Desired result : https://i.sstatic.net/us2G7.png Current o ...

PHP implementation for a static header layout

I am interested in learning how to update content without refreshing the header. I have created a simple example below. Header.php <html> <head> </head> <body> <ul> <li><a href="index.php" ...

Material-UI React Native components: Injecting Styles without Props

import {createStyles, WithStyles} from "@material-ui/core"; const styles = (theme: Theme) => createStyles({ root: {} }); interface MyProps extends WithStyles<typeof styles> { } export class MyComponent extends Component<MyProps ...

Animate the rotation of specific paths within the SVG

I've designed an SVG using Illustrator and I have a specific animation in mind for it. My goal is to create an animation where the upper part of the circle line rotates from left to right (considering that there are 4 circle lines, with number one st ...

Guide to transferring text to clipboard using PHP and JS

Forgive me if this sounds a bit silly. I've been trying to figure this out for a while now, and it seems like the only solution I found involves clicking some sort of button. I have a form that generates license keys, and after generating one, I wan ...

Understanding the Intrinsic Dimensions of Replaced Elements in CSS

I'm currently facing some challenges with the CSS Intrinsic & Extrinsic Sizing Module Level 3, specifically chapter 4.1 on Intrinsic Sizes. This section is proving to be quite difficult for me: When a block-level or inline-level replaced element h ...

Is it possible to programmatically bind a click event to each individual word in a div element?

I'm attempting to link each word within an element without altering the markup inside the element using Javascript. ...

Ways to eliminate the white background placed behind the arrow on my bootstrap carousel

I've been attempting to create a video carousel using Bootstrap 5, and one issue I'm encountering is the appearance of a white background when hovering over the arrow. Normally, it shouldn't display a background, but for some reason, it does ...

The Jquery AJAX request does not seem to be functioning properly as it consistently triggers the error function

Currently, I am in the process of developing a reset password page. However, I am encountering an issue when attempting to submit the data to the backend via an AJAX call, as it consistently redirects to the error function. Despite my attempts to troublesh ...

Loading an empty CSS file in Node.js

Just starting out with node.js, and I could really use some help with a small css and image issue that I'm facing. I've streamlined my html and .js for clarity. Despite trying everything, the css and image just won't load. My form and server ...

jquery expanding the width of the final element

Is there a way to increase the width of the last 'th' in a string? I want it to be the current width plus 20px. Here is the code on Fiddle var header="<th id='tblHeader_1' style='width: 80px;'><span>Id</span&g ...