Reputation: 580
Here is what I need the output to be.
HTML Markup is:
<h3 class="TRM_Propane_sfty_ttl">Placement of Your Grill & Propane Cylinders</h3>
<h3 class="TRM_Propane_sfty_ttl">Use of Your Grill</h3>
<h3 class="TRM_Propane_sfty_ttl">Other Propane Cylinder Safety Tips</h3>
What is the CSS I should apply to the h3 tag, so that the text "Use of Your Grill" will be vertically aligned at middle? I should n't use specific line height for the second h3 tag.
I tried display: table, table-cell, table-head. Nothing worked :(
Upvotes: 3
Views: 11863
Reputation: 183
Why don't you just use font-style on a span:
<span style="font-size:large;bold,etc.">
Make the span look like an h3, etc. It might not look 100% unless you have made modifications to the h3 already (thus changing the standard h3 css configuration)
Upvotes: 0
Reputation: 6712
One way to do it is to wrap everything in a new tag and apply display:table
to it. The h3 elements should then be set to display:table-cell
Like this:
Having said that, I do agree that three h3 tags in a row is unusual so you should consider re-structuring your markup
Upvotes: -1
Reputation: 9322
h3
is block level (that is the next element will go to the next line) so one way is to make that inline
(like span element).
.TRM_Propane_sfty_ttl
{display:inline;}
in your CSS.
Check my demo with table
also by the way is used.
And without using h3
element you could also make your font look bigger like this one
and your code a little tidier ;-)
Upvotes: 2