SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Textarea doesn't change with CSS

    Hi,

    I have the following issue: I have a form with a <textarea>, and no matter how much padding or margin I apply to it in CSS, it never changes; it remains stuck to the leftmost form margin and doesn't move. I want there to be space between the form border and the text area.

    Here is the markup:

    Code:
    <form id="myForm action="admin.html" method="post" class="myForm">
    				<fieldset class="myForm">
    					<legend class="myForm">
    Submit Text:</legend>
    					<div class="formSection">
    						<div>
    							<label for="author" >Author:</label>
    							<input type="text" name="author" id="author" value="Anonymous"/>
    						</div>
    							<label for="quoteText">Quote:</label>
    						<div>
    							<textarea name="quoteText" id="quoteText">
    							</textarea>
    						</div>
    					</div>
    				</fieldset>
    			</form>
    Here is the CSS:

    Code:
    	form.myForm textarea
    	{
    		margin-left: 10px;
    	}
    Can someone suggest something?

    Thanks.

  2. #2
    SitePoint Evangelist TommiChi's Avatar
    Join Date
    Oct 2008
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if that doesn't work have you tried yet "position:relative; left:10px;" ?

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It might be because of the invalid markup, unless that's a typo in your post:

    Code:
    <form id="myForm action="admin.html" method="post" class="myForm">
    You're missing the terminating quotation mark on the id attribute, which is quite likely mess things up. Add a quote and see if that doesn't help.

    Code:
    <form id="myForm" action="admin.html" method="post" class="myForm">
    This is yet another example of why you should always validate your markup before attempting any other form of trouble-shooting.
    Birnam wood is come to Dunsinane

  4. #4
    SitePoint Enthusiast queen4's Avatar
    Join Date
    Jul 2009
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just add a quote at the end of <form id="myForm action="admin.html"
    id="myForm". It should be work.


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
  •