DU wrote:
[color=blue]
> DM wrote:
>[color=green]
>> I'm trying to use a relatively positioned <div> to create a
>> positioning context for a <p> such that the <p> will render within the
>> <div> near the right edge.
>>
>> I'm using XHTML 1.0 strict. My page validates in the W3C validator
>> properly. However, I'm not getting the correct results in IE or
>> Mozilla for the PC.
>>
>> I put screenshots here:
>>
>>
http://www.somerandomcrap.com/temp/cssscreenshots.htm
>>
>> The word "Home" is the thing I'm trying to position. It's supposed to
>> be inside the horizontal blue bar, near the right edge. The blue bar
>> is the <div>.
>>
>> (I realize "Home" is also blue. I intend to correct that after I solve
>> this problem.)
>>
>> Here's an excerpt from the code:
>>
>> [...]
>>
>> <body>
>> <div id="all">
>> <div style="position: relative;
>> background-color:#003399;
>> padding:3px;
>> margin: 12px 0 0 0;">
>> <h1 style="margin: 0;
>> padding: 0;
>> color:#ffffff;
>> font:Arial, Helvetica, sans-serif;
>> font-size: 12px;">
>> ASA Notes
>> </h1>
>> <p style="color:#ffffff;
>> font:Arial, Helvetica, sans-serif;
>> font-size: 12px;
>> position:absolute;
>> right:4px;">
>> <a href="/~ethan/meetingnotes/index.htm">Home</a>
>>
>> </p>[/color]
>
>
> That Home <p> must either be within the ASA notes block which would have
> to be abs. or rel. positioned or you could just make that <a
> href="/~ethan/meetingnotes/index.htm">Home</a>
> link styled (without a wrapping <p>)like this:
>[/color]
But it IS within the "ASA notes block" (you mean the <div>, right?). You trimmed
off the closing tag in my code, but the <p> is definitely INSIDE the <div>. Yet
in the browser it renders OUTSIDE the <div>. I can't figure out why.
[color=blue]
> <a href="/~ethan/meetingnotes/index.htm" style="float: right;
> padding-right: 4px;">Home</a>
>
> Not tested.[/color]
I tried it. Like this:
<div style="position: relative;
background-color:#003399;
padding:3px;
margin: 12px 0 0 0;">
<h1 style="margin: 0;
padding: 0;
color:#ffffff;
font:Arial, Helvetica, sans-serif;
font-size: 12px;">
ASA Notes
</h1>
<a href="/~ethan/meetingnotes/index.htm" style="margin: 0; padding:0;font-size:
12px; font-family:Arial, Helvetica, sans-serif;
float:right; padding-right: 4px;">Home</a>
</div>
The "Home" type still winds up outside the blue bar (the <div>), below it to the
right.
Is there a way to achieve this fairly simple result without resorting to a table?
By the way, in case I didn't mention it before, I'm trying to get the title "ASA
Notes" and the word "Home" to line up horizontally, not have one above the
other. That why I'm not just using "text-align: right".