Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > CSS > CSS Cascading Style Sheets
|
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 23rd, 2008, 04:23 PM
Authorized User
 
Join Date: Jun 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Designing input data forms with CSS

All of the examples of input data forms that I find have the fields stacked on top each other, i.e.
   Label: Input text box
   Label: Input text box
   Label: Input text box

I would like to lay my forms out like:

   Label: Input text box Label: Input text box
   Label: Input text box Label: Input text box Label: Input text box Label: Input text box
etc.

I am trying to use the <fieldset> tag.

Doing this is SO easy with tables but I can't seem to be able to do using html and css.

Appreciate any help you can give me.

 
Old June 23rd, 2008, 04:39 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

What problem do you have? LABEL and INPUT are inline level elements so they'll line up just like words on the same line all by themselves if you don't do something to change that.

--
http://yupapa.com
 
Old June 23rd, 2008, 07:31 PM
Authorized User
 
Join Date: Jun 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've reduced my code down to
HTML
<body>

        <label for="first">First:</label><input name="first" id="first" type="text" size="20">
        <label for="last">Last:</label> <input name="last" id="last" type="text" size="20">
<br />
        <label for="addr1">Address 1:</label>
        <input name="addr1" id="addr1" type="text" size="20">
<br />
        <label for="addr2">Address 2:</label>
        <input name="addr2" id="addr2" type="text" size="20">

</body>

CSS
label {
    float: left;
    width: 5em;
}

DISPLAYS
First: "Test Box" "Text Box"
Last: Address 1: "Test Box"
Address 2: "Text Box"

I'm new to CSS and HTML 4 so the solution might be pretty obvious and basic to someone fairly knowledgeable to both. Sorry.







Similar Threads
Thread Thread Starter Forum Replies Last Post
User Forms & Checking Input JezLisle Excel VBA 0 February 6th, 2008 08:34 AM
copying input data to another worksheet with code kwik10z Excel VBA 3 November 2nd, 2007 01:45 PM
Requesting Data Input from Operator Ralph Weikert MySQL 0 May 5th, 2006 09:48 PM
Designing data access classes in ASP.NET shawnm ASP.NET 1.x and 2.0 Application Design 3 August 4th, 2004 02:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.