Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder Partizan's Avatar
    Join Date
    Dec 2008
    Location
    Legoland and Ireland
    Posts
    139
    Thanks
    74
    Thanked 0 Times in 0 Posts

    Help with positioning

    Been messing around for quite a while with this.

    I want to space the three DIVs (highlighted in red border) out a bit, that is have some space inbetween them. http://www.minifigtimes.com/test.shtml

    I have done this in the CSS but it also moves out the first DIV from the right which is not what I want (DIV with text "LFC Comeback Ends Napoli's...").

    Basically I want the leftmost column as is but the other two spaced out evenly, about an inch of blank space between them.

    This is the relevant code

    CSS
    PHP Code:

    #subwrapper{
     
    margin0 0 0 0/* above left below right */
     
    padding0
     
    border:1px solid #f00; /*diagnostic*/
     
    overflow:auto/*these two lines*/
     
    width:75%; /*uncollapse the box*/
    }


    #subwrapper div{
     
    margin0/* above left below right */
     
    padding:0px
     
    border:1px solid #f00; /*diagnostic*/
     
    width:20%; /*sets the column width as a percentage of #subwrapper*/
     
    float:left;
    }

    #subwrapper img{
     
    width80%;
     
    height80%;
     

    HTML

    PHP Code:
    <div id="subwrapper">
        <
    div>
            <
    img src="http://www.minifigtimes.com/images-2009/news/2009-02-07-p1.png" alt="test">
            <
    p>LFC Comeback Ends Napolis Record Unbeaten Run <a href="http://www.minifigtimes.com/news/2009/2009-02-07-story01.shtml" class="link-blue">Read</a></p>
        </
    div>
        
        <
    div>
            <
    img src="http://www.minifigtimes.com/images-site/test-image-medium.png" alt="test">
            <
    p id="subbody">A goal from Den&#237;lson soon followed and the three points were secured by Marco Materazzi in the 83rd minute.</p>
        
    </div>
        
        <
    div>
            <
    img src="http://www.minifigtimes.com/images-site/test-image-medium.png" alt="test">
            <
    p>Ajax Skerries boss Roberto Donadoni praised his minifigs for beating the odds and claimed if they believe in themselves he believes they can go all the way.</p>
        </
    div>      
    </
    div>      <!-- sub wrapper Div end --> 
    Can anyone please help?

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,678
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Goodmorning Partizan,
    Give that middle one a class and you can add a margin to it. This should work:
    Code:
    #subwrapper .mid {
    margin: 0 20%;
    }
    Code:
    <p>LFC Comeback Ends Napoli's Record Unbeaten Run <a href="http://www.minifigtimes.com/news/2009/2009-02-07-story01.shtml" class="link-blue">Read</a></p>
    	</div>
    	
    	<div class="mid">
    		<img src="http://www.minifigtimes.com/images-site/test-image-medium.png" alt="test">
    		<p id="subbody">A goal
    http://validator.w3.org/check?verbos...m%2Ftest.shtml
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    Partizan (02-19-2009)

  • #3
    Regular Coder Partizan's Avatar
    Join Date
    Dec 2008
    Location
    Legoland and Ireland
    Posts
    139
    Thanks
    74
    Thanked 0 Times in 0 Posts
    Thanks again Excavator!

    Worked perfectly


  •  

    Posting Permissions

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