SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2002
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile CSS Layer from right edge?

    Hi Everyone,

    I am going to use CSS layers for my new site.

    For Example;

    <div id="Layer1" style="position: absolute; left: 4; top: 4;">
    <table width=100% cellspacing=0 cellpadding=0 bgcolor="#000000" valign=center>
    <tr bgcolor="#000000"><img src=logo.gif></td></tr>
    </table>
    </div>

    This is the top banner of my page. I defind the distance from the left edge and top edge, but is it possible to define the distance from the right edge? Something like this;

    <div id="Layer1" style="position: absolute; left: 4; top: 4; right: 4">

    But that doesnt work .

    Any ideas?

    Jonno

  2. #2
    SitePoint Zealot 19nine78's Avatar
    Join Date
    Feb 2002
    Location
    Ayr, scotland
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <div id="Layer1" style="position: absolute; left: 4; top: 4; right: 4">
    try taking 'left:4;' out.

    cheers

    alastair

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2002
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice it worked great

    When i make the window smaller, the layout goes smaller with it. Do you know how to stop this or is it just a common thing with CSS?

    Jonno

  4. #4
    SitePoint Zealot 19nine78's Avatar
    Join Date
    Feb 2002
    Location
    Ayr, scotland
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    could you post a link or some code, it'll be easier to see what you mean

    cheers

    alastair

  5. #5
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    jonno,

    Make sure that you also define some units for those measurement values. For example: 4 becomes 4px (if you want the distance to be measured in pixels, that is ).

    Also, the reason that the box is moving with the window size is because you're telling it to. You're saying that the box should remain exactly 4px from the top of the window and 4px from the right side of the window.

  6. #6
    SitePoint Enthusiast
    Join Date
    Oct 2002
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and how do i tell it not 2

    Thanx for all the help

  7. #7
    SitePoint Wizard iTec's Avatar
    Join Date
    May 2001
    Location
    Sydney, Australia
    Posts
    2,243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by jonno
    and how do i tell it not 2

    Thanx for all the help
    position it from the left and it will always stay in the same position.. the right moves the left doesnt


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •