Click to See Complete Forum and Search --> : Restricting the width of a textarea when it has cols defined


dryadsong
05-24-2006, 01:04 PM
Right. Me again. For those that don't remember some of my earlier inane posts, I'm the n00b trying to figure out CSS by redesigning my site without any tables.

Big problem: Livejournal. (Don't worry, I'm not going to ask anyone to delve into their S2 code). I want the damn thing to match the site, and I've basically got it doing that, but I have a problem in that its reply pages have the textarea defined by cols=75 (and this can't be changed manually due to it being stuck in there through a coded function). This makes it too wide for my layout, and although I've got the box resized in IE, I can't get that to work in firefox.

I looked through the code, and I think I've figured out how everything is nested the way that this layout is (not mine, I just stuck divs around the layout and put a stylesheet in. It won't validate, I'm not going to try):

div table tr td table tr td form table tr td table tr td textarea

since I don't know what I'm doing with selectors...umm...should I use the above string to select the textarea in firefox? Or is there another way to make the damn thing narrower?

(Page is here: http://dryad-song.livejournal.com/18590.html?mode=reply )


Also, when do I use 'element element { }' as opposed to 'element > element { }' ? (Or, for that matter, 'element, element { }' ?)

GaryS
05-24-2006, 01:40 PM
Should be as simple as:

textarea{width: 100px}

element1 element2 { } is for "element2 when it appears inside element1"
element1, element2 { } is for element1 and for element2
element > element { } is not well supported - suggest you stay clear

dryadsong
05-24-2006, 03:30 PM
My thanks for the explanation about selectors. :)


About the textarea, though... I have the following:

textarea {
font-family: Verdana, Helvetica, sans-serif;
width:400px;
}

It works fine in IE, but firefox isn't affected at all. In fact, I'm seeing a trend in that elements that are stuck inside of tables seem not to respond to the styling in firefox. Any thoughts?