Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2006
    Posts
    2,114
    Tokens
    0

    Latest Awards:

    Default Cross-browser coding I beleve

    Ok, well i don't code in DIV's very often, but when i do always get a problem with one of the browsers.

    Well my Problem is..



    Thats FireFox but in IE its fine



    My CSS file is:

    PHP Code:
    #top {
        
    positionabsolute;
        
    backgroundurl(images/top.jpgno-repeat #A9212F;
        
    width100%;
        
    height29px;
        
    z-index2;
        
    left0px;
        
    top0px;
    }
    #banner {
        
    position:absolute;
        
    width100%;
        
    height200px;
        
    z-index:2;
        
    top29px;
        
    backgroundurl(images/banner.jpgno-repeat #92C9FF;
        
    left0px;
    }
    #search {
        
    position:absolute;
        
    width:256px;
        
    height:65px;
        
    z-index:1;
        
    left700px;
        
    background-imageurl(images/search.jpg);
        
    top: -1px;
    }
    #contenttop {
        
    position:absolute;
        
    width100%;
        
    height:46px;
        
    z-index:2;
        
    top229px;
        
    background-imageurl(images/content_top.jpg);
        
    left0px;
    }
    #homelink {
        
    position:absolute;
        
    width:67px;
        
    height:26px;
        
    z-index:4;
        
    left662px;
        
    top216px;
        
    background-imageurl(images/home.jpg);
    }
    #loginlink {
        
    position:absolute;
        
    width:54px;
        
    height:26px;
        
    z-index:5;
        
    left728px;
        
    top216px;
        
    background-imageurl(images/login.jpg);
    }
    #registerlink {
        
    position:absolute;
        
    width:73px;
        
    height:26px;
        
    z-index:6;
        
    left781px;
        
    top216px;
        
    background-imageurl(images/register.jpg);
    }
    #bg {
        
    position:absolute;
        
    width100%;
        
    height100%;
        
    z-index:7;
        
    top275px;
        
    left0px;
        
    right0px;
        
    bottom0px;
        
    padding-left80px;
        
    padding-top20px;
        
    background#c92536 url(images/bg.jpg) repeat-x;
    }
    #content1 {
        
    width:912px;
        
    height:40px;
        
    z-index:8;
        
    padding-bottom0px;
        
    background-color#FFFFFF;
    }
    #content2 {
        
    width:912px;
        
    heightauto;
        
    z-index:2;
        
    padding-bottom0px;
        
    background-color#FFFFFF;
    }
    #content3 {
        
    width:914px;
        
    height:82px;
        
    z-index:21;
        
    padding-bottom0px;
        
    background-imageurl(images/contentbottom.jpg);
    }

    body {
        
    background-color#FFFFFF;
        

    Thanks for any help..
    Looking for a good desiner to design a social networking template.

    PM me.

  2. #2
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    That looks buggered in both browser's...

    Code:
    <script>
    
    //Browser redirect Script- © Dynamic Drive (www.dynamicdrive.com)
    //For full source code, 100's more DHTML scripts, and Terms Of Use, 
    //visit dynamicdrive.com
    
    var browser_type=navigator.appName
    var browser_version=parseInt(navigator.appVersion)
    
    //if NS 6
    if (browser_type=="Netscape"&&browser_version>=5)
    window.location.replace("http://mozilla.org")
    //if IE 4+
    else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4)
    window.location.replace("http://microsoft.com")
    //if NS4+
    else if (browser_type=="Netscape"&&browser_version>=4)
    window.location.replace("http://www.netscape.com")
    //Default goto page (NOT NS 4+ and NOT IE 4+)
    else
    window.location="http://www.dynamicdrive.com"
    </script>
    Information:

    This blank page will act as the browser redirector. Change the destinations inside the script from Netscape.com, Microsoft.com, and Geocities.com to others, depending on whether the user is using NS 4, NS 6+, IE 4, or none of the above, respectively.

    Then..
    Create a blank page, and add the following code to the <head> section of it:#

  3. #3
    Join Date
    Mar 2008
    Posts
    779
    Tokens
    0

    Default

    Okay you're wasting a lot of time making a redirect. You've basically go margin problems. Replace the #content1, #content2 and #content3 with this;

    Code:
    #content1 {
        width:912px;
        height:40px;
        z-index:8;
        padding-bottom: 0px;
        background-color: #FFFFFF;
        overflow: hidden;
    }
    
    #content2 {
        width:912px;
        height: auto;
        z-index:2;
        padding-bottom: 0px;
        background-color: #FFFFFF;
        overflow: hidden;
    }
    
    #content3 {
        width:914px;
        height:82px;
        z-index:21;
        padding-bottom: 0px;
        background-image: url(images/contentbottom.jpg);
        overflow: hidden;
    }
    Last edited by Klydo; 24-03-2008 at 01:15 PM.

  4. #4
    Join Date
    Jul 2005
    Location
    Belgium
    Posts
    2,492
    Tokens
    147

    Latest Awards:

    Default

    That and people need to learn how to code with css using the position: relative;
    instead of the position: absolute;

    Relative is much more reliable then absolute when it comes to positioning and cross-browser compatibility

  5. #5
    Join Date
    Sep 2006
    Posts
    2,114
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Xedon View Post
    That looks buggered in both browser's...

    Code:
    <script>
    
    //Browser redirect Script- © Dynamic Drive (www.dynamicdrive.com)
    //For full source code, 100's more DHTML scripts, and Terms Of Use, 
    //visit dynamicdrive.com
    
    var browser_type=navigator.appName
    var browser_version=parseInt(navigator.appVersion)
    
    //if NS 6
    if (browser_type=="Netscape"&&browser_version>=5)
    window.location.replace("http://mozilla.org")
    //if IE 4+
    else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4)
    window.location.replace("http://microsoft.com")
    //if NS4+
    else if (browser_type=="Netscape"&&browser_version>=4)
    window.location.replace("http://www.netscape.com")
    //Default goto page (NOT NS 4+ and NOT IE 4+)
    else
    window.location="http://www.dynamicdrive.com"
    </script>
    Information:

    This blank page will act as the browser redirector. Change the destinations inside the script from Netscape.com, Microsoft.com, and Geocities.com to others, depending on whether the user is using NS 4, NS 6+, IE 4, or none of the above, respectively.

    Then..
    Create a blank page, and add the following code to the <head> section of it:#
    What you mean buggered in both browsers?

    It is fine in IE, i removed abit of the top of it as it's not to be released yet.

    Why do it need all that redirect crap, i want it to work in both browsers not make them have to download a diffrent one to use the site..

    Quote Originally Posted by Klydo View Post
    Okay you're wasting a lot of time making a redirect. You've basically go margin problems. Replace the #content1, #content2 and #content3 with this;

    Code:
    #content1 {
        width:912px;
        height:40px;
        z-index:8;
        padding-bottom: 0px;
        background-color: #FFFFFF;
        overflow: hidden;
    }
    
    #content2 {
        width:912px;
        height: auto;
        z-index:2;
        padding-bottom: 0px;
        background-color: #FFFFFF;
        overflow: hidden;
    }
    
    #content3 {
        width:914px;
        height:82px;
        z-index:21;
        padding-bottom: 0px;
        background-image: url(images/contentbottom.jpg);
        overflow: hidden;
    }
    Thanks I didnt do that redirect crap, but it didnt change when i put the overflow in?

    Any other help?

    Thanks
    Looking for a good desiner to design a social networking template.

    PM me.

  6. #6
    Join Date
    Mar 2008
    Posts
    779
    Tokens
    0

    Default

    I can't help, as I can't see your HTML. Give me a direct link to the layout, so I can edit in Firebug.

  7. #7
    Join Date
    Sep 2006
    Posts
    2,114
    Tokens
    0

    Latest Awards:

    Default

    NeverMind, Fixed

    Thread Closed.
    Looking for a good desiner to design a social networking template.

    PM me.

Posting Permissions

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