Как я предотвращаю разрыв строки, происходящий перед незаказанным списком?

Выезд OCUnit. Сеть разработчиков Apple имеет большое введение .

11
задан wickedone 1 June 2012 в 23:50
поделиться

5 ответов

Как насчет настройки тега p для отображения: inline? Это вариант?

p { display: inline; }

Что касается проблемы с тегом p ... Я не верю, что спецификации W3C позволяют использовать тег неупорядоченного списка в теге абзаца. Из http://www.w3.org/TR/html401/struct/text.html#h-9.3.1 :

Элемент P представляет абзац. Он не может содержать элементы уровня блока (включая сам P).

12
ответ дан 3 December 2019 в 08:04
поделиться
ul.errorlist { display: inline; margin: 0; }
1
ответ дан 3 December 2019 в 08:04
поделиться

И последний бит:

ul.errorlist {
  display: inline;
  list-style-type: none; 
}
1
ответ дан 3 December 2019 в 08:04
поделиться

Do you just want to eliminate the space between the paragraph and the list?

If so, use:

ul.errorlist {
    margin-top:0;
}

Then add "margin-bottom:0;" to the paragraph (or just put the errorlist inside the p tags). If you also want the list to display on a single line, use display:inline as the others suggested.

1
ответ дан 3 December 2019 в 08:04
поделиться

If you can't change the html then your problem is that the ul has no element around it that you can style.

If you use javascript, if you can know when an error happens, then you can add a

or around the

    and then style that so that it will be inline.

    This link shows, about 1/2 way down, using the

    tag for this purpose.

    http://www.alistapart.com/articles/taminglists/

    If you are just trying to do this in css I believe you will be out of luck. You may ask if they can put a enclosing tag around the error list so you are able to style it.

0
ответ дан 3 December 2019 в 08:04
поделиться