Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-13-2005, 11:31 AM   PM User | #1
missing-score
Senior Coder


 
missing-score's Avatar
 
Join Date: Jan 2003
Location: UK
Posts: 2,194
Thanks: 0
Thanked 0 Times in 0 Posts
missing-score is on a distinguished road
Laying out forms with CSS

Hello , I am needing a bit of help laying out forms with CSS, and making them look nice at the same time..

I want the name of the field in a label to be on the left hand side, and the form field itself to be on the right. The field names on the left and fields on the right should line up with eachother (horizontally), and also line up vertically with other field names, fields...

The thing is, I have tried laying it out like this but found it very hard to get it looking how I want, when it did look right I was using alot of CSS styles and markup that I probably didnt need. Also, when my page was viewed without styles everything looked very messed up..

I am thinking of using tables to lay out the form, but I would like to give CSS one more go before I resort to using tables. Note that in this situation, having a usable site is important, (eg: accessible), but it is also very important that the form look good aswell.

Thanks
Matt
missing-score is offline   Reply With Quote
Old 08-13-2005, 01:07 PM   PM User | #2
mark87
Senior Coder

 
Join Date: Dec 2004
Location: Essex, UK
Posts: 2,636
Thanks: 0
Thanked 0 Times in 0 Posts
mark87 is on a distinguished road
A form layout with tables is usually not very frowned upon, as much as using a whole layout anyway. Designing a form with CSS is pretty hard.

Here's some examples of forms I've made with no tables.
Edit: removed per request


Don't know if they'll give you any ideas or not, so have a look at these links too -

http://www.cssdrive.com/index.php/ex...bleless_forms/

http://www.notestips.com/80256B3A007F2692/1/NAMO-5PQ38F
__________________
markaylward.co.uk

Last edited by jkd; 09-06-2005 at 06:30 PM..
mark87 is offline   Reply With Quote
Old 08-13-2005, 04:41 PM   PM User | #3
mrruben5
Regular Coder

 
Join Date: Nov 2004
Location: The Netherlands
Posts: 551
Thanks: 0
Thanked 0 Times in 0 Posts
mrruben5 is an unknown quantity at this point
Look ma no tables.
Alternatively, you can use the p tag instead of br.
__________________
CATdude about IE6: "All your box-model are belong to us"
mrruben5 is offline   Reply With Quote
Old 08-13-2005, 10:06 PM   PM User | #4
missing-score
Senior Coder


 
missing-score's Avatar
 
Join Date: Jan 2003
Location: UK
Posts: 2,194
Thanks: 0
Thanked 0 Times in 0 Posts
missing-score is on a distinguished road
Thanks mark87, the link you posted to CSS Drive is exactly what I was looking for! It's helped me to improve on my existing forms which were a mess of double nested <div> elements!

Also, on first testing in IE5 my design actually works properly!
missing-score is offline   Reply With Quote
Old 09-03-2005, 10:43 AM   PM User | #5
mark87
Senior Coder

 
Join Date: Dec 2004
Location: Essex, UK
Posts: 2,636
Thanks: 0
Thanked 0 Times in 0 Posts
mark87 is on a distinguished road
Hi, Sorry but can a mod edit my post above with the links in please? - no edit button is showing up!

I need the first 2 links to be deleted if poss (acc en do) because search engines are bringing up this page and I don't really want it to. Thanks!
__________________
markaylward.co.uk
mark87 is offline   Reply With Quote
Old 09-06-2005, 06:31 PM   PM User | #6
jkd
Senior Coder

 
jkd's Avatar
 
Join Date: May 2002
Location: metro DC
Posts: 3,163
Thanks: 1
Thanked 18 Times in 18 Posts
jkd will become famous soon enough
Done.
__________________
jasonkarldavis.com
jkd is offline   Reply With Quote
Old 09-06-2005, 09:43 PM   PM User | #7
mark87
Senior Coder

 
Join Date: Dec 2004
Location: Essex, UK
Posts: 2,636
Thanks: 0
Thanked 0 Times in 0 Posts
mark87 is on a distinguished road
Thanks!
__________________
markaylward.co.uk
mark87 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:19 AM.


Advertisement
Log in to turn off these ads.