Max-Min Width on Form?

Can you set a max and min width on a Form?

Right now, I have my Form nested in a <div>…


<!-- ADD A COMMENT -->
	<div id="boxMainContent">
		<div id="boxAddComment">
			<h3>What Do You Think?</h3>
			<form id="addComment" action="" method="post">

…with these styles…


#boxAddComment{
	min-width: 340px;
	max-width: 580px;
	margin: 40px auto;
	padding: 0 30px 30px 30px;
	border: 1px solid #333;
}

If I can lose the extra layer, that would be great!

Debbie

Does it work when you test it? If it does then yes it works. That’s I how find my answers. But yes I believe that would work just as a div would.

It should be fine to set a min and max width on the form, but that’s not quite what you’ve done here. You’ve set it on the containing div, which should work too.

There’s no point in have id=“addComment”, though, as you could target the form with #boxAddComment form { … }. Just saying. :slight_smile:

It didn’t seem to work, but my page is all messed up…

Debbie

Thus my question! :wink:

There’s no point in have id=“addComment”, though, as you could target the form with #boxAddComment form { … }. Just saying. :slight_smile:

Good point.

I haven’t had a chance to refactor these latest pages…

Thanks,

Debbie

Why not?

Just set up a simple <form> in a <body> and you will see that you can without any problems :smiley:

Then that means you have something else wrong. It doesn’t mean you can’t set limits on the form width.