-1
我有一個包含三個部分(div)的標題。當我調整瀏覽器窗口的大小時,標題元素正在打包。屏幕截圖和代碼的外觀如下:如何防止元素在div中的包裝?
1)HTML:
<div class="container">
<div class="header">
<div class="header-left-part">
<div class="header-title-left-part">
<a href="http://www.nestro.ru/ru/" target="_blank"><img src="../../Images/Zarubezneft.png" /></a>
<img src="../../Images/50years.png" />
</div>
</div>
<div class="header-middle-part"></div>
<div class="header-right-part">
<div class="header-title-right-part-login">
<a href="http://www.rvpetro.ru/" target="_blank">
<img src="../../Images/Rusvetpetro.png" />
</a>
</div>
</div>
</div>
2)CSS:
html, body {
margin: 0;
padding: 0;
min-width: 1200px;
width: auto !important;
}
...
.container {
position: relative;
}
.header
{
position: absolute;
height: 40px;
width: 100%;
z-index: 110;
white-space: nowrap;
}
.header-left-part
{
position: absolute;
height: 40px;
width: 25%;
background: #eaaa00; /* For browsers that do not support gradients */
background: -webkit-linear-gradient(left, #fef9e7, #ffdb8b); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(right, #fef9e7, #ffdb8b); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(right, #fef9e7, #ffdb8b); /* For Firefox 3.6 to 15 */
background: linear-gradient(to right, #fef9e7, #ffdb8b); /* Standard syntax (must be last) */
white-space: normal;
}
.header-middle-part
{
position: absolute;
height: 40px;
left: 25%;
width: 50%;
background: #eaaa00; /* For browsers that do not support gradients */
background: -webkit-linear-gradient(left, #ffdb8b, #b2a000); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(right, #ffdb8b, #b2a000); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(right, #ffdb8b, #b2a000); /* For Firefox 3.6 to 15 */
background: linear-gradient(to right, #ffdb8b, #b2a000); /* Standard syntax (must be last) */
text-align: center;
font-size: 18px;
font-weight: bold;
white-space: normal;
}
.header-right-part
{
position: absolute;
height: 40px;
left: 75%;
width: 25%;
background: #EAAA00; /* For browsers that do not support gradients */
background: -webkit-linear-gradient(left, #b2a000, #138d75); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(right, #b2a000, #138d75); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(right, #b2a000, #138d75); /* For Firefox 3.6 to 15 */
background: linear-gradient(to right, #b2a000, #138d75); /* Standard syntax (must be last) */
color: white;
white-space: normal;
}
.header-title-left-part
{
float: left;
margin-left: 15px;
margin-top: 2px;
font-size: 18px;
font-weight: bold;
}
.header-title-middle-part-text
{
float: left;
width: 100%;
height: 40px;
margin-top: 8px;
font-size: 18px;
font-weight: bold;
text-align: center;
}
.header-title-right-part-login
{
float: right;
margin-right: 3px;
margin-top: 0px;
}
.title-right-main
{
float: right;
margin-right: 3px;
margin-top: 1px;
}
.title-right-main-icons
{
float: right;
margin-right: 3px;
margin-top: 12px;
}
如何解決呢?
問題是您沒有足夠的空間來顯示內容,這是它換行的原因。所以問題是,你對「修復」有什麼期望?隱藏一些內容?使標題本身更大一點?媒體查詢可能對你有幫助嗎? –
預期是賺錢而不學習工作方式。這是俄羅斯如何在整個工作。 –
也許隱藏內容會適合。 – tesicg