Olá Tim,
As floating elements only let following elements to flow around them,
you'll have to alter the order of the contents:
<h1><span class="right">£ price</span>Description</h1>
Alternatively, you can float the description to the left and give the
heading a text-align: right;
Consider also to use a table. This kind of contents (items and their
prices) is considered, imho, tabular, so... that's what tables are there
for.
Roberto
----------------
Tim Felmingham wrote:
> I want to be able to align the last part of a heading tag to the right,
> whilst the rest of it stays aligned to the left.
>
> For example:
>
> -----------------------------------------------------
> Description £ price
> -----------------------------------------------------
>
> In theory, I think you should be able to do that with a <span> within the
> <h1> tag that floats the last part of the heading to the right, i.e:
>
> <h1>Description <span class="right">£ price</span></h1>
>
> .right {float: right;}
>
> However, this doesn't work as is and adding other refinements such as the
> width parameter and so on still doesn't work across all browsers. Nor does
> creating a separate .left class for the first part of the heading.
>
> The <h1> tag has a background colour assigned to it and the <span> tags seem
> to put a white background over the heading which ruins the effect, even if
> they do position the text in the right place.
>
> What is the correct way to do this?
>
>
>
>
>
--
-------------------- Roberto Gorjão
freelance designer and web designer
personal site: www.castelosnoar.com
PORTUGAL / BRAGA / PÓVOA DE LANHOSO
______________________________________________________________________
css-discuss [css-d-FPEHb7Xf0XVf4fvhJAioeSCwEArCW2h5@xxxxxxxxxxxxxxxx]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
|