Results 1 to 2 of 2

Thread: Coding Help

  1. #1
    Join Date
    Jun 2009
    Location
    Newcastle Upon Tyne, UK
    Posts
    2,652
    Tokens
    1,389
    Habbo
    lRhyss

    Latest Awards:

    Default Coding Help

    Ok, I am trying to learn how to code, I can do everything up to 2 column atm, and today I went for three.

    I have the left and right columns working, but I can't get the center content box to center?

    How could I do this?

    HTML Code:
    <div style="float:left; width: 250px;">  <br />
        
        	<div id="purpletop"></div>
    		
            <div id="sidemid">test<BR /><BR /><BR />:)</div>
            
            <div id="sidebot"></div><BR />
            
            
            <div id="greentop"></div>
    		
            <div id="sidemid">test<BR /><BR /><BR />:)</div>
            
            <div id="sidebot"></div><BR />
            
            
            <div id="yellowtop"></div>
    		
            <div id="sidemid">test<BR /><BR /><BR />:)</div>
            
            <div id="sidebot"></div><BR />
            
            
            <div id="orangetop"></div>
    		
            <div id="sidemid">test<BR /><BR /><BR />:)</div>
            
            <div id="sidebot"></div><BR />
            
            
            </div>
            
            	
            		<div id="mid">test<BR /><BR /></div>
                
    			
        
        <div style="float:right; width:250px;">  <br />
        
        	<div id="purpletop"></div>
    		
            <div id="sidemid">test<BR /><BR /><BR />:)</div>
            
            <div id="sidebot"></div><BR />
            
            
            <div id="greentop"></div>
    		
            <div id="sidemid">test<BR /><BR /><BR />:)</div>
            
            <div id="sidebot"></div><BR />
            
            
            <div id="yellowtop"></div>
    		
            <div id="sidemid">test<BR /><BR /><BR />:)</div>
            
            <div id="sidebot"></div><BR />
            
            
            <div id="orangetop"></div>
    		
            <div id="sidemid">test<BR /><BR /><BR />:)</div>
            
            <div id="sidebot"></div><BR />
        
        </div>
    Thanks and +Rep to all that help!

  2. #2
    Join Date
    Jan 2006
    Location
    Kent
    Posts
    987
    Tokens
    0

    Default

    I don't really understand what you're trying to do with that obscure amount of divs. Where possible you shouldn't really use inline styling (style="floateft;") etc, you should be styling in the head or better yet an external stylesheet.
    I've whipped up a quick 3 column layout for you though.
    Also, an id's should be unique. If you want a set of styles on multiple elements you should use classes (class="classname") and then to set that in the style you would .classname {floateft} for example.

    Hope this helps and you can learn from it
    Code:
    <head>
    <style type="text/css">
    #container {
    width: 100%;
    }
    #left {
    width: 33%; 
    float:left;
    }
    
    #center {
    width: 33%;
    float:left;
    }
    
    #right {
    width: 33%;
    float:left;
    }
    </style>
    </head>
    <div id="container">
        <div id="left">left</div>
        <div id="center">middle</div>
        <div id="right">right</div>
    </div>
    This is our situation and we're happy to be here,
    I wouldn't change this place for anything.


Posting Permissions

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