[thelist] positioning a DIV nested within an A

Jono ox4dboy at comcast.net
Tue Sep 14 09:35:01 CDT 2004


On 9/13/04 8:58 PM, "Ben Yates" <byates at emich.edu> wrote:

> <div><div><a><div></div></a></div></div>
> 
> (Details (classes et al) omitted, obviously.)
> 
> Is it possible to position the innermost div's right edge 20 pixels from
> the outermost div's right edge?  I haven't had any luck breaking out of
> the a tag, so to speak.

I am only on page 220 of O'Reilly's CSS: The Definitive Guide, 2nd Edition,
but from what I gather you should be able to do it simply by adding
"padding-right: 20px;" or "margin-right: 20px;" depending on the padding or
margin on the containing DIVs.  If the outer most div has padding of 10px
then you would only need to add 10px of right padding to the inner most div.

Read here:
[1] http://www.w3.org/TR/REC-CSS1#box-properties
     --> Info on simple margin and padding.

[2] http://www.w3.org/TR/REC-CSS2/visuren.html#positioning-scheme
    --> Info on positioning

Also, as always if you can provide a link to the page you are working on, it
would be most helpful.



More information about the thelist mailing list