Kiểu chữ nét trong CSS
- Sử dụng thuộc tính webkit-text-stroke không chuẩn.Thuộc tính webkit -text-stroke là một thuộc tính CSS không chuẩn được sử dụng để áp dụng chiều rộng và màu của nét hoặc đường viền cho các ký tự văn bản. Đây là thuộc tính viết tắt cho các thuộc tính viết tắt -webkit-text-stroke-width và -webkit-text-stroke-color.
Được làm bằng:
HTML / CSS
Về mã:
Đây là một hiệu ứng văn bản động tuyệt đẹp được tạo bằng CSS.
Trình duyệt tương thích: Chrome, Edge, Firefox, Opera, Safari.
Preview
Cách thực hiện:
Thêm css
.text-fill { background: linear-gradient(blue 0 0) 0/ 100% repeat-y text; color: #0000; animation: text-fill 8s cubic-bezier(.35, 0, .35, 1) infinite alternate } h1 { place-self: center; -webkit-text-stroke: 2px #386641; color: #0000; font-size: 70px; font-weight:900; font-family:"Open Sans",Helvetica,Arial,sans-serif; text-transform: capitalize; }
<h1 class='text-fill'>thủ thuật blogspot</h1>
Tùy thuộc vào phần thiết kế css của từng template nhưng cơ bản là sửa toàn bộ "header title" hoặc "blog title" của template dưới là một ví dụ.
Sửa css
#header h1 , #header h2, #header h1 a, #header h2 a, #header h1 a:hover,#header h2 a:hover { place-self: center; color:#0000; font-size: 70px; font-weight:900; font-family:"Open Sans",Helvetica,Arial,sans-serif; text-transform: capitalize; }
.text-fill { background: linear-gradient(blue 0 0) 0/ 100% repeat-y text; color: #0000; -webkit-text-stroke: 2px #386641; animation: text-fill 8s cubic-bezier(.35, 0, .35, 1) infinite alternate } @keyframes text-fill { 0% { background-size: 0 } }Sửa HTML
Tìm:
<!--No header image --> <div id='header-inner'> <div class='titlewrapper'> <b:include name='title'/> </div>Hoặc class='blog-title' ... vvv
Thay thành:
<!--No header image --> <div id='header-inner'> <div class='titlewrapper text-fill'> <b:include name='title'/> </div>Hoặc class='blog-title text-fill' ...vvv
DEMO