SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Addict delpino's Avatar
    Join Date
    Nov 2001
    Location
    London
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    space after </form> tag

    I noticed that the </FORM> tag has more or less a <P> tag included, in other words after that tag there is a lot of space. Is there a way to prevent that?
    http://www.antosch-and-lin.com - Language Learning

  2. #2
    SitePoint Zealot 19nine78's Avatar
    Join Date
    Feb 2002
    Location
    Ayr, scotland
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you add:

    form{
    margin:0;
    }

    to your styesheet it'll remove it.

    It doesn't work in NS4, but what does !!

    cheers

    alastair

  3. #3
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    acutally what your after is this

    style="display:inline"

    PHP Code:
    <form action="http://www.google.com" method="get" enctype="text/html" style="display:inline">
      <
    input type="text" value="" id="txt1" /><br />
      <
    input type="text" value="" id="txt2" /><br />
      <
    input type="text" value="" id="txt3" /><br />
      <
    input type="text" value="" id="txt4" /><br />
      <
    input type="text" value="" id="txt5" /><br />
      <
    input type="submit" value="submit" id="sub" /><br />
    </
    form

  4. #4
    SitePoint Addict delpino's Avatar
    Join Date
    Nov 2001
    Location
    London
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    19nine78 way already worked fine.. any advantages your solution has? does it work with NN?

    ps: what is the id attribute for?
    http://www.antosch-and-lin.com - Language Learning

  5. #5
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, the id attribute is used to reference the object.

    say you want a particular part of the page to look different with css

    eg

    PHP Code:
    <style type="text/css">
      
    #txt1 {background-color:orange;color:white;}
      
    .group{background-color:gray;color:purple;}
    </
    style>

    <
    form action="http://www.google.com" method="get" enctype="text/html" style="display:inline">
      <
    input type="text" value="" id="txt1" class="group" /><br />
      <
    input type="text" value="" id="txt2" class="group" /><br />
      <
    input type="text" value="" id="txt3" class="group" /><br />
      <
    input type="text" value="" id="txt4" class="group" /><br />
      <
    input type="text" value="" id="txt5" class="group" /><br />
      <
    input type="submit" value="submit" id="sub" /><br />
    </
    form
    this site will explain about classes and id's etc

    http://www.w3schools.com/css/css_syntax.asp

    but id's, classes, names etc are basically for referencing the element.

    let me know if you need a further explanation

  6. #6
    SitePoint Zealot 19nine78's Avatar
    Join Date
    Feb 2002
    Location
    Ayr, scotland
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    *Actually* both methods will achieve the same result, Andrew-J2000's method works by changing the display type of element whereas mine works by removing the forms margin, the root of the problem.

    I like my way better

    according to my css reference, display:inline isn't supported by netscape 4, I haven't time to test it right now.

    cheers

    alastair

  7. #7
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I never knew there was a display:inline style...can that be used for any block-level element?

    Sketch
    Aaron Brazell
    Technosailor



  8. #8
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know, it's odd, you spend all your time learning this stuff, and then you find something new out lol. Like i just found out that

    <input type="image" src="..." img="..." />

    is valid xhtml.


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
  •