I want to increase the size of first word of the paragraph in html, which tag can be used for this.
I tried the (first letter) tag and expected a output to be a paragraph with increased size of first letter, but I didn't got any answer.
I want to increase the size of first word of the paragraph in html, which tag can be used for this.
I tried the (first letter) tag and expected a output to be a paragraph with increased size of first letter, but I didn't got any answer.
p {
font-size: 2rem;
}
.big {
font-size: 3rem;
}
<p><span class="big">Ash</span> Finally became the Pokemon champion</p>
This is the easiest and perhaps best way to approach this. Hope it helps!
This was answered here: https://stackoverflow.com/questions/55612/css-to-select-style-first-word
There is a selector for first-letter, but for the selecting the first word you'll have to stick with the class solution as suggested by Graham
You can use span tag. For example,
<!DOCTYPE html>
<html>
<head>
<title> Lecture</title>
<style>
</style>
</head>
<body>
<p><span style="font-size: larger;">Hello !</span> My name is xyz. </p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
p::first-letter {
font-size: 200%;
color: #black;
}
</style>
</head>
<body>
<p>Is this correct</p>
</body>
</html>