Вопрос

Я пытаюсь предотвратить разрыв строки в этом HTML

http://jsfiddle.net/dd3v8/

Это случается, что, когда я изменил размер моего окна, как значки, так и текстовые нарушения в новую строку.Я уже пытался с собственностью Whitespace CSS.Я также пробовал, табличный подход, но поведение то же самое

Может ли кто-нибудь понять, что происходит?

Спасибо заранее

Это было полезно?

Решение

Попробуйте:

.line {
            height: 44px; 
            width: 100%; 
            display: inline-block; 
            background-color: #6c7987;
            white-space: nowrap;
            position: relative;
        }

        .icon {
            position: absolute;
            left: 0;
            height: 44px; 
            width: 90px; 
            background-color: 
            #FF0080; 
            color: white;
            text-align: center;
            line-height: 44px;
            font-family: Arial;
            float: left;
            font-size: 12px;
            font-weight: bold;
            padding: 0;
        }

        .title {
            position: absolute;
            left: 90px;
            color: white;
            line-height: 44px;
            text-align: left;
            padding: 0 0 0 10px;
            font-family: Arial;
            float: left;
            font-size: 12px;
            display: inline;
            white-space:nowrap;
        }

        .botoes {

            position: absolute;
            width: 300px;
            right: 0
        }

        .botao {
            width: 46px;
            height: 45px;
            float: right;
            line-height: 44px;
            text-align: center;
            display: block;
            white-space:nowrap;
            cursor: pointer;
        }

        .botaoVerRecurso {
            background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
        }

        .botaoVerRecurso:hover {
            background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
        }

        .botaoEditarRecurso {
            background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
        }

        .botaoEditarRecurso:hover {
            background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
        }

        .botaoFavRecurso {
            background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
        }

        .botaoFavRecurso:hover {
            background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
        }

        .botaoPartRecurso {
            background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
        }

        .botaoPartRecurso:hover {
            background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
        }

        .botaoApagarRecurso {
            background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
        }

        .botaoApagarRecurso:hover {
            background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
        }

        .clear {
            clear: both;
        }
.

Объяснение простое: с плавающей, вы не можете поставить больше ширины в держатель, который больше, чем высота держателя, поплавок будет автоматически отбросить его и разбивает линию.

Если вы используете позиции, используйте это так:

Контейнер (позиция: относительный)

SUBELEMENT (POSISISE: ABLUTE, TOP: 0, слева: 0) <положить в верхний левый
SUBELEMENT (POSISISE: ABLUTE, ДНЕМ: 0, справа: 0) <Удалить в нижнее правое

в W3C: http://www.w3schools.com/css/css_position.asp

Другие советы

Если я понимаю вашу проблему корректно, вам нужно быть в состоянии изменить размер ширины окна, не имея текста и значки «X», прыгающих вниз, это так:

<Сильные> Удалить CSS из .title

min-width: 500px;
.

Смотрите это Рикл пример !

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top