Development Simple question (I hope)

Discussion in 'Software' started by Ubermich, 19 Jan 2003.

  1. Ubermich

    Ubermich He did it!

    Joined:
    21 Jun 2002
    Posts:
    4,389
    Likes Received:
    1
    What's the easiest way to go about setting everything over, say, 140 pixels?
     
  2. moose

    moose What's a Dremel?

    Joined:
    12 Mar 2001
    Posts:
    789
    Likes Received:
    1
    In any particular context?
     
  3. linear

    linear Minimodder

    Joined:
    5 Oct 2001
    Posts:
    4,393
    Likes Received:
    1
    140 pixels is a little under two inches--I'd just pick up your monitor and move it to one side.
     
  4. Ubermich

    Ubermich He did it!

    Joined:
    21 Jun 2002
    Posts:
    4,389
    Likes Received:
    1
    lol. Or I could just set the left to be 140, I think moving the monitor of everyone who views my site may take just a little too much time... even if that would only be one monitor :p
    now, why is it that when the width is set to 85px it's about 1" in IE and 1 1/2" in opera?
     
  5. complexprocess

    complexprocess What's a Dremel?

    Joined:
    8 Jul 2002
    Posts:
    353
    Likes Received:
    0
    Don't know about the different pixels in opera/i.e.
    You might try forcing IE into strict mode to see if it starts to display like opera. Maybe your code isn't fully W3C compliant.

    As for the question of positioning, you could set everything inside a div tag that is absolutely positioned at 150px (x coordinate).
     
  6. Ubermich

    Ubermich He did it!

    Joined:
    21 Jun 2002
    Posts:
    4,389
    Likes Received:
    1
    Welp, unless I can figure out how to get the width the same in IE and opera, I guess it's finished for now... Before anyone says anything about the coding, I know it's not pretty :p
    http://webpages.charter.net/lrrouth
     
  7. Hargle

    Hargle What's a Dremel?

    Joined:
    13 Oct 2001
    Posts:
    404
    Likes Received:
    1
    Red... :worried:
     
  8. 19nine78

    19nine78 What's a Dremel?

    Joined:
    11 Dec 2002
    Posts:
    18
    Likes Received:
    0
    Yeah but if you'd done tidy coding you wouldn't be in this mess now (sort of).

    It sounds like an IE boxmodel problem, basically IE takes the width you set the div, then subtracts the margin, border and padding from the leaving you with the width of your content (at this point usually smaller than you imagined)

    Opers is setting your content to the width you specified than adding on any padding, borders and margins.

    How to fix:

    Google on 'IE box model hack' its well documented and it'll let you 'fix; it on IE5

    OR

    Add a full doctype to your page, but if your using xHTML, leave out the xml declaration at the top, this'll put IE6 into strict mode and it'll do its sums the w3c way. Only works on IE6 IIRC.

    cheers

    alastair
     
  9. webchimp

    webchimp What's a Dremel?

    Joined:
    9 Oct 2002
    Posts:
    504
    Likes Received:
    1
    It gets worse....

    Because I have script debugger installed, I can't use the links because I get a runtime error message:

    Error, Line 60: Object Expected

    <DIV id="navBar" align="left" onMouseover="SetOpacity(this, 100);" onMouseout="SetOpacity(this, 65);">

    Regarding spacing, why don't you use tables for layout and have done with. :D
     
  10. Ubermich

    Ubermich He did it!

    Joined:
    21 Jun 2002
    Posts:
    4,389
    Likes Received:
    1
    the site used to be in tables, it was horrid then.

    Pardon, but I don't understand the error, what, exactly, is it expecting?

    The coding isn't horrible (I don't think :worried: ), but it wouldn't help me pass a final exam either...

    What's wrong with red?? It'll be blue someday...
     
  11. Hargle

    Hargle What's a Dremel?

    Joined:
    13 Oct 2001
    Posts:
    404
    Likes Received:
    1
    Good question, what is wrong with red?

    Nothing is wrong with red, which is a good thing for you I guess :p

    Who said anything was wrong with red? :worried:

    :D

    It's green in places too, reminds me of my flatmates cups and plates...

    There is no spacing between the navbar and the main text area viewing the page in Mozilla. In IE I get the same error as webchimp every time I move the mouse over the navbar. It seems to be "SetOpacity(this, 100);" that's causing the problem. The page does look far better in IE though. Turn on script debugging if you havn't already got it on Ubermich, probably help you sort that error out.
     
  12. Ubermich

    Ubermich He did it!

    Joined:
    21 Jun 2002
    Posts:
    4,389
    Likes Received:
    1
    the one page is green for its own reason. Is the script debugging only in IE? I don't use IE much and haven't seen it in opera.
    I'll check it out though. I'll probably try just taking out the transparency/opacity bit...
     
  13. complexprocess

    complexprocess What's a Dremel?

    Joined:
    8 Jul 2002
    Posts:
    353
    Likes Received:
    0
    What about setting the positioning to absolute instead of relative for the "Main" ID? It looks like IE is just setting the left side to 110px, and opera/mozilla are positioning it relative to the other elements. Maybe this isn't the problem, but you ought to try and see.
     
  14. webchimp

    webchimp What's a Dremel?

    Joined:
    9 Oct 2002
    Posts:
    504
    Likes Received:
    1
    "Is the script debugging only in IE?"

    To be honest, I'm not sure, it's a while since I set everything up, but I think that Script Debugging is installed as part of IIS or PWS. I develop ASP sites so I use IIS to test locally.

    You'd be amazed at how many sites out there throw up script errors and JavaScript alerts. :eeek:

    If I look at the page in Netscape 4.08, I don't get the Error alert, so I guess that it does integrate with IE. However, the 3D screenies page did throw up an application error and crashed the Netscape Browser completely when I resized the browser window- oops! I've come accross this before when trying to calculate screen positions and using onLoad and onResize in Netscape. In the end I gave up, put in some browser detection and redirect code and made 2 versions of the site, 1 for IE 5.0 and above and a simpler site for everything else.

    IE 5.0 and up is very forgiving of sloppy code, so I use Netscape 4.08 to test my sites, this was a really lousy web browser, but Netscape innadvertantly created an excellent site testing tool. :D

    Every web browser you ever wanted: evolt.org
     
    Last edited: 21 Jan 2003
  15. webchimp

    webchimp What's a Dremel?

    Joined:
    9 Oct 2002
    Posts:
    504
    Likes Received:
    1
    Just downloaded and installed Opera 7 - can't say I'm impressed, had it for 10 minutes and it's allready crashed twice. It also makes a mess of a couple of my sites that work fine in crummy old Netscape 4.08.

    Dammit! More fiddling about for 5% of visitors. :grr:
     
  16. complexprocess

    complexprocess What's a Dremel?

    Joined:
    8 Jul 2002
    Posts:
    353
    Likes Received:
    0

    5%? Most of the sites I've looked at stats for report about 5% for all non-IE browsers combined. It's usually sites for metal bands. Maybe metal fans just prefer IE.:D

    Edit>
    I'm guessing for a tech-heavy site might be heavier in opera use, but that's just speculation.
     
  17. Ubermich

    Ubermich He did it!

    Joined:
    21 Jun 2002
    Posts:
    4,389
    Likes Received:
    1
    If I set it to absolute, I have to give a new ID to each section, I think, as it sets all the sections on top of each other if I do that.

    Did the my comp page do that? When I load a couple of the pages it takes it a minute to set the 'main' sections off to the right...
     
  18. webchimp

    webchimp What's a Dremel?

    Joined:
    9 Oct 2002
    Posts:
    504
    Likes Received:
    1
    "Did the my comp page do that?"

    To be honest the whole site is a bit iffy in NS 4.08. However, in fairnesss, not many people will be using that browser. It really was bad, that's why I have a copy installed, just to see if my own pages can pass the NS 4.08 test.

    Anyway:
    index.html - OK
    3ds.html - Only the Page introduction appears, no pictures or navigation section - if the browser window is resized it crashes.
    case.html - OK
    songs.html - OK
    HKiller.html - same as 3ds.html

    My own sites browser stats for December:

    Most browsers by brand preference:
    MSIE with 2103 sessions (63.10% of all sessions)
    Other with 811 sessions (24.33% of all sessions)
    AOL with 200 sessions (6.00% of all sessions)
    Netscape with 186 sessions (5.58% of all sessions)
    Opera with 32 sessions (0.96% of all sessions)
    MSProxy with 1 sessions (0.03% of all sessions)

    So, there's still plenty of non-IE users out there, I'd really like to know what the hell all those 'Others' are.

    Off topic a bit, but having tried Opera - I have installed version 7 which is a beta, so maybe the full release will be better. As it is, it's definately buggy and crashes frequently. It also seems to be a lot slower to load pages than IE, despite having a 512k broadband connection. I also think the top toolbar takes up way too much room, about twice as wide from top to bottom as the IE toolbar, this must hurt people with low screen resolutions. The one feature I like is the Zoom function, this will be handy for a close up of annoying alignment problems when developing pages.

    In any case, I still think the only reliable way of making pages safe with a broad range of browsers is to keep it simple and use tables for layout. If you want to show off an produce a bleeding edge 'bells and whistles' site, you need to create a dumbed down version for older browsers.
     

Share This Page