Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html CSS:应用溢出时文本对齐错误_Html_Css - Fatal编程技术网

Html CSS:应用溢出时文本对齐错误

Html CSS:应用溢出时文本对齐错误,html,css,Html,Css,问题是当我想显示所有div内容时,显示不正确,似乎对齐不起作用。有人能帮我解决这个问题吗?我当前的CSS代码片段是这样的 HTML <section id="32" class="products" name="4" company="1"> <div class="product-header-container"> <div class="title-product"> <input id="32" type="

问题是当我想显示所有div内容时,显示不正确,似乎对齐不起作用。有人能帮我解决这个问题吗?我当前的CSS代码片段是这样的

HTML

<section  id="32" class="products"  name="4"   company="1"> 
   <div class="product-header-container">
    <div class="title-product">
      <input id="32"  type="checkbox"  tax="0" value="1248" RangePricing="0" OrderNumber="56" name="Basic"  checked > <span class="title-product-value">   U.S. Maintenance Plan  </span>
    </div> 
    <div class="price-product">
      <span class="price-product-value">$1,248.00</span>
    </div>
    <div class="description-product" hidden>Pays for the regular maintenance</div>      
    <div class="displayname-product">Pays for the regular maintenance</div>
  </div>

  <li class="bulletPoint">Oil &amp; Filter Replacement</li>
  <li class="bulletPoint">Tire Rotation</li>
  <li class="bulletPoint">Fuel Injection</li>
  <li class="bulletPoint">Breake Pads and Rental Car Allowance</li>
  <li class="bulletPoint">Service</li>

  <div class="icons-products">
    <a style="padding-right:5px;" id="modal1" class="linkmodal1 UsingWebService"data-toggle="modal" data-target="#myModal1" ><i class="fa fa-cog" title="Options"></i></a>
    <a style="padding-right:5px;" id="modal2" class="linkmodal2"data-toggle="modal" data-target="#myModal2" ><i class="fa fa-file-text-o" title="Brochure"></i></a>
  </div>
</section>


谢谢

您是否尝试从
中删除宽度。price product value
?由于您有固定的宽度,某些价格可能会溢出,如果您有
溢出:auto
,它将显示滚动条。您还可以尝试更改为相对的
overflow:hidden

位置
.product header container
(即
Position:relative
)。然后,将
.price-product
绝对定位(即
位置:绝对
),并将
.price-product
坐标设置为类似
顶部:5px
右侧:5px
。使用它将价格div放置在右上角


.price product
中删除
浮动
溢出
文本对齐
。您只需删除
.price product value
类即可。另外,
.price产品中的
span
也不是必需的。

请尽量解释清楚。你到底有什么问题?一些价格下的滚动条?这就是问题所在,滚动条和价格的对齐方式更改
溢出:自动
溢出:隐藏
我不想隐藏溢出,我只想显示内容并垂直对齐所有数字:)数字对齐(向右)!你的问题是滚动条。从
.price product
中删除宽度时会发生什么情况?我想这是你的问题。
.title-product {
    color: #41699A;
    font-weight: bold;
    float: left;
    font-size: 11px;
    width: 70%;
    display: inline-block;
}

.price-product {
    float: right;
    overflow: auto;
    font-size: 11px;
    margin-top:5px;
    padding-left: 0px;
    text-align: right;
}

.price-product-value {
    width: 45px;
    text-align: right;
}