•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 423,414 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,721 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 793 | Replies: 2
![]() |
•
•
Join Date: Jul 2006
Posts: 111
Reputation:
Rep Power: 3
Solved Threads: 0
Hello,
Is there a way to create a grid-like form with CSS? Meaning, I would like the label and input fields to be equidistant from one another. It naturally happens if I use tables but is there a way to achieve the same effect with CSS?
Floating label elements to the left and floating input elements to the right does quite achieve the same effect. Can't find a relevant solution by googling, many thanks in advance.
Is there a way to create a grid-like form with CSS? Meaning, I would like the label and input fields to be equidistant from one another. It naturally happens if I use tables but is there a way to achieve the same effect with CSS?
Floating label elements to the left and floating input elements to the right does quite achieve the same effect. Can't find a relevant solution by googling, many thanks in advance.
Hi ryy705,
You will have to use CSS to achieve what you want. A example would be;
And your html will be as follows:
Very easy to understand. But if you having any problems, Just shout.
You will have to use CSS to achieve what you want. A example would be;
#col {width:250px;float:left;margin:2px;}
#row {width:100%; margin:2px}
And your html will be as follows:
<form action="ac_contact.php" method="post"> <div id="row"> <div id="col">Name:</div> <div id="col"> <input type="text" name="name" /> </div> </div> <div id="row"> <div id="col">Surname:</div> <div id="col"> <input type="text" name="surname" /> </div> </div> </form>
Very easy to understand. But if you having any problems, Just shout.
![]() |
•
•
•
•
•
•
•
•
DaniWeb HTML and CSS Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- VB6 Database Program (Visual Basic 4 / 5 / 6)
- Problem regarding combo box components (Pascal and Delphi)
- How can I generate report from data grid?? (VB.NET)
- Connecting to .MDB with VB.net (VB.NET)
- Can't get grid to work! (Python)
- How would I make a text adventure? (Python)
- Blank Record & Open Form From Datagrid (C#)
- need help with tables (VB.NET)
- Help On Grid Computing (Computer Science and Software Design)
- Timer Question (Visual Basic 4 / 5 / 6)
Other Threads in the HTML and CSS Forum
- Previous Thread: centering website with CSS
- Next Thread: CSS Margin Problem



Linear Mode