Приготовление панировочных сухарей ... не так просто, как буквально изготовить сухари, как я могу оказаться внутри?

StackOverflow https://stackoverflow.com/questions/19846836

  •  29-07-2022
  •  | 
  •  

Вопрос

Итак, я сделал несколько сухариков через код из

http://line25.com/tutorials/how-to-create-flat-meale-breadcrumb-links-with-css

... и у меня все было так, как мне нравится, только ради жизни я не могу понять, как получить текст в коробки ... проблема в том, что они существуют отдельно, я могу использовать линию -Вет еще дальше, чтобы вытолкнуть текст на страницу, однако я не могу использовать отрицательное число, чтобы подтолкнуть текст .... То же самое касается поля ...

РЕДАКТИРОВАТЬ: Я знаю, что код из Link25 отлично работает для текста внутри, это потому, что я уменьшил контейнеры, которые у меня есть эта проблема ...

Любые идеи?

Вот HTML (Stackoverflow продолжает переводить его):HTML

И CSS:

body {
margin: 0px;
font-family: 'Roboto';
background: #eeeeee; }

Crumbs {Text-Align: Center; }

#crumbs ul {
    list-style:none;
    display: inline-table;

}

    #crumbs ul li { display: inline-block; }

        #crumbs ul li a {    /* The block part of each breadcrumb; the text in each breadcrumb */
            display: block;
            float: left;
            height: 0px;
            background: #327098;
            /*text-align: center; */
            padding: 30px 10px 0 80px;  /* size of each breadcrumb  */
            position: relative;
            margin: 0 5px 0 0;
            font-size: 16px;
            text-decoration: none;
            color: #000000; }

            #crumbs ul li a:after { /* The triangle to the right of each breadcrumb */
                content: "";
                border-top: 15px solid transparent;
                border-bottom: 15px solid transparent;
                border-left: 15px solid #327098;
                position: absolute;
                right: -15px;
                top: 0;
                z-index: 1; }

            #crumbs ul li a:before {    /* the triangle to the left of each breadcrumb  */
                content: "";
                border-top: 15px solid transparent;
                border-bottom: 15px solid transparent;
                border-left: 15px solid #eeeeee;
                position: absolute;
                left: 0;
                top: 0; }

        #crumbs ul li:first-child a {    /* what makes the first breadcrumb have a rounded left side */
            border-top-left-radius: 10px;
            border-bottom-left-radius: 10px; }

            #crumbs ul li:first-child a:before { display: none; }

        #crumbs ul li:last-child a {
            padding-right: 80px;    /* the width of the last breadcrumb */
            border-top-right-radius: 10px;  /* Makes the right side of the last breadcrumb rounded */
            border-bottom-right-radius: 10px; } /* rounded */

            #crumbs ul li:last-child a:after { display: none; }

        #crumbs ul li a:hover { background: #c9c9c9; }   /* a hover color for breadcrumbs, exclu. triangle-right    */

            #crumbs ul li a:hover:after { border-left-color: #c9c9c9; } /* a hover color for triangle-right */
Это было полезно?

Решение

http://jsfiddle.net/zh6bw/1/

Это вызвано тем, что ваши якоря имеют верхнюю прокладку, равную высоте, которую вы хотите, чтобы крошки имели. Я удалил эту прокладку, дал элемент сдерживающего списка height:30px;, дал якорям line-height:30px; Таким образом, они остаются вертикально центрированными.

#crumbs ul li { 
    display: inline-block; 
    height:30px;
}

#crumbs ul li a {    /* The block part of each breadcrumb; the text in each breadcrumb */
    display: block;
    line-height:30px;
    background: #327098;
    /*text-align: center; */
    padding: 0 10px 0 80px;  /* size of each breadcrumb  */
    position: relative;
    margin: 0 5px 0 0;
    font-size: 16px;
    text-decoration: none;
    color: #000000;
}

Редактировать

Я не уверен, что вы имеете в виду под ними, существующим отдельно. Я только что скопировал код, который вы предоставили в скрипку и запустили его. И я увидел очевидную проблему, и я сделал то, что мог. Вот проблема, которую я видел. http://jsfiddle.net/zh6bw/

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