OK I give, show me a CSS example

G

Guest

It is real easy for me to lay out this table and control <td widths..> etc..
for example.

<table>
<tr><td>Name : </td><td><input type="text' name="name"></td><td><input
type="submit" value="submit"></td></tr>
</table>

What is the correct way for me to control my spacing between my 3 cells in
CSS

<div> tag for each of the 3 with positions ?
I see boxes and padding styles, but can't quite get it to work.

What is the most efficient use here ?

Thanks.
 
W

William Tasso

Die said:
...
<table>
<tr><td>Name : </td><td><input type="text' name="name"></td><td><input
type="submit" value="submit"></td></tr>
</table>

What is the correct way for me to control my spacing between my 3
cells in CSS

Does this need CSS?
<label>Name: <input type="text' name="name"></label> <input> type="submit"
value="submit">
 
G

Guest

William Tasso said:
Does this need CSS?
<label>Name: <input type="text' name="name"></label> <input> type="submit"
value="submit">

Ok. Thanks.

But suppose for alignment purposes, I want 25px between 'Name:' and
'<input>'?

Hell, I might even want a second row with 'Occupation : ' and '<input>' and
want each column to line up vertically.

Thanks
 
L

Leif K-Brooks

Die said:
<table>
<tr><td>Name : </td><td><input type="text' name="name"></td><td><input
type="submit" value="submit"></td></tr>
</table>

That is tabular data if you change the first <td> to <th scope="row">.
Style it with CSS, making the th a certain em width for instance.
 
R

Richard

Die! said:
It is real easy for me to lay out this table and control <td widths..>
etc.. for example.
<table>
<tr><td>Name : </td><td><input type="text' name="name"></td><td><input
type="submit" value="submit"></td></tr>
</table>
What is the correct way for me to control my spacing between my 3 cells
in CSS
<div> tag for each of the 3 with positions ?
I see boxes and padding styles, but can't quite get it to work.
What is the most efficient use here ?


One possible way might be to do it this way:

div.holder { width:00px; height:00px; blah blah blah }
div.box {width:00%; height:00px; blah blah blah float:left;}
div.spacer {width:00% height:00px; blah blah blah float:left;}

<div class="holder">
<div class="box">name:</div>
<div class="spacer"></div>
<div class="box"><input type="text' name="name"></div>
<div class="spacer"></div>
<div class="box"<input type="submit" value="submit></div>
</div>

Brucie dear, I did say one possible way. Purely as an example as how it
COULD be achieved.
 
L

Leif K-Brooks

Richard said:
One possible way might be to do it this way:

div.holder { width:00px; height:00px; blah blah blah }
div.box {width:00%; height:00px; blah blah blah float:left;}
div.spacer {width:00% height:00px; blah blah blah float:left;}

Why the double 0s (00 instead of 0), and why specify a unit for 0 at all?
<div class="holder">
<div class="box">name:</div>
<div class="spacer"></div>
<div class="box"><input type="text' name="name"></div>
<div class="spacer"></div>
<div class="box"<input type="submit" value="submit></div>
</div>

I still don't get the purpose of that div.spacer. I could understand if
it was for clearing the previous row, but it doesn't seem to.
Brucie dear, I did say one possible way. Purely as an example as how it
COULD be achieved.

If you didn't want it to work, that is. Even with the obvious errors
(missing > in HTML, missing ; in CSS) corrected, it will look like this:
http://tw.ecritters.biz/html_examples/richard/insane_form/.
 
W

William Tasso

Die said:
But suppose for alignment purposes, I want 25px between 'Name:' and
'<input>'?

Don't use px unless you need to align with an image.
Hell, I might even want a second row with 'Occupation : ' and
'<input>' and want each column to line up vertically.

Hell indeed ;o)

ok - I've got a few of these. I'm not happy that I've got to the optimal
markup/css yet, but you are welcome to take it forward if you like. Here's
one:

http://williamtasso.com/components/guestbook.asp
 
R

Richard

Why the double 0s (00 instead of 0), and why specify a unit for 0 at all?

Only to show that there is a number to go in front of the units.
I still don't get the purpose of that div.spacer. I could understand if
it was for clearing the previous row, but it doesn't seem to.

The spacer idea is just that. Rather than the technique of using some
idiotic image deal.
The values for which can be changed to seperate the actual items as desired.
If you didn't want it to work, that is. Even with the obvious errors
(missing > in HTML, missing ; in CSS) corrected, it will look like this:
http://tw.ecritters.biz/html_examples/richard/insane_form/.

What? We're supposed to write the entire code for these people?
It's purely an example.


Isn't the biz tld supposed to be for businesses only? What business is
"ecritters" involved in?
 
R

Richard

Why the double 0s (00 instead of 0), and why specify a unit for 0 at all?
I still don't get the purpose of that div.spacer. I could understand if
it was for clearing the previous row, but it doesn't seem to.
If you didn't want it to work, that is. Even with the obvious errors
(missing > in HTML, missing ; in CSS) corrected, it will look like this:
http://tw.ecritters.biz/html_examples/richard/insane_form/.

http://www.1-large-world.com/samples/submit.html

corrected and functional.
 
L

Leif K-Brooks

Richard said:
What? We're supposed to write the entire code for these people?
It's purely an example.

To the point where it actually works, you mean? Yes, or it's an example
of nothing.
 
R

Richard

Except for the fact that the submit button is overlapping the input box.
Why not use margins instead of div.spacers, anyway?

Oh bullshit. It couldn't possibly overlap due to the spacer box.
As I said above, this is one possible way. Not the only way.
 
L

Leif K-Brooks

Richard said:
Oh bullshit. It couldn't possibly overlap due to the spacer box.
As I said above, this is one possible way. Not the only way.

Maybe it can't, but it does. Have you actually tried it, or are you just
positive that you can't be wrong?
 
R

Richard

Maybe it can't, but it does. Have you actually tried it, or are you just
positive that you can't be wrong?

Yes dumbass. I have checked it out online as I always do before posting the
link.
You're just being frickin nit picky.
Since I have "holder" set to a defined space, it can't possibly overlap.
When the browser window is shrunk, everything stays put and you get a
horizontal scroll bar.
Show me a screen shot, asshole.
 
T

Toby A Inkster

Richard said:
The spacer idea is just that. Rather than the technique of using some
idiotic image deal.

But why not:

<div class="holder">
<label for="name">name:</label>
<input type="text" name="name" id="name">
<input type="submit">
</div>

And use padding-left and padding-right on each element to control spacing?
 
W

Wayne D Hammond

Leif said:
Why the double 0s (00 instead of 0), and why specify a unit for 0 at all?



I still don't get the purpose of that div.spacer. I could understand if
it was for clearing the previous row, but it doesn't seem to.



If you didn't want it to work, that is. Even with the obvious errors
(missing > in HTML, missing ; in CSS) corrected, it will look like this:
http://tw.ecritters.biz/html_examples/richard/insane_form/.

Perhaps you were looking for this?

<div class="holder">
<div class="box">name:</div>
<div class="spacer">&nbsp;</div>
<div class="box"><input type="text" name="name"></div>
<div class="spacer">&nbsp;</div>
<div class="box"><input type="submit" value="submit"></div>
</div>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top