Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3

Thread: DIV problems

  1. #1
    Senior Member james's Avatar
    Join Date
    May 2003
    Location
    Melbourne, AUSTRALIA
    Posts
    364
    Member #
    1352
    I'm converting my tetris game to div's, and it works fine on IE, but not Moz1.3 or Opera. Can you help?
    Code:
    <div style="display:inline; position:relative; width:200px; height:400px;">
    <div class="square" id="0_0"
      style="display:inline; position:absolute; top:0px; left=0px; height=20px; width=20px;">
    </div>
    <div class="square" id="0_1"
      style="display:inline; position:absolute; top:0px; left=21px; height=20px; width=20px;">
    </div>
    <!--lots more squares -->
    </div>
    The containing div is position relative, so it just sits where it's put. The little squares are position absolute, which I understand is absolute coordinates inside its containing block, in this case the outer div. Why isn't it working?:Ogre:
    James H
    Home Page · Mars Page · www.fihsf1.net (formerly www·fihs·net)

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Try making everything with absolute positioning. the whole relative/absolute thing has big issues... especially pertaining to this level of graphic manipulation. I kept my clock on absolute positioning when I made it.

  4. #3
    Senior Member james's Avatar
    Join Date
    May 2003
    Location
    Melbourne, AUSTRALIA
    Posts
    364
    Member #
    1352
    Yeah, that works, along with changing a lot of "left=0px" to "left:0px", and adding left and right to the first div. New code:
    Code:
    <div style="display:inline; position:absolute; top:5px; left:5px; width:200px; height:400px;">
    <div class="square" id="0_0"
      style="display:inline; position:absolute; top:0px; left:0px; height:20px; width:20px;">
    </div>
    <div class="square" id="0_1"
      style="display:inline; position:absolute; top:0px; left:21px; height:20px; width:20px;">
    </div>
    <!--lots more squares -->
    </div>
    James H
    Home Page · Mars Page · www.fihsf1.net (formerly www·fihs·net)


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 01:24 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com