SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: div in my form

  1. #1
    SitePoint Wizard
    Join Date
    May 2012
    Posts
    1,087
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Post div in my form

    Hi, Can you help me please on this form, i created an id saveform because i want to put background on the div of my submit button,but the problem is i want this div will occupy the whole width of my form. is this possible ?

    Thank you in advance.

    Code:
     .container{
       width: 542px;
    }
    
    
     form{
      width: 400px;
    }
    
    
     form div{
       float: left;
       margin-left: 50px;
       padding: 0 0 0.75em;
       width: 400px;
    }
    
    #saveform{
        margin:0;
       background-color: #000;
    }
    HTML Code:
    <div class="container">
      <form>
          <div>
              <label>name</label>
             <input type="text">
          </div>
          <div>
              <label>last</label>
             <input type="text">
          </div>
         <div>
              <label>age</label>
             <input type="text">
          </div>
    
        <div id="saveform"><input type="submit" value="submit"/></div>
     </form>
    
    <div>
    

  2. #2
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    2,326
    Mentioned
    191 Post(s)
    Tagged
    4 Thread(s)
    Applying width: 100% will cause the element to fill the entire width of its parent (less any padding).
    Can you provide a little more detail about how it is currently acting incorrectly? A screenshot?
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)


    Git is for EVERYONE
    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains

  3. #3
    SitePoint Wizard
    Join Date
    May 2012
    Posts
    1,087
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi ParkinT, Thank you for the reply...my mistake i use the wrong selector,...it's now fix


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
  •