CSS forms Help!

Discussion in 'HTML' started by mark | r, Apr 13, 2005.

  1. mark | r

    mark | r Guest

    Using the code below and XHTML how do i get the P tags to contain the
    textarea if both the label and textarea are {float:left;width:100px} ?
    the problem im having is when i give the P tag a background colour i get
    silly strips of grey that should go all the way around the text area but
    dont!

    <form id="contact">
    <fieldset>
    <legend>Enquiry Details</legend>
    <p>
    <label for="details">Details</label>
    <textarea id="details" name="details"></textarea>
    </p>
    </fieldset>
    </form>
     
    mark | r, Apr 13, 2005
    #1
    1. Advertising

  2. mark | r

    Steve Pugh Guest

    "mark | r" <> wrote:

    >Using the code below and XHTML how do i get the P tags to contain the
    >textarea if both the label and textarea are {float:left;width:100px} ?


    What if the user's font size means that your labels don't fit inside
    100px?

    >the problem im having is when i give the P tag a background colour i get
    >silly strips of grey that should go all the way around the text area but
    >dont!
    >
    ><form id="contact">
    ><fieldset>
    ><legend>Enquiry Details</legend>
    ><p>
    ><label for="details">Details</label>
    ><textarea id="details" name="details"></textarea>
    ></p>
    ></fieldset>
    ></form>


    You need an element with clear: left; set inside the <p> but after the
    last floated element.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Apr 13, 2005
    #2
    1. Advertising

  3. mark | r

    Els Guest

    mark | r wrote:

    > Using the code below and XHTML how do i get the P tags to contain the
    > textarea if both the label and textarea are {float:left;width:100px} ?
    > the problem im having is when i give the P tag a background colour i get
    > silly strips of grey that should go all the way around the text area but
    > dont!
    >
    > <form id="contact">
    > <fieldset>
    > <legend>Enquiry Details</legend>
    > <p>
    > <label for="details">Details</label>
    > <textarea id="details" name="details"></textarea>
    > </p>
    > </fieldset>
    > </form>


    You'll need an element with a clear property after the last floated
    element (textarea) inside the containing element (p).
    In IE it would be enough to set a height to the containing element, as
    it then automatically stretches to encompass the content, even it it's
    floated.

    --
    Els http://locusmeus.com/
    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
     
    Els, Apr 13, 2005
    #3
  4. mark | r

    mark | r Guest

    "Steve Pugh" <> wrote in message
    news:...
    > "mark | r" <> wrote:
    >
    > >Using the code below and XHTML how do i get the P tags to contain the
    > >textarea if both the label and textarea are {float:left;width:100px} ?

    >
    > What if the user's font size means that your labels don't fit inside
    > 100px?


    The label stretches

    >
    > >the problem im having is when i give the P tag a background colour i get
    > >silly strips of grey that should go all the way around the text area but
    > >dont!
    > >
    > ><form id="contact">
    > ><fieldset>
    > ><legend>Enquiry Details</legend>
    > ><p>
    > ><label for="details">Details</label>
    > ><textarea id="details" name="details"></textarea>
    > ></p>
    > ></fieldset>
    > ></form>

    >
    > You need an element with clear: left; set inside the <p> but after the
    > last floated element.


    still doesnt work

    thanks
    Mark
     
    mark | r, Apr 13, 2005
    #4
  5. mark | r

    mark | r Guest

    "Els" <> wrote in message
    news:...
    > mark | r wrote:
    >
    > > Using the code below and XHTML how do i get the P tags to contain the
    > > textarea if both the label and textarea are {float:left;width:100px} ?
    > > the problem im having is when i give the P tag a background colour i get
    > > silly strips of grey that should go all the way around the text area but
    > > dont!
    > >
    > > <form id="contact">
    > > <fieldset>
    > > <legend>Enquiry Details</legend>
    > > <p>
    > > <label for="details">Details</label>
    > > <textarea id="details" name="details"></textarea>
    > > </p>
    > > </fieldset>
    > > </form>

    >
    > You'll need an element with a clear property after the last floated
    > element (textarea) inside the containing element (p).
    > In IE it would be enough to set a height to the containing element, as
    > it then automatically stretches to encompass the content, even it it's
    > floated.


    im almost there, ive taken float:left off the input and text area which
    makes the textarea work , but the input box not, then ive added a &nbsp;
    after each input box which seems to be doing the trick - albeit with &nbsp;s
    everywhere
     
    mark | r, Apr 13, 2005
    #5
  6. mark | r

    Els Guest

    mark | r wrote:

    > "Els" <> wrote in message
    > news:...
    >> mark | r wrote:
    >>
    >>> Using the code below and XHTML how do i get the P tags to contain the
    >>> textarea if both the label and textarea are {float:left;width:100px} ?
    >>> the problem im having is when i give the P tag a background colour i get
    >>> silly strips of grey that should go all the way around the text area but
    >>> dont!
    >>>
    >>> <form id="contact">
    >>> <fieldset>
    >>> <legend>Enquiry Details</legend>
    >>> <p>
    >>> <label for="details">Details</label>
    >>> <textarea id="details" name="details"></textarea>
    >>> </p>
    >>> </fieldset>
    >>> </form>

    >>
    >> You'll need an element with a clear property after the last floated
    >> element (textarea) inside the containing element (p).
    >> In IE it would be enough to set a height to the containing element, as
    >> it then automatically stretches to encompass the content, even it it's
    >> floated.

    >
    > im almost there, ive taken float:left off the input and text area which
    > makes the textarea work , but the input box not, then ive added a &nbsp;
    > after each input box which seems to be doing the trick - albeit with &nbsp;s
    > everywhere


    You just proved to have given incomplete code then. There is no input
    element in the above code. You really should provide a URL to a live
    and real situation, so people can actually see what you are
    doing/trying to accomplish, and what's wrong or right.
    Without seeing an example, I can only say "I don't think you need
    &nbsp; at all in that form".

    --
    Els http://locusmeus.com/
    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
     
    Els, Apr 13, 2005
    #6
  7. mark | r

    Steve Pugh Guest

    "mark | r" <> wrote:
    >"Steve Pugh" <> wrote in message
    >news:...
    >> "mark | r" <> wrote:
    >>
    >> >Using the code below and XHTML how do i get the P tags to contain the
    >> >textarea if both the label and textarea are {float:left;width:100px} ?

    >>
    >> What if the user's font size means that your labels don't fit inside
    >> 100px?

    >
    >The label stretches


    ??? Not in a browser that supports CSS properly it won't. The text
    will spill out of the label (give the label a border or background
    colour to see) and may overlap adjacent elements.

    >> >the problem im having is when i give the P tag a background colour i get
    >> >silly strips of grey that should go all the way around the text area but
    >> >dont!
    >> >
    >> ><form id="contact">
    >> ><fieldset>
    >> ><legend>Enquiry Details</legend>
    >> ><p>
    >> ><label for="details">Details</label>
    >> ><textarea id="details" name="details"></textarea>
    >> ></p>
    >> ></fieldset>
    >> ></form>

    >>
    >> You need an element with clear: left; set inside the <p> but after the
    >> last floated element.

    >
    >still doesnt work


    Then you're doing it wrong. Post a URL showing what you've tried.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Apr 13, 2005
    #7
  8. mark | r

    mark | r Guest

    www.so.neue.co.uk/contact.asp

    Mark

    "Steve Pugh" <> wrote in message
    news:...
    > "mark | r" <> wrote:
    > >"Steve Pugh" <> wrote in message
    > >news:...
    > >> "mark | r" <> wrote:
    > >>
    > >> >Using the code below and XHTML how do i get the P tags to contain the
    > >> >textarea if both the label and textarea are {float:left;width:100px} ?
    > >>
    > >> What if the user's font size means that your labels don't fit inside
    > >> 100px?

    > >
    > >The label stretches

    >
    > ??? Not in a browser that supports CSS properly it won't. The text
    > will spill out of the label (give the label a border or background
    > colour to see) and may overlap adjacent elements.
    >
    > >> >the problem im having is when i give the P tag a background colour i

    get
    > >> >silly strips of grey that should go all the way around the text area

    but
    > >> >dont!
    > >> >
    > >> ><form id="contact">
    > >> ><fieldset>
    > >> ><legend>Enquiry Details</legend>
    > >> ><p>
    > >> ><label for="details">Details</label>
    > >> ><textarea id="details" name="details"></textarea>
    > >> ></p>
    > >> ></fieldset>
    > >> ></form>
    > >>
    > >> You need an element with clear: left; set inside the <p> but after the
    > >> last floated element.

    > >
    > >still doesnt work

    >
    > Then you're doing it wrong. Post a URL showing what you've tried.
    >
    > Steve
    >
    > --
    > "My theories appal you, my heresies outrage you,
    > I never answer letters and you don't like my tie." - The Doctor
    >
    > Steve Pugh <> <http://steve.pugh.net/>
     
    mark | r, Apr 14, 2005
    #8
  9. mark | r

    mark | r Guest

    www.so.neue.co.uk/contact.asp

    Mark
    "Els" <> wrote in message
    news:z17rhc3l7kc0$...
    > mark | r wrote:
    >
    > > "Els" <> wrote in message
    > > news:...
    > >> mark | r wrote:
    > >>
    > >>> Using the code below and XHTML how do i get the P tags to contain the
    > >>> textarea if both the label and textarea are {float:left;width:100px} ?
    > >>> the problem im having is when i give the P tag a background colour i

    get
    > >>> silly strips of grey that should go all the way around the text area

    but
    > >>> dont!
    > >>>
    > >>> <form id="contact">
    > >>> <fieldset>
    > >>> <legend>Enquiry Details</legend>
    > >>> <p>
    > >>> <label for="details">Details</label>
    > >>> <textarea id="details" name="details"></textarea>
    > >>> </p>
    > >>> </fieldset>
    > >>> </form>
    > >>
    > >> You'll need an element with a clear property after the last floated
    > >> element (textarea) inside the containing element (p).
    > >> In IE it would be enough to set a height to the containing element, as
    > >> it then automatically stretches to encompass the content, even it it's
    > >> floated.

    > >
    > > im almost there, ive taken float:left off the input and text area which
    > > makes the textarea work , but the input box not, then ive added a &nbsp;
    > > after each input box which seems to be doing the trick - albeit with

    &nbsp;s
    > > everywhere

    >
    > You just proved to have given incomplete code then. There is no input
    > element in the above code. You really should provide a URL to a live
    > and real situation, so people can actually see what you are
    > doing/trying to accomplish, and what's wrong or right.
    > Without seeing an example, I can only say "I don't think you need
    > &nbsp; at all in that form".
    >
    > --
    > Els http://locusmeus.com/
    > Sonhos vem. Sonhos vão. O resto é imperfeito.
    > - Renato Russo -
     
    mark | r, Apr 14, 2005
    #9
  10. mark | r

    Els Guest

    mark | r wrote:

    > www.so.neue.co.uk/contact.asp


    [snip 4 posts worth of text]

    a) You know better than topposting.
    b) that link doesn't work - probably a wrong content type from the
    server or something, as I was asked to download the file.

    Please try again later.

    --
    Els http://locusmeus.com/
    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
     
    Els, Apr 14, 2005
    #10
  11. mark | r

    Steve Pugh Guest

    "mark | r" <> wrote:

    >www.so.neue.co.uk/contact.asp


    "Enable ASP

    This web page has attempted to run an ASP script.
    However, ASP has not yet been enabled for this domain.

    If this is your website, you can enable ASP or ASP.NET, using the
    Server options facility on your control panel."

    And don't top post. You've been around long enough to know better.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Apr 14, 2005
    #11
  12. mark | r

    mark | r Guest

    "Els" <> wrote in message
    news:13is9qfj1jph4.12agaih7kauzq$...
    > mark | r wrote:
    >
    > > www.so.neue.co.uk/contact.asp

    >
    > [snip 4 posts worth of text]
    >
    > a) You know better than topposting.
    > b) that link doesn't work - probably a wrong content type from the
    > server or something, as I was asked to download the file.
    >
    > Please try again later.
    >
    > --
    > Els http://locusmeus.com/
    > Sonhos vem. Sonhos vão. O resto é imperfeito.
    > - Renato Russo -


    sorry it was still propagating (and still is?)
    http://domain788768.sites.fasthosts.com/contact.asp

    mark
     
    mark | r, Apr 14, 2005
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brendan Miller

    Web Forms VS Windows Forms

    Brendan Miller, Aug 11, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    5,131
    Kevin Spencer
    Aug 11, 2003
  2. Eric
    Replies:
    2
    Views:
    1,544
    Tommy
    Feb 13, 2004
  3. Nick Wouters
    Replies:
    5
    Views:
    4,680
    Flinky Wisty Pomm
    May 8, 2006
  4. AF
    Replies:
    17
    Views:
    624
    Nije Nego
    Aug 9, 2006
  5. Eric
    Replies:
    2
    Views:
    608
Loading...

Share This Page