The ::first-letter selector is used to add a style to the first letter of the specified selector.
Without using a <span> tag around that first letter in your HTML.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.cls::first-letter {
color: green;
font-weight: bold;
}
</style>
</head>
<body>
<div class="cls">
Genius Student
</div>
</body>
</html>
Without using a <span> tag around that first letter in your HTML.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.cls::first-letter {
color: green;
font-weight: bold;
}
</style>
</head>
<body>
<div class="cls">
Genius Student
</div>
</body>
</html>
Css :- The letter selector
Reviewed by Network security
on
May 23, 2019
Rating:
No comments: