As you can see on this page:

http://www.emodo.com/node/28

The comment box is a fixed width (70 column). And is not controlled by CSS but looks like it is hard coded somewhere.

I want to change this to make it controlled by CSS (like the forum box I am typing in now).

Does anyone know what file controls the display of the comment box so I can hack it?

Comments

micha_1977’s picture

the size of the text input area depends on two values

1. the "size" as set in the html source, the number indicates the number of characters in a row

<input type="text" maxlength="64" class="form-text" name="edit[subject]" id="edit-subject" size="50" value="" />

2. settings in the .css file, e.g. for "input" or class ".form-text" or the parent element - in this case the div with class "form-item"
especially width, overflow and display would change the "fixed width" behaviour

further details would take you on a ride through the html 4.01 specs and css in mostly technical ways, im not sure if you really need this

-micha
work in progress with Drupal 4.6: langmi.de

chris Albon@www.emodo.com’s picture

Thanks Micha, but I am talking about the actual text box (a few lines below the code you quoted):

<textarea wrap="virtual" cols="70" rows="10" name="edit[comment]" id="edit-comment" class="textarea required"></textarea>

cols="70" is making the text area have a fixed width of 70 columns. The problem is that it is fixed and I want it to be fluid.

I have tried to override the cols="70" via css, but html overides CSS and it didn't work.

What I need to do is delete the cols="70" from the code and then I will be able to control the width via css.

If the cols="70" is hardcoded in the drupal source I'd like to hack the source to change it and this should be changed for the next release to make it controled via css.

I am trying to find the file what this snip of code comes from.

micha_1977’s picture

basically you cant override the "cols" with css

anyways

http://drupaldocs.org/api/4.6/function/form_textarea

thats the function...maybe, im not sure, maybe you can override it with an own theme function or directly override the values

-micha
work in progress with Drupal 4.6: langmi.de

chris Albon@www.emodo.com’s picture

nm... little playing the the css and ive fixed it.

Dublin Drupaller’s picture

HI Chris,

can you post the CSS fix?

Cheers

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

dboomerang’s picture

Just use width in percentage values like this:

.item-list .title {
font-size: 1em;
color: #222;
width: 80%;
}