Xüsusiyyət text-stroke
Xüsusiyyət text-stroke mətn simvollarının konturunun rəngini və qalınlığını
və ya onun konturunu təyin edir. Xüsusiyyətə dəyər olaraq
konturun qalınlığını və boşluqla ayrılmış konturun rəngini verməlisiniz.
Sintaksis
selektor {
text-stroke: konturun qalınlığı və onun rəngi;
}
Əsas nümunə
Sadə mətn konturu:
<div class="stroked-text">
Lorem ipsum dolor sit amet
</div>
.stroked-text {
font-size: 48px;
font-weight: bold;
-webkit-text-stroke: 2px red;
text-stroke: 2px red;
}
:
Yalnız kontur
İndi isə mətnin rəngini fon rəngi ilə eyni edək (bizim nümunədə ağ). Nəticədə yalnız kontur qalacaq:
<div class="stroked-text">
Lorem ipsum dolor sit amet
</div>
.stroked-text {
font-size: 48px;
font-weight: bold;
color: white;
-webkit-text-stroke: 2px black;
text-stroke: 2px black;
}
:
Qradient kontur
background-clip xüsusiyyətindən istifadə edərək
qradient kontur edək:
<div class="gradient-stroke">
Lorem ipsum dolor sit amet
</div>
.gradient-stroke {
font-size: 42px;
font-weight: bold;
background: linear-gradient(to right, #ff8a00, #e52e71);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
-webkit-text-stroke: 1px #333;
text-stroke: 1px #333;
}
:
Çoxsaylı kontur
text-shadow vasitəsilə ikiqat kontur effekti:
<div class="double-stroke">
Lorem ipsum dolor sit amet
</div>
.double-stroke {
font-size: 40px;
color: white;
-webkit-text-stroke: 3px #000;
text-stroke: 3px #000;
text-shadow:
0 0 5px #000,
0 0 10px #000;
}
:
Animasiyalı kontur
Konturun dəyişmə animasiyası əlavə edək:
<div class="animated-stroke">
Lorem ipsum dolor sit amet
</div>
.animated-stroke {
font-size: 38px;
color: white;
-webkit-text-stroke: 1px #ff0000;
text-stroke: 1px #ff0000;
animation: pulse 2s infinite;
}
@keyframes pulse {
0% { -webkit-text-stroke: 1px #ff0000; text-stroke: 1px #ff0000; }
50% { -webkit-text-stroke: 3px #ff0000; text-stroke: 3px #ff0000; }
100% { -webkit-text-stroke: 1px #ff0000; text-stroke: 1px #ff0000; }
}
:
Həmçinin bax
-
xüsusiyyət
text-fill-color,
bu xüsusiyyət mətn simvollarının doldurma rəngini təyin edir -
xüsusiyyət
text-stroke-color,
bu xüsusiyyət mətnin kontur rəngini təyin edir -
xüsusiyyət
text-stroke-width,
bu xüsusiyyət mətnin kontur qalınlığını təyin edir