View Full Version : Changing font on same line

11-08-2009, 01:22 AM
I have a line of type where I need the first half of the line of type to be HEADING 1, and the second half to be 12 point paragraph type. When I change the latter, the whole line reverts to 12 point type.

I want to go into Code View and make this setting. Can someone tell me how I can do this?


11-08-2009, 03:13 AM
The heading (h1-h6) and paragraph (p) tags define paragraph level html objects which means you can only apply them to whole paragraphs, What you need to do is use a <span> tag to define part of your heading and then create and apply a CSS style for the span with the font-size property set as you want.

But really it sounds like you need to understand CSS styles a bit first.

d a v e
11-08-2009, 05:29 AM
or of course you can do it like this

with this css in your style sheet
h1 {
display: inline;
h1 + p {
display: inline;
and add the font sizing to each as you require...

don't forget though that for screen use you shouldn't use points, but either percentages or ems ;).

the drawback with doing it the way DWcourse suggested is that your h1 will no longer be a real heading (if i understood DWc's way correctly...)

11-08-2009, 01:58 PM
Yeah, what I meant was <h1>some text<span>some more</span></h1>

I always forget about the + selector.

But I think the real issue might be paultx trying to design based upon the browser default sizes for headings and paragraphs rather than controlling them.

d a v e
11-08-2009, 02:07 PM
maybe these could be useful then