Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Software > Adobe Software > Dreamweaver

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-06-2008, 04:12 PM
mjs
 
Posts: n/a
Positioning an AP div semi-relatively... how?

If I want an AP div (z-indexed to be above the rest of the layout) to be
positioned 10 pixels higher than the insertion point, what's the best method
to achieve this?

The layout is liquid so the distances from the viewport borders are
unpredictable. That's why I need it very specifically 10px up from the
insertion point.

Are we talking AP div within a relative div? Or is there a trick with
negative margins I don't know about?

Thanks.


Reply With Quote
  #2 (permalink)  
Old 08-06-2008, 04:32 PM
mjs
 
Posts: n/a
Re: Positioning an AP div semi-relatively... how?

"Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
news:g7cf5v$pe1$1@forums.macromedia.com...
>> If I want an AP div (z-indexed to be above the rest of the layout) to be
>> positioned 10 pixels higher than the insertion point, what's the best
>> method to achieve this?

>
> Nest it within a relatively positioned <div> at the insertion point. This
> will make the context of the AP element correspond to the insertion
> point's location.


What advantage would that method have over the one I accidentally just
stumbled upon?

#footCorners {
position:absolute;
width:538px;
height:7px;
margin:-7px 0px 0px 130px;
z-index:1;
}

Note the negative top margin.


Reply With Quote
  #3 (permalink)  
Old 08-06-2008, 07:30 PM
Gary White
 
Posts: n/a
Re: Positioning an AP div semi-relatively... how?

On Wed, 6 Aug 2008 11:52:46 -0400, "Murray *ACE*"
<forums@HAHAgreat-web-sights.com> wrote:

>The margin's reference point is calculated from the location of the nearset
>positioned ancestor. Thus, the AP element will be placed 7px higher on the
>page, and 130px to the right of the location of that nearest positioned
>ancestor. To answer your question, I'd need to know where that nearest
>positioned ancestor is in the normal flow.


When a object is positioned absolutely, margin does nothing.

Gary
Reply With Quote
  #4 (permalink)  
Old 08-06-2008, 07:37 PM
mjs
 
Posts: n/a
Re: Positioning an AP div semi-relatively... how?

"Gary White" <reply@newsgroup.please> wrote in message
news:ocrj945llfhn4mph2pb95ne72a5q7bfkf8@4ax.com...
> On Wed, 6 Aug 2008 11:52:46 -0400, "Murray *ACE*"
> <forums@HAHAgreat-web-sights.com> wrote:
>
>>The margin's reference point is calculated from the location of the
>>nearset
>>positioned ancestor. Thus, the AP element will be placed 7px higher on
>>the
>>page, and 130px to the right of the location of that nearest positioned
>>ancestor. To answer your question, I'd need to know where that nearest
>>positioned ancestor is in the normal flow.

>
> When a object is positioned absolutely, margin does nothing.


On both IE7 and FF2, a negative margin applied to an absolutely positioned
DIV will move that DIV by the length of the margin in relation to the
insertion point (and not the 0,0 point).

Works rather well, especially to add a design element to the footer of a
liquid layout when contents are top-justified.

Example :

<div>Hello</div>
<div style="position:absolute; top-margin:-20px>Hi</div>

"Hi" will be positioned 20 px above the 1st pixel under "Hello", regardless
of how far up, down, left or right "Hello" happens to be positioned on the
page, or in relation to the 0,0 mark.


Reply With Quote
  #5 (permalink)  
Old 08-06-2008, 07:50 PM
mjs
 
Posts: n/a
Re: Positioning an AP div semi-relatively... how?

"Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
news:g7crc1$9jg$1@forums.macromedia.com...
> Ack. I retract my reply to Gary. Of course we are not talking here about
> margins on an absolutely positioned thing affecting anything else on the
> page.


Not sure what any of this means, since I thought an absolutely-positioned
div, by definition, did not affect anything else on the page. All's I know
is that you can use negative margings to position an absolutely-positioned
div in a relative manner.

I just wasn't sure if it was a bug or not when I stumbled upon the behavior.
Since you didn't say "invalid code", I'm assuming it actually validates. Not
that it would stop me if it didn't.

It's a wonderfully useful tool to have in very specialized instances, and
one I wish I'd known of before.

> Anyhow, I despise negative margins, and will not use them. So, I don't
> regard this as a good method.


Egads. Did a negative margin once steal your lunch or something? :-)


Reply With Quote
  #6 (permalink)  
Old 08-06-2008, 08:14 PM
mjs
 
Posts: n/a
Re: Positioning an AP div semi-relatively... how?

"Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
news:g7csg3$aqq$1@forums.macromedia.com...
>>
>> I'm assuming it actually validates.

>
> It is valid.
>
>> It's a wonderfully useful tool to have in very specialized instances, and
>> one I wish I'd known of before.

>
> It'll bite you in the ass when you least expect it. Long after you've
> forgotten you used it....


What? Valid code that'll bite me in the ass when I least expect it?

Hmm. Why should I use valid code again? ;-)

(I'm teasing, no response required.)


Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Software > Adobe Software > Dreamweaver


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:33 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Bad Credit Mortgages | Loans | Loans | Currency Converter | Mortgages



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114