Log in

View Full Version : Textbox/Textarea troubles



d3d
01-02-2010, 04:47 AM
First of all, I'd like to thank you guys in advance for having such a wealth of knowledge and members to help us "newbies." You guys rock.

On to my question, I'm hoping it's simple:

I'm trying to create a custom textbox. I just want it to be a textbox with no borders and a predetermined background image (with predetermined dimensions), a certain font (Tahoma, do be exact), and to have centered text. I found something similar on another site and it almost hits the nail on the head (note - I've already modified it to my preferences for the most part. I have split it up so I can show you what parts with which I am having trouble.):



<textarea style="
background:url('image.ext');
font-family:Tahoma;
font-size:18px;
font-color:'#bcbcbc';
width:265px;
height:35px;
border-top:0px;
border-right:0px;
border-bottom:0px;
border-left:0px;
">
Testing
</textarea>

font-color is clearly not an attribute, what is the correct code?
Is there a way to simplify all of the border eliminating code?

Some parts I don't even know where to begin:
Is it possible to make ONLY the textbox's text centered?
on some browsers (at least Opera; possibly more), the scrollbars automatically appear even if it's not using multiple lines. Is it possible to do this same effects (used above) on a text box to eliminate the scrollbars? Is it possible to force the browser to recognize that the text area is only using one line and therefore eliminate the scrollbar?

Thanks in advance for help. Last but not least: "Happy New Year!"

d3d

jscheuer1
01-02-2010, 05:12 AM
<textarea style="
background-image: url('image.ext');
font-family: tahoma, sans-serif;
font-size: 18px;
color: #bcbcbc;
width: 265px;
height: 35px;
border: none;
text-align: center;
">
Testing
</textarea>

Notes: Styles generally should go in a stylesheet, preferably an external one. Though not generally a fatal error, rows and cols are required attributes of the textarea tag. Style is an attribute. Individual styles are not, they are know as property/value pairs. In the above (as with all elements), it is color property's value that colors the text. Quotes cannot be used in property values unless required/allowed.