我在另一个里面有一个 DIV。其中之一有“纯文本”,我想做的是尽可能使其宽度自动最大化。
这是代码:
HTML:
<div class="artigo_nome"> <!-- here is the part that I need help -->
<p>
Computador Apple Imac 27P I5 3.5Ghz/8Gb/1Tb Md096Po/A
</p>
</div>
<div class="artigo_definicoes round_corner">
<div class="separador_artigo_imagem">
<img src="img/artigos/fones.png" class="imagem_artigo" alt="artigo"/>
</div>
<div class="artigo_info">
Computador Apple Imac 27P I5 3.5Ghz/8Gb/1Tb Md096Po/A<br />
<span class="ler_mais">ver mais</span><br />
<span class="comparar">adicionar para comprar</span>
</div>
</div>
CSS:
.categoria_lista_artigos .artigo_nome{
color:#6e6e6e;
width:234px;
height:34px;
margin-left: -2px;
border-radius:5px 5px 0 0;
border-left:2px #aeaeae solid;
border-right:2px #aeaeae solid;
border-bottom:1px #aeaeae solid;
/*background-color:#E6E6E6;*/
position:relative;
font-weight: 600;
-webkit-box-shadow: 0px -3px 5px #e2e2e2;
-moz-box-shadow: 0px -3px 5px #e2e2e2;
box-shadow: 0px -3px 5px #e2e2e2;
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #cfcfcf 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#cfcfcf)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#cfcfcf 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#cfcfcf 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#cfcfcf 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffffff 0%,#cfcfcf 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#cfcfcf',GradientType=0 ); /* IE6-9 */
}
.categoria_lista_artigos .artigo_nome div {
margin: auto;
padding: 4px 13px;
vertical-align: middle;
line-height:13px;
}
如果你还需要什么,就说吧。