New to css and have a question before I start looking to solve something that might not be possible. I am looking to write h2 qualities into a paragraph without changing the entire paragraph to an h2 class and without breaking the flow of the structure of the paragraph or its appearance. For instance:
"India's first locally designed <h2>civilian aircraft</h2>, a 14-seater with Canadian-made engines that will also be used by the military and coast guard, successfully took its first flight Friday, officials said."
Is such a thing possible with css and, if so, what would be the basic coding for such a thing. My attempts to this point have either thrown the entire paragraph into the heading class or the paragraph separates into the following:
"India's first locally designed
<h2>civilian aircraft</h2>
, a 14-seater with Canadian-made engines that will also be used by the military and coast guard, successfully took its first flight Friday, officials said."
The goal is to simply make, in this case, "civilian aircraft" an h2 within the flow of the paragraph without changing its appearance.
I appreciate your input.
MavThat is symantically ridiculous, Mav. <h2> is a second level header; it's not meant to be part of a paragraph. I think all you really want to do is to apply a particular style to a <strong> element.
strong { font-size: 1.2em; font-weight: bold; }
<p>India's first locally designed <strong>civilian aircraft</stong>, a 14-seater with Canadian-made engines that will also be used by the military and coast guard, successfully took its first flight Friday, officials said.</p>
Another, less desirable, means would be to define the style in a class then apply that class to a <span>.
.stress { font-size: 1.2em; font-weight: bold; }
<p>India's first locally designed <span class="stress">civilian aircraft</span>, a 14-seater with Canadian-made engines that will also be used by the military and coast guard, successfully took its first flight Friday, officials said.</p>Just as I thought, but I had to ask. Thanks Ray.
MavMaverick, it's not impossible, just, as Ray said, ridiculous. If you really wanted to do it you could use display: inline; and font-size: 1em; to get it to fit in with the surrounding text. But Ray's method is far superior... as well as being the 'correct' way to do it. Screen readers would have a fit coming across a h2 in mid paragraph!Mav, what you want to do is introduce a new topic, correct? Well, couldn't you just use:
"<h2>Civilian Aircraft</h2> <p>India's first locally designed civilian aircraft, a 14-seater with Canadian-made engines that will also be used by the military and coast guard, successfully took its first flight Friday, officials said...</p>"
It'd be sloppy writing to do otherwise.
"India's first locally designed <h2>civilian aircraft</h2>, a 14-seater with Canadian-made engines that will also be used by the military and coast guard, successfully took its first flight Friday, officials said."
Is such a thing possible with css and, if so, what would be the basic coding for such a thing. My attempts to this point have either thrown the entire paragraph into the heading class or the paragraph separates into the following:
"India's first locally designed
<h2>civilian aircraft</h2>
, a 14-seater with Canadian-made engines that will also be used by the military and coast guard, successfully took its first flight Friday, officials said."
The goal is to simply make, in this case, "civilian aircraft" an h2 within the flow of the paragraph without changing its appearance.
I appreciate your input.
MavThat is symantically ridiculous, Mav. <h2> is a second level header; it's not meant to be part of a paragraph. I think all you really want to do is to apply a particular style to a <strong> element.
strong { font-size: 1.2em; font-weight: bold; }
<p>India's first locally designed <strong>civilian aircraft</stong>, a 14-seater with Canadian-made engines that will also be used by the military and coast guard, successfully took its first flight Friday, officials said.</p>
Another, less desirable, means would be to define the style in a class then apply that class to a <span>.
.stress { font-size: 1.2em; font-weight: bold; }
<p>India's first locally designed <span class="stress">civilian aircraft</span>, a 14-seater with Canadian-made engines that will also be used by the military and coast guard, successfully took its first flight Friday, officials said.</p>Just as I thought, but I had to ask. Thanks Ray.
MavMaverick, it's not impossible, just, as Ray said, ridiculous. If you really wanted to do it you could use display: inline; and font-size: 1em; to get it to fit in with the surrounding text. But Ray's method is far superior... as well as being the 'correct' way to do it. Screen readers would have a fit coming across a h2 in mid paragraph!Mav, what you want to do is introduce a new topic, correct? Well, couldn't you just use:
"<h2>Civilian Aircraft</h2> <p>India's first locally designed civilian aircraft, a 14-seater with Canadian-made engines that will also be used by the military and coast guard, successfully took its first flight Friday, officials said...</p>"
It'd be sloppy writing to do otherwise.