How to change background color of readonly textbox in css


Tags: html,css

Problem :

How to change background color of readonly textbox in css



Solution :

There are too many unkowns in your question. Which browser do you want support? If you say textbox you seem to use ASP.NET, but there is no tag at you question.

Generally said, the behaviour between the browsers are different.

Consider the following html

<html>
      <head>
      </head>
      <body>
             <input type="text" disabled="disabled" value="This is a test" style="background-color:Black; color:Lime;" />
      </body>
</html>

IE8 renders the background color properly, but disabled controls will always have gray text with shadows. Mozille Firefox beside that renders the control correct and i am sure there will be difference all over the different browsers and even between the browser versions (IE6 would interprete the color values correctly too).

If you want to have a html regardless which browser you use, you have to use a span or other inline element, to format it with border and colors you want, instead of using a input element.


    CSS Howto..

    How to make diagonal div

    How to remove line in the middle? [duplicate]

    How to make a navbar appear in certain section of the page? (bootstrap too)

    How to position background image in bottom right corner? (CSS)

    How do sprites work in jqmobile?

    How to check if an element matches the :empty pseudo-class in pure JS?

    How to use Sass mixin transition for applying transition-delay only?

    How is percentage calculated when using it for margin and padding?

    How can I apply percentage-based positioning to background-image sprites with pure CSS?

    How to fix hover on transparent photo

    How to set two background color to one element in CSS?

    How to disable auto genrated css in media folder at runtime Magento?

    How to link another page using button? [closed]

    How to make interactive logo design without flash?

    How to Override/Undo CSS Class Attributes for Twitter Bootstrap

    How to NOT select only specific elements in a table with jQuery?

    How to make div fill the rest of viewport with keeping of aspect ratio (CSS or jQuery)?

    How to make one css input type be displayed the same as another input type

    How to remove gap in masonry?

    CSS - how to display submenu options horizontally while maintaining spacing of horizontal main menu options

    How can I split a text in 2 color vertically?

    how to add several td and tr in css

    How to setup CSS for multiple font choices? [closed]

    how to position heading in the center of the page

    how to display div one by one using css

    How do I remove the white spaces around my dashboard header on reactjs

    How to Display this CSS List using Class

    CSS - How to make a div's padding not affect the positioning of the div below it

    How to test a CSS parser?

    How to change the src of an iframe with css