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 9 of 9

Thread: CSS Help.

  1. #1
    Join Date
    Jun 2005
    Location
    USA
    Posts
    2,047
    Tokens
    0

    Latest Awards:

    Default CSS Help.

    I had my layout coded by RichardKnow but as he could not get it to work in 2 browsers he coded the css for it to work in IE and Firefox it works fins in IE but it is mucked up in Firefox.

    I will supply the coding below.

    ffindex.css

    PHP Code:
    /* CSS Document */

    body {
    background-color#4b6d78;
    font-familyVerdanaArialHelveticasans-serif;
    font-size10px;
    color#000000;
    margin-top20px;
    }

    #banner {
    width801px;
    height120px;
    background-imageurl(images/banner.gif);
    }

    #bar {
    width799px;
    height23px;
    border-left1px solid #020003;
    border-right1px solid #020003;
    background-imageurl(images/barbg.gif);
    }

    #container {
    width801px;
    clearboth;
    background-imageurl(images/container.gif);
    overflowhidden;
    }

    #bottom {
    width801px;
    clearboth;
    background-imageurl(images/bottom.gif);
    height24px;
    }

    #left {
    width177px;
    floatleft;
    margin-bottom: -1000px;
    padding-bottom1000px;
    overflowhidden;
    }

    #right {
    width177px;
    floatright;
    margin-bottom: -1000px;
    padding-bottom1000px;
    overflowhidden;
    }

    #mtop {
    width169px;
    height18px;
    clearleft;
    background-imageurl(images/mtop.gif);
    }

    #stop {
    width169px;
    height18px;
    clearright;
    margin-top10px;
    background-imageurl(images/stop.gif);
    }

    #rtop {
    width169px;
    height13px;
    margin-top10px;
    background-imageurl(images/rtop.gif);
    }

    #rbot {
    width169px;
    height13px;
    clearright;
    background-imageurl(images/rbot.gif);
    }

    #ntop {
    width169px;
    height18px;
    margin-top10px;
    background-imageurl(images/ntop.gif);
    }

    #cb {
    width169px;
    height5px;
    margin-bottom10px;
    background-imageurl(images/lcb.gif);
    clearleft;
    }

    #c {
    width157px;
    padding-right5px;
    padding-left5px;
    background-color#FFFFFF;
    border-left1px solid #000000;
    border-right1px solid #000000;
    clearleft;
    }

    #mc {
    width438px;
    padding-left5px;
    padding-right5px;
    margin-right177px;
    margin-left177px;
    overflowhidden;

    And this is the ffindex,html

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>ThisHabbo.net - Your Number 1 Habbo Fansite!</title>
    
    	<link rel="stylesheet" href="ffstyle.css" type="text/css" />
    
    </head>
    <center>
    
    
    	<div id="banner"></div>
    	
    		<div id="bar"><FONT SIZE="1" FACE="verdana" COLOR=white><MARQUEE WIDTH=100&#37; BEHAVIOR=SCROLL LOOP=3>This is an example of a scrolling marquee...</MARQUEE></FONT></div>
    		
    			<div id="container">
    			
    				<div id="left">
    				
    				<div id="ntop"></div>
    					
    					<div id="c"><iframe name="nav" id="nav"  src="http://www.thishabbo.net/v1/content/nav.html" 
    width="160" height="" scrolling"no" frameborder="0"></iframe></div>
    					
    				<div id="cb"></div>
    				
    					<div id="mtop"></div>
    					
    						<div id="c"><script type="text/javascript">
    var iframeids=["mainframe", "login", "nav", "stats", "news"]
    var iframehide="yes"
    var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
    var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers
    function resizeCaller() {
    var dyniframe=new Array()
    for (i=0; i<iframeids.length; i++){
    if (document.getElementById)
    resizeIframe(iframeids[i])
    if ((document.all || document.getElementById) && iframehide=="no"){
    var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
    tempobj.style.display="block"
    }
    }
    }
    function resizeIframe(frameid){
    var currentfr=document.getElementById(frameid)
    if (currentfr && !window.opera){
    currentfr.style.display="block"
    if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
    currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
    else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
    currentfr.height = currentfr.Document.body.scrollHeight;
    if (currentfr.addEventListener)
    currentfr.addEventListener("load", readjustIframe, false)
    else if (currentfr.attachEvent){
    currentfr.detachEvent("onload", readjustIframe) // Bug fix line
    currentfr.attachEvent("onload", readjustIframe)
    }
    }
    }
    function readjustIframe(loadevt) {
    var crossevt=(window.event)? event : loadevt
    var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
    if (iframeroot)
    resizeIframe(iframeroot.id);
    }
    function loadintoIframe(iframeid, url){
    if (document.getElementById)
    document.getElementById(iframeid).src=url
    }
    if (window.addEventListener)
    window.addEventListener("load", resizeCaller, false)
    else if (window.attachEvent)
    window.attachEvent("onload", resizeCaller)
    else
    window.onload=resizeCaller
    </script>
    <iframe name="login" id="login"  src="http://www.thishabbo.net/usersystem/user/login.php" 
    width="160" height="" scrolling"no" frameborder="0"></iframe></div>
    					
    					<div id="cb"></div>
    					
    					</div>
    					
    										<div id="right">
    					
    					<div id="rtop"></div>
    					
    						<div id="c">News.</div>
    						
    					<div id="rbot"></div>					
    					
    						<div id="stop"></div>
    						
    							  <div id="c"><iframe name="stats" id="stats"  src="http://www.thishabbo.net/usersystem/user/online2.php" 
    width="160" height="" scrolling"no" frameborder="0"></iframe></div>
    					
    						<div id="cb"></div>		
    						
    					</div>
    					
    							<div id="mc"><iframe name="mainframe" id="mainframe"  src="http://www.thishabbo.net/v1/content/home.html" 
    width="430" height="619" scrolling"no" frameborder="0"></iframe></div>	
    									
    						
    			</div>
    			
    		<div id="bottom"></div>
    	
    </div>
    </center>
    </body>
    </html>
    to view the error in the coding or css go to www.thishabbo.net in Firefox

    If you can sort this out + Rep.

    Edited by L&#181;ke (Forum Moderator): Thread Moved From Website Designing. Please post in the correct section next time, Thanks .
    Last edited by Lµke; 08-03-2007 at 07:02 PM.
    *Image Removed*

    Thank you Brad for the sig


    Signature edited by Nick- (Forum Super Moderator): Please do not have images that exceed the limit for non VIPs (700 x 150) in your signature.

  2. #2
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Its a bit of a miricle it worked at all, some of that codeing was appualing. Ive tryed to leave as much of it the same as it was, although some bits i had to totaly rewrite, it was useing Id's as classes, had divs and tags without anything to attach to, it was centered under a centering tag instead of aligning the divs, and the container didnt conatin the page o.0

    Anyway ive restrcutured it in a baisc way, it should now work, but aint even close to the xhtml standard the doc type boasts.

    The CSS
    HTML Code:
    /* CSS Document */
    
    body {
    	background-color: #4b6d78;
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 10px;
    	color: #000000;
    	margin-top: 20px;
    }
    
    #banner {
    	width: 801px;
    	height: 120px;
    	background-image: url(images/banner.gif);
    }
    
    #bar {
    	width: 799px;
    	height: 23px;
    	border-left: 1px solid #020003;
    	border-right: 1px solid #020003;
    	background-image: url(images/barbg.gif);
    }
    
    #container {
    	width: 801px;
    	clear: both;
    	background-image: url(images/container.gif);
    	margin-left:auto;
    	margin-right:auto;
    
    }
    
    #bottom {
    	width: 801px;
    	clear: both;
    	background-image: url(images/bottom.gif);
    	height: 24px;
    }
    
    #left {
    	width: 177px;
    	float: left;
    }
    
    #right {
    	width: 177px;
    	float: right;
    }
    
    #mtop {
    	width: 169px;
    	height: 18px;
    	clear: left;
    	background-image: url(images/mtop.gif);
    }
    
    #stop {
    	width: 169px;
    	height: 18px;
    	clear: right;
    	margin-top: 10px;
    	background-image: url(images/stop.gif);
    }
    
    #rtop {
    	width: 169px;
    	height: 13px;
    	margin-top: 10px;
    	background-image: url(images/rtop.gif);
    }
    
    #rbot {
    	width: 169px;
    	height: 13px;
    	clear: right;
    	background-image: url(images/rbot.gif);
    }
    
    #ntop {
    	width: 169px;
    	height: 18px;
    	margin-top: 10px;
    	background-image: url(images/ntop.gif);
    }
    
    #cb {
    	width: 169px;
    	height: 5px;
    	margin-bottom: 10px;
    	background-image: url(images/lcb.gif);
    	clear: left;
    }
    
    .c {
    	width: 157px;
    	padding-right: 5px;
    	padding-left: 5px;
    	background-color: #FFFFFF;
    	border-left: 1px solid #000000;
    	border-right: 1px solid #000000;
    	clear: left;
    }
    
    #mc {
    	width: 430px;
    	margin-left:auto;
    	margin-right:auto;
    }  
    And the html page

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    	<title>ThisHabbo.net - Your Number 1 Habbo Fansite!</title>
            <link rel="stylesheet" href="ffstyle.css" type="text/css" />
    	<script type="text/javascript">
    		var iframeids=["mainframe", "login", "nav", "stats", "news"]
    		var iframehide="yes"
    		var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
    		var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers
    		function resizeCaller() {
    			var dyniframe=new Array()
    			for (i=0; i<iframeids.length; i++){
    				if (document.getElementById)
    				resizeIframe(iframeids[i])
    				if ((document.all || document.getElementById) && iframehide=="no"){
    					var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
    					tempobj.style.display="block"
    				}
    			}
    		}
    		function resizeIframe(frameid){
    			var currentfr=document.getElementById(frameid)
    			if (currentfr && !window.opera){
    				currentfr.style.display="block"
    				if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
    					currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
    				else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
    				currentfr.height = currentfr.Document.body.scrollHeight;
    			if (currentfr.addEventListener)
    				currentfr.addEventListener("load", readjustIframe, false)
    			else if (currentfr.attachEvent){
    				currentfr.detachEvent("onload", readjustIframe) // Bug fix line
    				currentfr.attachEvent("onload", readjustIframe)
    				}
    			}
    		}
    		function readjustIframe(loadevt) {
    			var crossevt=(window.event)? event : loadevt
    			var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
    			if (iframeroot)
    			resizeIframe(iframeroot.id);
    		}
    		function loadintoIframe(iframeid, url){
    			if (document.getElementById)
    				document.getElementById(iframeid).src=url
    		}
    		if (window.addEventListener)
    			window.addEventListener("load", resizeCaller, false)
    		else if (window.attachEvent)
    			window.attachEvent("onload", resizeCaller)
    		else
    			window.onload=resizeCaller
    	</script>
    </head>
    
    
    <div id="container">
    	<div id="banner"></div>
    	
    	<div id="bar">
    		<FONT SIZE="1" FACE="verdana" COLOR=white><MARQUEE WIDTH=100&#37; BEHAVIOR=SCROLL LOOP=3>This is an example of a scrolling marquee...</MARQUEE></FONT>
    	</div>
    
    	<div id="left">	
    		<div id="ntop"></div>
    		<div class="c">
    			<iframe name="nav" id="nav"  src="http://www.thishabbo.net/v1/content/nav.html" width="160" height="" scrolling"no" frameborder="0"></iframe>
    		</div>
    		<div id="cb"></div>
    		<div id="mtop"></div>
    		<div class="c">
    			<iframe name="login" id="login"  src="http://www.thishabbo.net/usersystem/user/login.php" width="160" height="" scrolling"no" frameborder="0"></iframe>
    		</div>
    		<div id="cb"></div>
    	</div>
    		
    	<div id="right">
    		<div id="rtop"></div>
    		<div class="c">News.</div>	
    		<div id="rbot"></div>					
    		<div id="stop"></div>
    		<div class="c">#			
    			<iframe name="stats" id="stats"  src="http://www.thishabbo.net/usersystem/user/online2.php" width="160" height="" scrolling"no" frameborder="0"></iframe>
    		</div>
    		<div id="cb"></div>				
    	</div>
    	
    	<div id="mc">
    		<iframe name="mainframe" id="mainframe"  src="http://www.thishabbo.net/v1/content/home.html" width="430" height="619" scrolling="no" frameborder="0"></iframe>
    	</div>	
    	<div id="bottom"></div>
    	
    </div>
    
    </body>
    </html>
    Positioning holds in IE+FF although i didnt have the images so some sizeing and scaling may be off, plus unexpected bugs could arrise from image sizeing, but give it a try, with luck it will work, although may possibly need some minor tweeking here and there, it was just a quick hack and slash job :p

  3. #3
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    Ahhhhh div tags *SHOOTS* be ashamed RichardKnox, tables should be used on that >_


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

  4. #4
    Join Date
    Jun 2005
    Location
    USA
    Posts
    2,047
    Tokens
    0

    Latest Awards:

    Default

    Works perfect + Rep.
    *Image Removed*

    Thank you Brad for the sig


    Signature edited by Nick- (Forum Super Moderator): Please do not have images that exceed the limit for non VIPs (700 x 150) in your signature.

  5. #5
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Glad to have helped

  6. #6
    ScottDiamond Guest

    Default

    Nice to see my free layout still being used.

    And it was designed to be coded in tables btw, it's bad with divs.

  7. #7
    Join Date
    Mar 2006
    Location
    Scotland
    Posts
    1,012
    Tokens
    175

    Latest Awards:

    Default

    IGNORE THIS. I REALLY CANT BE BOTHERED ARGUING...
    Last edited by YouFail; 08-03-2007 at 05:55 PM.


    You don't like me
    Chances are I don't like you.

  8. #8
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Quote Originally Posted by ScottDiamond View Post
    Nice to see my free layout still being used.

    And it was designed to be coded in tables btw, it's bad with divs.
    You cant really design a layout for table/div based codeing, both can be done, although with tables theres often alot of extra work, and less flexibility, Css/Dvs is VERY powerful if you use it right, and the layout can be easy put in to it, im pretty sure with my touch ups (aka actually using css instead of a mix of css and non-supported tags) it should work ok, plus haveing a random </div> floating around probably didnt help much.

  9. #9

    Default

    Iframes Ugh
    Btw the current site's code is appauling.. seriously.
    Puts a bad name to css

Posting Permissions

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