html - 如何在文本字段展开时使盒子容器展开?

标签 html css

我试图让我的文本字段在容器展开时展开。这是我的容器和我的文本字段的图片:

a

现在,当我展开 Product Link 文本字段时,结果如下:

s

当它应该使盒子的高度变大时。这是我用于容器和文本字段的 CSS:

CSS

/* UserPrice Container & Fields */
#user-price-container {
    background:#FFFFFF;
    border:black solid 1px;
    font-family:Arial, Helvetica, sans-serif;
    margin-top:5px;
    width: 950px;
}
.user_price_labels {
    margin-left:5px;
    font-weight:bold;
    color:#78AF00;
}
.user-price-fields {
    font-family:Arial, Helvetica, sans-serif;
    border-right: 1px solid #90BF22;
    border-style: solid;
    border-width: 1px;
    box-shadow: 0 1px 0 #FFFFFF, 0 1px 1px rgba(0, 0, 0, 0.17) inset;
    color: #333333;
    font-size: 13px;
    -moz-box-sizing: border-box;
    background: #FFFFFF;
    border-color: black;
    border-radius: 1px 1px 1px 1px;
    display: inline-block;
    height: 25px;
    padding-left: 8px;
    margin-left:5px;
}
/* Individual Text-fields*/
#user-price-price, #user-price-product, #user-price-exact-url {
    margin-top:-2px;
}
#user-price-product-container {
    margin-top:5px;
    margin-left:5px;
}
#user-price-price-container {
    margin-top:5px;
}
#user-price-product-store-container {
    margin-top:-14px;
    height:35px;
}
#user-price-exact-url-container {
    margin-left:44px;
    margin-top:-14px;
    height:35px;
}

HTML(960gs)

<div id="user-price-container" class="grid_24">

    <p id="user-price-product-container" class="grid_12"><label class="user_price_labels" for="user_prices_0_product_name">Product*</label><br />
        <input class="user-price-fields" data-autocomplete="/prices/autocomplete_product_name" id="user-price-product" name="user_prices[0][product_name]" size="60" type="text" /></p>

     <p id="user-price-price-container" class="grid_4"><label class="user_price_labels" for="user_prices_0_price">Price*</label><br />
        <input autocomplete="off" class="user-price-fields" id="user-price-price" name="user_prices[0][price]" placeholder="00.00" size="10" type="text" /></p>

     <p id="user-price-product-store-container" class="grid_11"><label class="user_price_labels" for="user_prices_0_product_store">Location*</label><br />
        <input class="product_store" id="user_prices_0_product_store" name="user_prices[0][product_store]" size="30" type="text" /></p>

     <p id="user-price-exact-url-container" class="grid_9"><label class="user_price_labels" for="user_prices_0_exact_url">Product Link</label><br />
        <textarea class="user-price-fields" cols="40" id="user-price-exact-url" name="user_prices[0][exact_url]" rows="20"></textarea></p>
</div>

如何让它在宽度上动态扩展?

感谢您花时间阅读本文。

最佳答案

从这个类中删除高度,我认为它会起作用,也许将其更改为最小高度而不是删除它。

#user-price-exact-url-container {
    margin-left:44px;
    margin-top:-14px;
    height:35px;
}

关于html - 如何在文本字段展开时使盒子容器展开?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8596736/

相关文章:

html - 使用 Bootstrap 使图像跨越浏览器的整个宽度

html - 如何重置父元素内的所有边距和填充?

javascript - 网页 : Animated clouds -- overflow and middle mouse click?

CSS,两个可变宽度的灵活字段,如果长则各占50%

javascript - 如果日期月份等于输入的隐藏值,则更改 div

HTML,为大行创建行号

html - 具有未知尺寸的动画 div 尺寸过渡

jquery - 如何在 JQuery 中将 DIV 置于顶部和绝对位置?

css - Bootstrap popover - 将其移动到左侧/右侧

css - django 1.8 管理站点 css 问题,而 css 文件加载正常