I’m having problems with this site I am building. I need a fixed width so that I can do margin-left and margin-right auto (center the form item on my ‘left window’. Problem is that I’m trying to make this code modular so that it will work with any future forms I decide to create as well, meaning I need a variable height, depending on how many fields a form will need.
so to clarify the above statement, I’m trying to keep the fixed width and have a variable height (using min-height). The problem is that the background color and div border are not shrinking or expanding along with the div size. any ideas?
the site is here: http://traelid.com/news/createNews.php
here is my form code and my CSS code:
FORM:
<script type='text/javascript' src='../nicEdit/nicEdit.js'></script>
<script type='text/javascript'>
bkLib.onDomLoaded(function() {nicEditors.allTextAreas() });
</script>
<div class='frmcontainer'>
<div class='title'>TraeLid News</div>
<div class='fill'>
<div class='row'>
<div class='frm lbl'>
<label for='author'>Author:</label>
</div>
<div class='frm itm'>
Auto Author
</div>
</div>
<div class='row'>
<div class='frm lbl'>
<label for='subject'>Subject:</label>
</div>
<div class='frm itm'>
<input class='itm itmtxt' type='text' name='subject' />
</div>
</div>
<div class='row'>
<div class='frm lbl'>
<label for='content'>Content:</label>
</div>
<div class='frm itm txtarea' style='background-color:#fff;'>
<textarea class='itm itmtxtarea ckeditor' name='content'></textarea>
</div>
</div>
<div class='row'>
<div class='frm lbl'>
<label for='tags'>Tags:</label>
</div>
<div class='frm itm'>
<input class='itm itmtxt' type='text' name='tags' />
</div>
</div>
</div>
</div>
CSS:
.frmcontainer
{
text-align:center;
width:750px;
min-height:200px;
margin-left:auto;
margin-right:auto;
border-radius:10px;
border-width:1px;
border-style:solid;
}
.frm
{
margin:5px;
}
.title
{
clear:both;
width:750px;
margin-bottom:24px;
font-size:28px;
font-weight:bold;
text-decoration:underline;
font-variant:small-caps;
}
.row
{
width:750px;
height:auto;
float:left;
clear:both;
}
.lbl
{
font-size:18px;
font-weight:bold;
text-align:left;
height:30px;
width:150px;
float:left;
}
/*Container and input styles*/
.itm
{
text-align:left;
height:25px;
width:580px;
float:left;
}
.itmtxt
{
width:576px;
border-style:solid;
border-width:1px;
}
.txtarea
{
height:400px;
}
.itmtxtarea
{
width:578px;
height:343px;
border-style:solid;
border-width:1px;
}
.nicEdit-panel
{
background-color: #eee;
}
.nicEdit-selected
{
background-color: #fff;
word-wrap:break-word;;
overflow:hidden;
}
.nicEdit-main
{
word-wrap:break-word;
overflow:hidden;
max-height:343px;
}
on .frmcontainer add
overflow: hidden;. fiddle ex