Having trouble aligning <textarea> with CSS

Discussion in 'HTML & Website Design' started by solid7, Oct 5, 2006.

  1. #1
    Can someone please show me where to find information on centering a <textarea> tag with CSS?

    Thank you!
     
    solid7, Oct 5, 2006 IP
  2. Eskarina

    Eskarina Guest

    Messages:
    608
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi,

    here is how I have done mine -

    -----------------------------------------------------------------------
    }
    .textcontainer {
    list-style-image: url(images/arrow.gif);
    height: auto;
    width: 600px;
    padding: 10px 30px;
    position: relative;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    white-space: normal;


    }

    -----------------------------------------------------------------------

    Hope that helps :p
     
    Eskarina, Oct 5, 2006 IP
  3. Eskarina

    Eskarina Guest

    Messages:
    608
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Ah I see you want information - this one is quite good -

    http:// tutorials.alsacreations.com/centrer/ (I can't post live links so obviously you'll have to remove the gap in the address)
     
    Eskarina, Oct 6, 2006 IP
  4. solid7

    solid7 Well-Known Member

    Messages:
    459
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    148
    #4
    Thanks for the reply.

    This is the same method that I've been attemtping, and I am having a real problem. What does the HTML for your textarea look like?
     
    solid7, Oct 6, 2006 IP
  5. Eskarina

    Eskarina Guest

    Messages:
    608
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Here's the html:

    -----------------------------------------------------------------------------
    <div class="textcontainer">
    <ul>
    <li>
    blaaaaaaaablaaaaaaaaa
    </li>
    <li>
    blaaaaaaaablaaaaaaa
    </li>
    <li>
    blaaaaaaaablaaaaaa
    </li>
    <li>
    blaaaaaaablaaaaaaa
    </li>
    <li>
    blaaaaaa blaaaaaaaa
    <br>
    </li>
    </ul>
    </div>
    ---------------------------------------------------------------------------------------------------------------------

    This text container has listed contents as you can see. You can change the list and ul tags to <p> if you so require.

    I have no idea if this is the best way to do things but it is working well for me at the moment. Also I have much more content in it than the example I
    have provided and the length of the container does adjust automatically.

    If you'd like more specific help please let me know.
     
    Eskarina, Oct 6, 2006 IP
  6. Eskarina

    Eskarina Guest

    Messages:
    608
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Also I added this to my css file ....

    --------------------------------------------------------------

    }

    body {
    margin: 0; /* to avoid margins */
    text-align: center; /* to correct the centering IE bug*/
    }

    ----------------------------------------------------------------------

    To help center the entire container (sorry but at the moment I can't remember exactly why I did it) but it fixed some sort of page layout problem for me in ie. I found this fix on the link I sent you for centering issues.
     
    Eskarina, Oct 6, 2006 IP
  7. solid7

    solid7 Well-Known Member

    Messages:
    459
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    148
    #7
    I'm actually using the <textarea> tag for my html. This is in input field, not listed text. It's actually the input for my mailform.

    I am having a terrible hard time figuring out how text inputs behave with CSS...

    My google searches have been mostly fruitless on this - although I do admit that I sometimes am too dumb to know what to search for. :)

    Thank you for your replies.
     
    solid7, Oct 6, 2006 IP
  8. Eskarina

    Eskarina Guest

    Messages:
    608
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #8
    If you pm me a link to your site where you want your form I may be able to help more. If you'd prefer to see my mailform same applies ;)

    And you're not thick, css is quite tricky to come to terms with unless you were born lucky ;)
     
    Eskarina, Oct 6, 2006 IP