Eliminate the bold frame surrounding the input textbox

Objective:
I want to remove the bold frame around the input textboxes, while maintaining a simple and single frame appearance.

Issue:
The boldness of the input textbox frame becomes prominent when using CSS code related to background-image, background-size, and background-position properties.
Removing these three syntax codes will eliminate the bold frame but also hide the icon size and picture display.

I am looking for a solution to keep everything intact without the bold frame on the input textboxes, achieving a clean and straightforward frame design. Is this feasible?

Thank you!

JSbin Link:
With bold frame
https://jsbin.com/bizayukoro/edit?html,css,output

input.date_picker {
  text-align: center;
  
  background-image: url("https://upload.wikimedia.org/wikipedia/commons/7/71/X-office-calendar.svg");
  background-size: 16px 16px;
  background-position: right center;
  
  background-repeat: no-repeat;
  padding-right: 18px;
  width: 78px;
}
<!doctype html>
<!--
Created using JS Bin
http://jsbin.com

Copyright (c) 2021 by anonymous (http://jsbin.com/wibepejeta/3/edit)

Released under the MIT license: http://jsbin.mit-license.org
-->
<meta name="robots" content="noindex">
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>jQuery UI Datepicker - Select a Date Range</title>
  <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <script src="https://code.jquery.com/jquery-1.10.1.js"></script>
  <script src="https://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  <script>

    
    $(function() {
      var today = new Date(),
        weekAgo = new Date(),
        $from = $("#fromDate"),
        $to = $("#toDate");

      var dateFormat = "yy-mm-dd";      
      
      $from.datepicker({     
        changeMonth: true,
        changeYear: true,
        numberOfMonths: 1,
        showButtonPanel: true,
        firstDay: 1, 
        dateFormat: dateFormat,
        maxDate: today,
        onSelect: function(dateText) {
          $to.datepicker("option", "minDate", dateText);
        }
      }).datepicker('setDate', weekAgo);

      $to.datepicker({        
        changeMonth: true,
        changeYear: true,
        numberOfMonths: 1,
        showButtonPanel: true,
        firstDay: 1,
        dateFormat: dateFormat,      
        minDate: today,
        onSelect: function(dateText) {
          $from.datepicker("option", "maxDate", dateText);
        }
      }).datepicker('setDate', today);

    });    

    
  $( function() {
    $( "#datepicker" ).datepicker({
      showOn: "button",
      buttonImage: "images/calendar.gif",
      buttonImageOnly: true,
      buttonText: "Select date"
    });
  } );    
    
  </script>
</head>
<body>
 
  <label for="from">From</label>
  <input type="text" id="fromDate" readonly class="date_picker" />
  <label for="to">to</label>
  <input type="text" id="toDate" readonly class="date_picker" />
  
 
 
</body>
</html>

Answer №1

If you want to get rid of the border, you can simply add border:0; in your CSS. Alternatively, if you prefer a thin border, you can use border: 1px solid;.

input.date_picker {
  text-align: center;
  
  background-image: url("https://upload.wikimedia.org/wikipedia/commons/7/71/X-office-calendar.svg");
  background-size: 16px 16px;
  background-position: right center;
  border: 1px solid;
  background-repeat: no-repeat;
  padding-right: 18px;
  width: 78px;
}
<!doctype html>
<!--
Created using JS Bin
http://jsbin.com

Copyright (c) 2021 by anonymous (http://jsbin.com/wibepejeta/3/edit)

Released under the MIT license: http://jsbin.mit-license.org
-->
<meta name="robots" content="noindex">
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>jQuery UI Datepicker - Select a Date Range</title>
  <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <script src="https://code.jquery.com/jquery-1.10.1.js"></script>
  <script src="https://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  <script>

    
    $(function() {
      var today = new Date(),
        weekAgo = new Date(),
        $from = $("#fromDate"),
        $to = $("#toDate");

      var dateFormat = "yy-mm-dd";      
      
      $from.datepicker({     
        changeMonth: true,
        changeYear: true,
        numberOfMonths: 1,
        showButtonPanel: true,
        firstDay: 1, 
        dateFormat: dateFormat,
        maxDate: today,
        onSelect: function(dateText) {
          $to.datepicker("option", "minDate", dateText);
        }
      }).datepicker('setDate', weekAgo);

      $to.datepicker({        
        changeMonth: true,
        changeYear: true,
        numberOfMonths: 1,
        showButtonPanel: true,
        firstDay: 1,
        dateFormat: dateFormat,      
        minDate: today,
        onSelect: function(dateText) {
          $from.datepicker("option", "maxDate", dateText);
        }
      }).datepicker('setDate', today);

    });    

    
  $( function() {
    $( "#datepicker" ).datepicker({
      showOn: "button",
      buttonImage: "images/calendar.gif",
      buttonImageOnly: true,
      buttonText: "Select date"
    });
  } );    
    
  </script>
</head>
<body>
 
  <label for="from">From</label>
  <input type="text" id="fromDate" readonly class="date_picker" />
  <label for="to">to</label>
  <input type="text" id="toDate" readonly class="date_picker" />
  
 
 
</body>
</html>

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

Creating variable assignments based on object properties

I am facing a dilemma with a simple object that contains constants. { KEY1: "value1", KEY2: "value2" } I am looking for a way to make these constants accessible globally. Currently, I have to use Config.KEY1 to access the values globally, but I w ...

Using Ajax to submit a form on a Spring MVC webpage

I need help with submitting a form using AJAX post without refreshing the page. My technology stack includes Spring and jQuery. Can someone guide me on how to submit the form via AJAX and utilize the class in the controller for processing? The model Clas ...

How do I prevent my image slider from scrolling to the top of the page when I click next or prev?

<script> export default { name: "ImageSlider", data() { return { images: [ "https://cdn.pixabay.com/photo/2015/12/12/15/24/amsterdam-1089646_1280.jpg", "https://cdn.pixabay.com/photo/2016/02/17/2 ...

Is it possible to eliminate process.env.NODE_ENV using browserify/envify?

Currently, I am utilizing ReactJS through NPM and Browserify, but I am encountering difficulties while attempting to build it in production mode as mentioned in the readme. The code I have for setting up browserify is: var browserify = require('brows ...

When using the "top" property in position-absolute, the child element may exceed the boundaries of the parent element

My child element is overflowing its parent when I apply "top: random pixel" to it. It seems to be using the top position relative to the body of the page. // HTML <div class="movie-list"> <div class = "inn ...

Change the P element to a Span element while maintaining the existing content using the replaceWith

I'm having trouble replacing a p tag with a span while keeping the actual content intact. Can anyone assist me with this, please? $('.anim-letters p').replaceWith( "<span class='letters'>" + $('this').text() + "< ...

Data manipulation with Next.js

_APP.JS function MyApp({ Component, pageProps }) { let primary = 'darkMode_Primary'; let secondary = 'darkMode_Secondary' return ( <Layout primary_super={primary} secondary_super={secondary}> <Component {...page ...

Implementing a feature to insert a horizontal rule button in React Draft Wysiwyg

I am currently working on implementing a custom button in React Draft Wysiwyg that will allow me to add an <hr> tag to my content. Although I have followed the demos and documentation, I have encountered an issue where the custom button successfully ...

Permission for geolocation must be granted every time when using Safari and mobile browsers

My website requests geolocation permission but has a recurring issue. When accessed on mobile (using Chrome or Safari) or desktop Safari, the permission prompt pops up every time a page is reloaded. However, when accessing the site on a computer with Chro ...

Setting up validation with yup based on the value of a CheckBox component can be achieved by following these

I am currently working with a validationSchema const validationSchema = Yup.object().shape({ first_name: Yup.string().required("First Name is required"), last_name: Yup.string().required("Last name is required"), email: Yup.string().required( ...

Sorting by number or date in indexedDB may lead to unexpected results due to the

I have set up an index in my database called time on the created_at field: var os = thisDB.createObjectStore(name, { keyPath : "id" }); os.createIndex("time", "created_at", {unique: false }); Instead of storing the time as a standard date format, I conv ...

Display radio buttons depending on the selections made in the dropdown menu

I currently have a select box that displays another select box when the options change. Everything is working fine, but I would like to replace the second select box with radio buttons instead. Can anyone assist me with this? .sub{display:none;} <sc ...

Setting up an abstract state as the backdrop in AngularJS: A step-by-step guide

I am trying to maintain an animated background while switching between different states in my UI-router setup. The goal is for the background to remain constant while only the content of the states changes. Here is how I have set up my UI-router and attem ...

The unspoken rules of exporting and importing in TypeScript

In comparison to Java (as well as other programming languages), TypeScript provides multiple options for exporting and importing entities such as classes, functions, etc. For instance, you have the ability to export numerous classes, constants, functions ...

What is the correct way to properly import a non-relative path in TypeScript?

Struggling with importing into my TypeScript class. // Issue arises here... import * as Foundation from 'foundation/foundation'; // Everything runs smoothly until the above import is added... export class HelloWorldScene { constructor() { ...

Using ThreeJS to assign various textures based on the position of the object

Recently, I delved into the world of ThreeJS and embarked on creating a model of the Earth using a Sphere mesh. Alongside this, I crafted a model of the Sun and now desire to infuse two distinct textures onto the Earth model based on its orientation. Speci ...

What is the solution for correcting the fixed footer in jQuery Mobile?

My experience with jQueryMobile has led me to encounter a couple of persistent bugs even after including data-role="footer" data-position="fixed" in the markup: The footer toggles on a null click event. The footer remains unfixed and ends up hiding some ...

What is the process for executing Selenium IDE scripts in Selenium RC?

As a newcomer to using the selenium testing tool, I am seeking guidance on running selenium IDE scripts within selenium RC. I would greatly appreciate examples and screenshots to help me better understand the process. ...

Ways to place two anchor tags side by side within a list item contained within a justified navigation tab

I'm currently working with some nav-tabs and attempting to place two a tags within one of the li elements that represent a tab. However, I'm facing an issue where the a tags are appearing on separate lines. I've tried using inline styling fo ...

Struggling to get Ajax to function on IE8 with dropdowns, while other browsers are working perfectly fine

My AJAX code functions properly in most browsers, however, it is not performing well in IE. While it successfully creates an XMLHTTPRequest object, the data retrieved from my PHP script is only returning an empty list! Check out my JavaScript code: < ...