El color de la fuente no se corresponde con el estilo especificado en css para el área de texto y los cuadros de selección

I'm trying to style a webform in my webpage, and the form has couple of textboxes, textarea and a select dropdown. I'm having hard time styling the text area and select dropdown; textboxes are looking as expected.

For the textarea box, i used css like:

textarea{
font-size:0.9em;
color:#6da021;
border:1px solid #6da021;
width:300px; height:50px;
padding-left:10px;
font-family: tahoma, sans-serif;
}

I also tried putting an id in the textarea html and then using the above styling like:

<textarea type="text" rows="5" cols="30" name="details" id="details"></textarea>

In both ways, the border properties were applied successfully. But what did not work in both ways are - color of text inside the textarea box, and also the font looks slightly different from what is seen in the text boxes, which use the same "font-family: tahoma, sans-serif;" css.

Similarly, for the select box styling, although the border properties are coming around properly, and that the font color of the first value - the value that is shown initially, without the user having to click on the dropdown arrow - is also displayed correctly. But when the user clicks on the dropdown arrow, all the values are then shown in the default color (not the color that was specifically used for the css of select).

Is it some kind of a known problem, or am i missing out on some more styling? I see that the issue is seen across browsers (IE/firefox etc..)

¡Gracias!

preguntado el 08 de noviembre de 11 a las 13:11

3 Respuestas

your style is right but if u dont get reflect changes than i think ur style is replaced by some othe existing style which has a priorities

if u use firebug than check by inspecting that textarea or if u dont know abt firebug than this is a firefox plugin, install it and check if ur stylesheet is replaced or have some other issue...

if u dont mind than reply me if more help required

respondido 08 nov., 11:17

Wow I am very late to see this but here is an answer to fix the font size issues

 body{
  font-size:15px;
  font-family: tahoma, sans-serif;
 }

 textarea{
  font-family: inherit;
  font-size: inherit;
 }

Respondido el 19 de enero de 15 a las 01:01

No need for type='text' into the textarea. You're using id='details' and name='details' which is the same thing (2 ids' reference). I suggest using a class named details for the styling and an id='content' to extract the text later, if needed.

<textarea rows="5" cols="30" class="details" id='content' value="initial-Text"></textarea>

 .details {
     font-family: 'Tahoma', sans-serif;
     font-size: 13px;
     color:#6da021;
     border:1px solid #6da021; 
     width:300px; height:50px;
     padding-left:10px;
    }

Respondido 18 ago 15, 04:08

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.