4

我有这个问题:

**http://img687.imageshack.us/img687/4668/problempu.jpg**

我想在标题中保留 4-5 行文本,以便价格和“添加到购物车”按钮对齐。

我能做些什么?现在我有这个:

.product-grid {
margin-bottom:15px;
margin-left:auto;
margin-right:auto;
width:auto;
text-align:center;
}

.product-grid .item-box {
float:left;
text-align:center;
vertical-align:text-top;
padding:5px;
}

.product-grid .item-box:hover {
background:#F9F9F9;
}

.product-grid .product-item {
text-align:center;
width:177px;
height:350px;
margin:0;
padding:0;
}

*.product-grid .product-item .product-title** {
font-weight:700;
font-size:12px;
font-family:Ubuntu, Helvetica, Arial, sans-serif;
padding:0;
}

.product-grid .product-item .product-title a {
display:block;
height:auto;
line-height:1.3em;
overflow:hidden;
font-family:Ubuntu,Helvetica, Arial, sans-serif;
padding:4px 10px 8px 0;
}

.product-grid .product-item .picture {
text-align:center;
height:177px;
}

.product-grid .product-item .picture img {
position:relative;
vertical-align:middle;
border-radius:5px;
border:1px solid #eee;
}

.product-grid .product-item .description {
display:none;
text-align:center;
border-top:solid 1px #e3e3e3;
color:#555;
height:50px;
font-size:120%;
margin:5px 5px 0;
padding:10px 5px;
}

.product-grid .product-item .add-info {
vertical-align:bottom;
text-align:right;
width:auto;
height:auto;
position:relative;
}

.product-grid .product-item .prices {
text-align:center;
vertical-align:middle;
position:static;
bottom:15px;
right:10px;
font-weight:700;
font-size:170%;
}

.product-grid .product-item .prices .product-price,.product-grid .product-item .prices .old-product-price {
margin:0;
}

.product-grid .product-item .prices .product-price .price {
color:#ef2525;
font-family:Ubuntu, Helvetica, Arial, sans-serif;
text-shadow:0 0 1px #333;
font-size:140%;
font-weight:700;
}

.product-grid .product-item .prices .old-product-price .price {
font-height:bold;
color:#333;
text-decoration:line-through;
font-size:70%;
font-family:Ubuntu, Helvetica, Arial, sans-serif;
}

*.product-grid .product-item .buttons** {
vertical-align:bottom;
position:relative;
margin-top:15px;
text-align:center;
}

.product-box-add-to-cart-button {
cursor:pointer;
background:#427a93;
color:#fff;
text-shadow:none;
font-size:130%;
font-weight:700;
font-family:Ubuntu, Helvetica, Arial, sans-serif;
border:solid 1px #335e70;
-webkit-transition-duration:.2s;
-moz-transition-duration:.2s;
transition-duration:.2s;
border-color:#999;
padding:7px;
}

.product-box-add-to-cart-button:hover {
background:#335e70;
color:#fff;
text-shadow:0 1px 2px #000;
border:solid 1px #335e70;
-webkit-transition-duration:.2s;
-moz-transition-duration:.2s;
transition-duration:.2s;
}

我需要做哪些改变?

我已经尝试了所有我能找到的对齐和位置,但没有任何效果。我认为,如果我可以在标题中保留 4-5 行文本,我可以使它工作并对齐。

任何帮助,将不胜感激!谢谢!

4

1 回答 1

7

<p>用段落标签或<div>其他块级元素包装每个产品标题,并对每个产品标题应用相同的类名,例如“productTitle”,例如:

<div class="productTitle">ASUS X501A</div>

然后使用以下样式设置类:

.productTitle{height:4em;} // adjust to desired height.
于 2013-03-02T18:19:58.707 回答