How can I prevent IE 9 from allowing users to resize the input text field and remove the border around it?

I'm trying to add a text input field inside a contenteditable div in IE 9, but the input field ends up being resizable and has a border around it. I've attempted to fix this using CSS, but unfortunately, it's not working as expected. Here is the code snippet:

HTML:

<body>
<div id="wrapper">     
    <div id="input" style="border:1px solid black;height:100px;" tabindex="0" onfocus="divFocus();" onblur="divBlur();">
        <p id="text" contenteditable="true">
        <input type="text" id="textBox" size="3" onblur="keydown(32);" onkeypress="this.style.width = ((this.value.length + 1) * 8) + 'px';" 
       value="Anything" />
        </p>
    </div>
</div>
</body>

CSS:

    #textBox
{
    text-wrap:normal;
    font-family:arial;
    font-size:15px;
    border:none;
    resize:none;
    border:0; 
    border-color: transparent;
}
#textBox:focus 
{
    outline: none;
    outline-width: 0;
    outline-color: transparent;
}

Answer №1

Apply the following CSS rule:

resize: none;

This snippet will prevent the input field from being resized.

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

Tips for modifying the height of a bootstrap-vue table and enabling scrolling with a fixed header

I have a div containing a b-table that I need help adjusting the height for. I want to make the table scrollable with a fixed header. Can anyone assist me? Here is my code: Code inside the template: <div class="tbl-barangay"> <b-table stripe ...

Is the p tag not becoming absolute from the bottom even when set to position: absolute?

My p tag in the section properties of div class="sf sf_2 won't align to 0 px from the bottom of the div. It seems to move 0px from the top, right, and left but not bottom. I've tried changing its position property and where it's nested, but ...

Creating grids and dividing them using a combination of CSS, JavaScript, and PHP

I've encountered an interesting challenge while working on a web project and would love some advice on how to tackle it: Within a database, I have a collection of images that I want to display in a grid format. The twist is that higher ranked images ...

Place the menu on top of the div by adjusting the z-index

Hey there, I'm working on a project and I need help with an issue. You can check out the example page here: If you try to open the menu and click between "list" and "new ads", you'll notice that you're actually clicking on the dropdown se ...

Is it possible to automate the process of clicking the "next" or "previous" button on a webpage after a video has finished playing?

Is it possible to automate clicking the "next" or "previous" button on a specific website? The buttons are not labeled as such but instead show the cartoon name and episode number. For example, increasing episode numbers indicate the "next" episode while d ...

Is there a way to style alternate iframes using CSS?

I need to select every second iframe in the image provided. Is it possible to achieve this using nth-child? I have tried with the following code (unsuccessfully): #main iframe:nth-child(2n+2) ...

What is the best way to use .htaccess to maintain $_POST data while consistently eliminating file extensions?

This morning, as I was working on a website, I decided to tackle the task of removing file extensions. Although I am still learning about .htaccess files and their regex, I came across some code online that I thought would help me achieve my goal. The firs ...

Add rows to the table dynamically and then execute the script

My table dynamically creates rows when a button is clicked, and there is an input box with an auto suggest script. The auto complete works fine on the default first box, but not on the dynamically added row. How can I make the auto complete script work o ...

Display HTML content in a modal dialog box without parsing it

I'm currently working on a website showcasing various HTML and CSS spinners and loaders. Each example opens a modal window upon click, where I aim to display the corresponding code for that spinner so users can easily copy and implement it in their ow ...

Is there a method to view text options that are too long within a fixed width <select multiple> HTML box?

Here is the code I am working with: <div id='div2' style='height: 430px; width: 350px; overflow:auto;'> <select multiple id="id" size="28" style="FONT-SIZE: 12px; FONT-FAMILY: Arial; width: 100%"> It's a challenge bec ...

Safari-exclusive bug: jQuery offset() function malfunctioning and producing highly inaccurate results

My goal is to retrieve the top offset values of a series of elements on my webpage. I am cycling through each element and recording its top offset value like this: $(elements).each(function() { var element = $(this); var offset = Math.floor($(elem ...

The website does not display properly on larger screens, while showing a scrollbar on smaller screens

I'm encountering an issue with my website where I can't seem to find a solution no matter what I try. My goal is to ensure that my website looks consistent across all computer screen sizes. However, when viewed on larger screens, there's a ...

Retrieve the HTML form field during an AJAX request

My task involves creating dynamic fields with labels based on user input. To clarify: I prompt the user to select a date range, and I want to generate label and input field for each date within that range. To achieve this, I implemented an AJAX function ...

Concealing a button within a specific interface

I am currently facing an issue with a data table that includes two control buttons: edit and save. My problem lies in hiding the save button on the initial preview. Basically, what I want to achieve is displaying only the Edit button on the first page. Wh ...

What is the best way to loop through an array and apply classes to each element separately?

I'm currently working on a unique jQuery plugin that is designed to create dynamic lists based on any data provided. The first 6 items in the list will always remain constant, regardless of the input data. When I say constant, I mean that although th ...

Tips for altering the color of spans that share a common top position without affecting the surrounding sibling elements above or below

Is there a way to change the color of spans with the same top position, excluding sibling elements above or below, in a paragraph made up of spans? I've been working on how to change the color of the line of span tags that contain another span with t ...

What is the method for activating the on collapse event with a bootstrap navbar?

I am encountering a common issue with collapsing the navbar on smaller screens and triggering an event when the collapse button icon is clicked. Despite my efforts to find a solution, I have been unsuccessful in using the following JavaScript code: $(&apos ...

JavaScript-enhanced HTML form validation

I encountered a small glitch while working on simple form validation with JavaScript. I tried to catch the issue but have been unable to do so. Here is the code snippet, where the problem lies in the fact that the select list does not get validated and I ...

What is the preferred method for storing JSON data - using a single data attribute or multiple separate data attributes?

When it comes to storing multiple data attributes for a single DOM element, the question arises: Is it better to have a single data attribute containing JSON data, or is it more efficient to have separate data attributes for each value needed? <select ...

Prohibit entry to JS and CSS files

I am looking to restrict access to js and css files. If a user attempts to access a file with the extensions .js or .css, I want the website to redirect them to a 404 page. The code provided below is not functioning as intended. It is blocking all web pag ...