r_tist wrote Hi, I have set many different style assignments to my h2 like this. For no good reason, this one just won't apply. Any ideas? .myClass h2 { color: #233e99; font-weight: 900; } |
That says:
Apply styling to any h2 tag inside a container with the class name of myClass
You want:
.text-center h2 {
}
or if you have many different h2 styles within the text-center container then follow the other 2 replies and apply them directly to the h2 tag.
But this get a bit messy IF all the h2 styling is the same
<div class="text-center">
<h2 class="myClass">This Text in a Rich Blue</h2>
<p>Some text Some text Some text Some test</p>
<h2 class="myClass">This Text in a Rich Blue</h2>
<p>Some text Some text Some text Some test</p>
<h2 class="myClass">This Text in a Rich Blue</h2>
<p>Some text Some text Some text Some test</p>
<h2 class="myClass">This Text in a Rich Blue</h2>
<p>Some text Some text Some text Some test</p>
</div>
When it could be simplified:
<div class="text-center">
<h2>This Text in a Rich Blue</h2>
<p>Some text Some text Some text Some test</p>
<h2>This Text in a Rich Blue</h2>
<p>Some text Some text Some text Some test</p>
<h2>This Text in a Rich Blue</h2>
<p>Some text Some text Some text Some test</p>
<h2>This Text in a Rich Blue</h2>
<p>Some text Some text Some text Some test</p>
</div>
Choose which option best fits in with your own requirements.