Hello guys, how can I change the font size of my caption under my picture?
cleaned up your HTML for you
<body>
<div id="hong" align="center"> Hello ya'll wonderful people, thanks for visiting my first page! </div>
<div style="text-align:right" class="caption">
<img src='https://i.postimg.cc/gJ06TpB0/hong-pga.jpg' border="2.5" alt='artsy Hong' width="210" height="300" />
<p>Hong </p>
</div>
</body>
Then I added this line in the CSS to change the font-size of the p
tag
.caption p {
font-size: 100px;
}
Hey, it still doesn’t work
Look closer it works for me too. just be careful to write the selector including the p tag not just selecting class .caption but the complete code:
.caption p{
font-size: 100px;
}
<p style="font-size: 40px"></p>
it was only able to work when I did it riverroad’s way. I did include the p and everything on css btw but still not working. maybe a copen glitch?
When you use inline style, it overwrites CSS declaration, if you want to fix it you either have to remove font-size
from p
tag or use !important
in CSS, like so:
.caption p {
font-size: .6em!important;
}