Results 1 to 2 of 2

Thread: Textbox/Textarea troubles

  1. #1
    Join Date
    Jan 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Textbox/Textarea troubles

    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    HTML Code:
    <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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •