MOTIVECODEX
MOTIVECODEX

Reputation: 2752

Boxes are tripping if I insert text in them

* RESOLVED BY INTENSE RESEARCHING *

[DOWNLOAD CODE, NO COPYRIGHT =)] .rar file ( always scan before opening .rar - F4LLCON

Problem is that without text the boxes are placed 2 on each row, but with text the boxes appear under each other with spacing. To get the text in the boxes I used <style> in <head>.

How can I FIX this annoying problem?

IMAGE: LINK

Without the p and h3, both echo text will appear under the box and not in the box IMAGE

Code:

<style>
        p {
        position:relative;
        top:-240px;
        left:180px;
        }
        h3 {
        position:relative;
        top:-270px;
        left:30px;
        }
</style>

and

<div class="offers">
    <div class="content_box">
        <?php
            while($products = mysql_fetch_array($result)) {
                echo '<img src="includes/images/content_box.png" border=0/>';
            //  echo "<h3>" . $products['products'] . "</h3>";
            //  echo "<p>" . $products['description'] . "</p>";
            }   
        ?>
    </div>
</div>

RESOLVED BY DOING:

<STYLE TYPE="text/css">
#title{color:red; padding-bottom: 240px; padding-left: 25px;}
#desc{color:blue; padding-bottom: 135px; padding-left: 5px;}
</STYLE>
</head>

and

<div>
    <?php while($products = mysql_fetch_array($result)) {?> 
        <table align="left" background="includes/images/box.gif" width="473" height="285">
            <tr>
                <td width="35%" height="100%" id="title">
                    <?php echo $products['products'] . "&nbsp"; ?>
                </td>
                <td width="70%" height="100%" id="desc">
                    <?php echo $products['description'];?>
                </td>
            </tr>
        </table>
    <?php
            }   
        ?>
</div>
</body>

This might be easy for some, but I'm new to this. Now working correctly.

Thank you for giving me directions and Thank you Google and Stackoverflow for so much help =)

enter image description here

Upvotes: 0

Views: 154

Answers (1)

BjarkeCK
BjarkeCK

Reputation: 5729

I am asuming that content_box.png is the background for the box right?

instead of including it in a create it in the background of a div with a class like this

CSS:

    .product_box {
         bacground:url(includes/images/content_box.png);
         width:xxxpx; /* the width of conrent_box.png */
         height:xxxpx; /* the height of conrent_box.png */
         position:relative;
         float:left;
    }        

php:

    <?php 
        while($products = mysql_fetch_array($result)) {
            echo '<div class="product_box">';
        //  echo '<img src="includes/images/content_box.png" border=0/>';
            echo "<h3>" . $products['products'] . "</h3>";
            echo "<p>" . $products['description'] . "</p>";
            echo '</div>';
        }   
    ?>

Hope it helps!

Upvotes: 2

Related Questions