Страницы

Поиск по вопросам

воскресенье, 22 декабря 2019 г.

Каким образом делать такое подчеркивание?

#html #css #svg




Как делать подчеркивание такого рода? Есть две идеи, это SVG и просто PNG картинка
с абсолютным позиционированием относительно блока с заголовком. Может есть способы
с помощью чистого CSS?
    


Ответы

Ответ 1



Самое простое решение - это svg svg { width:347; height:188; background:#3D4248; } #txt { font-size:70px; font-family:sans-serif; fill:white; } svg path { fill:none; stroke:white; stroke-width:2; } Expire

Ответ 2



Решение на CSS: * { margin: 0; padding: 0; } .wrapper { position: relative; display: flex; justify-content: center; align-items: center; background-color: #3D4248; margin: 1rem; width: 250px; height: 200px; font-size: 4em; font-family: sans-serif; color: #fff; } .wrapper .line { position: absolute; bottom: 50px; right: 34px; width: 98px; height: 5px; background-color: #3D4248; z-index: 2; } .wrapper .line::before { content: ""; display: block; position: absolute; bottom: -0.7px; left: -1.8px; width: 10px; height: 1px; background-color: #fff; transform: rotate(45deg); } .wrapper span { position: relative; } .wrapper span::before { content: ""; display: block; position: absolute; bottom: -10px; width: 180px; height: 1px; border-bottom: 1px solid #fff; } .wrapper span::after { content: ""; display: block; position: absolute; bottom: -17px; right: 1px; width: 91px; height: 1px; border-bottom: 1px solid #fff; }
Expire


Комментариев нет:

Отправить комментарий