Jump to content

cant make three comlumbs of code in php/html


Recommended Posts

Hello on my website cravedgames.com i have tried creating 3 columns of games the only way i can even make 2 is if i add float:left to one column and float:right for the other. can someone help me (im using wordpress)

 


    <div style="width:900px; height:700px;" width=900px height=700px;>





        <div style="width:400px; float:left;">

        <div style="margin-bottom:5px;"><img src="(image link)"></div>

            <?php

            while (have_posts()) :

            the_post();

            $image = get_post_meta($post->ID,'thumbnail', true);

            $author = get_post_meta($post->ID,'author', true);

            ?>

            <div class="maingame" >

                <?php if($image) : ?>

                <div style="padding-left:5px; float:left; padding-top:6px; margin-right:10px;"><a href="<?php the_permalink() ?>"><img class="thumbnail" src="(link)/<?php  echo $image; ?>" alt="<?php the_title(); ?>" width="111" height="111" /></a>

                <br><div style="margin-left:16px; margin-top:3px; margin-right:20px;"><?php if(function_exists('the_ratings')) { the_ratings(); } ?></div>

                </div><?php endif ?>

                <h3 class="title" style="padding-left:10px;"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>

                <div style="margin-top:3px; margin-bottom:7px;">

                by <?php  echo $author; ?><br>

                <?php akpc_the_popularity(); ?> 

                </div>

                <div class="entry" >

                    <div class="mainentry"><?php the_content_rss('', TRUE, '', 16); ?></div>

                </div>

            </div>

            <?php endwhile;    ?>

        </div>

        <div style="width:400px; float:right;">

        <div style="margin-bottom:5px;"><img src="(image link)"></div>

            <?php

            while (have_posts()) :

            the_post();

            $image = get_post_meta($post->ID,'thumbnail', true);

            $author = get_post_meta($post->ID,'author', true);

            ?>

            <div class="maingame" >

                <?php if($image) : ?>

                <div style="padding-left:5px; float:left; padding-top:6px; margin-right:10px;"><a href="<?php the_permalink() ?>"><img class="thumbnail" src="(link)/<?php  echo $image; ?>" alt="<?php the_title(); ?>" width="111" height="111" /></a>

                <br><div style="margin-left:16px; margin-top:3px; margin-right:20px;"><?php if(function_exists('the_ratings')) { the_ratings(); } ?></div>

                </div><?php endif ?>

                <h3 class="title" style="padding-left:10px;"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>

                <div style="margin-top:3px; margin-bottom:7px;">

                by <?php  echo $author; ?><br>

                <?php akpc_the_popularity(); ?> 

                </div>

                <div class="entry" >

                    <div class="mainentry"><?php the_content_rss('', TRUE, '', 16); ?></div>

                </div>

            </div>

            <?php endwhile;    ?>

        </div></div>





</div>

<?php get_footer(); ?>

Link to comment
Share on other sites

make all 3 columns FLOAT:LEFT, with a fixed width...then make sure the parent div around the 3 columns has a width wide enough to hold them. right now, you have 400px columns, but a parent that is only 900px...so you can't fit 3 in there

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.