Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Dec 2004
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    TextArea Background

    Is there any way to set the background of the TextArea element? I can't see it in the W3C HTML docs. I would like to set it to transparent.

    Thanks.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Code:
    <textarea style="background:none;color:#000;" rows=5" cols="8"></textarea>

  • #3
    New Coder
    Join Date
    Dec 2004
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks again!

    Is this stuff documented somewhere?

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Yes its CSS2.0-2.1 Search on www.w3.org for the CSS2.1 specs. You can learn about CSS at w3schools as well.

  • #5
    New Coder
    Join Date
    Dec 2004
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've looked through the W3C docs but perhaps I just don't understand them. I couldn't find any reference to background being one of the properties of the Textarea element.

    And is there some way that class references are supposed to work? Like this?

    Code:
    <TEXTAREA class="TestimonialInput" rows=14 cols=100 name=Testimonial></TEXTAREA>
    Or like this?

    Code:
    <SPAN class="TestimonialInput"><TEXTAREA rows=14 cols=100 name=Testimonial></TEXTAREA></SPAN>
    I tried both, of course, and neither works. Just wondering how to, or if I can, apply an external style sheet.

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    What I used is inline styles which is CSS. Style is an html attribute but anything within the style is CSS which is why you don't find background as an attribute for the textarea. You would use a class if you were using an embedded or external stylesheet.
    Code:
    <textarea class="TestimonialInput" rows="14" cols="100" name="Testimonial"></textarea>
    would be the correct markup which goes in your body tags, then in your stylesheet (css) you would call up the class by using a . (dot) in front of the class name
    Code:
    <style type="text/css">
    .TestimonialInput {
    background:none;
    }
    </style>
    The above code will go in your head tags.

  • #7
    New Coder
    Join Date
    Dec 2004
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, now it works. I must have failed to save the .CSS file or clear a buffer or something. I don't know. Anyway, thanks for your patience. I've got a class defined in my .CSS and I've applied it to the textarea. The rest is all refinement.

    Thanks.


  •  

    Posting Permissions

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