0

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

.speedbar a:nth-child(1)::before {
    border-left: 17px solid #ef5350;
    border-radius: 2px;
}

.speedbar {
    margin: 0 10px 10px 8px;
    text-transform: uppercase;
    text-align: left;
}
.speedbar a, .speedbar b {
    background: #ef5350;
    border-radius: 2px 0 0 2px;
    margin: 4px 0px 0 4px;
    padding: 8px 17px 8px 30px;
    position: relative;
    text-align: center;
    color: #fff;
    line-height: 1.5;
    box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),0 1px 5px 0 rgba(0,0,0,0.12),0 3px 1px -2px rgba(0,0,0,0.2);
}
.speedbar a::after, .speedbar b::after {
    border-bottom: 17px solid transparent;
    border-left: 17px solid #ef5350;
    border-top: 17px solid transparent;
    content: "";
    position: absolute;
    right: -17px;
    top: 0;
    z-index: 1;
}
.speedbar a::before, .speedbar b::before {
    border-bottom: 17px solid transparent;
    border-left: 17px solid #eee;
    border-top: 17px solid transparent;
    content: "";
    left: 0;
    position: absolute;
    top: 0;
}

.speedbar b {
    font-weight: 400;
}
.speedbar b span {
    font-size: 12px;
    position: relative;
    top: -1px;
    margin-right: 10px;
    background: #eee;
    padding: 5px 8px;
    border-radius: 2px;
    color: #555;
}
<span class="speedbar" id="dle-speedbar">
    <span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
        <a href="/" itemprop="url">
            <span itemprop="title">Мебель</span>
        </a>
    </span>
    <span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
        <a href="/lastnews/" itemprop="url">
            <span itemprop="title">Работы</span>
        </a>
    </span>
    <span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
        <a href="/kuhni/" itemprop="url">
            <span itemprop="title">Кухни</span>
        </a>
    </span>
    <b>KU-0062</b>
</span>

5
  • В дубликате есть желаемая реализация
    – user262779
    3 фев 2019 в 14:17
  • Делаю так .speedbar :first-child a:before {display: none; } Почему-то и второй before скрывается?
    – steep
    3 фев 2019 в 14:24
  • А текст KU-0062, так задуман в общем <span> висеть? <b></b> - это жирный текст насколько я помню
    – user262779
    3 фев 2019 в 14:31
  • Да, его никуда не денешь
    – steep
    3 фев 2019 в 14:32
  • Изначально там просто текст был, я обернул его в b чтобы стили прописать
    – steep
    3 фев 2019 в 14:36

1 ответ 1

0

Желаемый результат?

.speedbar {
    margin: 0 10px 10px 8px;
    text-transform: uppercase;
    text-align: left;
}
.speedbar a, .speedbar b {
    background: #ef5350;
    border-radius: 2px 0 0 2px;
    margin: 4px 0px 0 4px;
    padding: 8px 17px 8px 30px;
    position: relative;
    text-align: center;
    color: #fff;
    line-height: 1.5;
    box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),0 1px 5px 0 rgba(0,0,0,0.12),0 3px 1px -2px rgba(0,0,0,0.2);
}
.speedbar a::after, .speedbar b::after {
    border-bottom: 17px solid transparent;
    border-left: 17px solid #ef5350;
    border-top: 17px solid transparent;
    content: "";
    position: absolute;
    right: -17px;
    top: 0;
    z-index: 1;
}
.speedbar a::before, .speedbar b::before {
    border-bottom: 17px solid transparent;
    border-left: 17px solid #eee;
    border-top: 17px solid transparent;
    content: "";
    left: 0;
    position: absolute;
    top: 0;
}

.speedbar b {
    font-weight: 400;
}
.speedbar b span {
    font-size: 12px;
    position: relative;
    top: -1px;
    margin-right: 10px;
    background: #eee;
    padding: 5px 8px;
    border-radius: 2px;
    color: #555;
}
.speedbar span:first-child a::before {
  border: 0;
}
<span class="speedbar" id="dle-speedbar">
    <span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
        <a href="/" itemprop="url">
            <span itemprop="title">Мебель</span>
</a>
</span>
<span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
        <a href="/lastnews/" itemprop="url">
            <span itemprop="title">Работы</span>
</a>
</span>
<span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
        <a href="/kuhni/" itemprop="url">
            <span itemprop="title">Кухни</span>
</a>
</span>
<b>KU-0062</b>
</span>

1
  • Будет ещё один вариант треугольников ))), в любом случае дубликат
    – user262779
    3 фев 2019 в 14:50

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.