I've been trying to figure out how to achieve the following for a while now. I know I can solve this issue by using different h1 tags and positioning them separately, but I'm curious to find out if there's a way to do it without dividing these two elements into separate h1s.
Let's dive in:
HTML:
<h1 id = "introText1">Hi, my name is Liam Shalon.</h1>
CSS:
#introText1 {
font-family: 'Source Sans Pro', sans-serif;
font-weight: 300;
left: 0;
line-height: 200px;
margin: auto;
margin-top: -110px;
position: absolute;
top: 50%;
width: 100%;
z-index: 1;
}
I want:
- "Hi, my name is" to have a font weight of 300
- "Liam Shalon" to have a font weight of 400
Is there a way to achieve this without needing to split it up into two h1 tags?
Thank you, Liam