On 10/05/11 17:29, Chris G wrote:
I want to have a heading (H1 or H2) followed by some small and different coloured text on the same line. I can't do much manipulation of the headings because they are generated by a Wiki, but I can apply CSS to them as well if necessary.
So, I have got as far as something like:-
<html><div class="textright">  Text on right</div></html> <html><h1>Heading 1</h1><html>
with CSS:-
.textright { margin-top: 1em; margin-bottom: 0px; padding-bottom: 0px; float: right; }
This works to an extent, the 'Text on right' does appear on the same line as the H1 heading as I want. However it's right across on the RHS and I really want it nestled up against the H1 text.
You might be looking for something along the lines for
display: inline;
applied to the H1/H2. This makes the client treat what would otherwise be a block-level object as if it were just running text, more-or-less, so anything else would nestle up against it normally. You'd probably then need to ensure that your next style (for following paragraphs, etc) had a clear:left in it or you forced a <br /> after your "small" text or something (or wrapped the <h1>/small text combo in a <p></p>).
Hth,
Simon