Jump to content

CSS or PHP issue?


harkly

Recommended Posts

My pictures are dropping down a line when I end the span after a completed a href tag. But if I enter the span after the <a href> tag but before my image is added and the </a> the image goes to where I want. Right beside the number.

 

Here is my code that doesn't work but makes sense to me to use ....

 

                      echo "<div id='artContent'>";
                        echo "<span class='image'>";
                          echo $count++ ;
                 echo ". a href='image/$artid/$imgid.jpg' class='thickbox' title='$title by $fullName'>
                                              <img src='image/thumb/$artid/$imgid.jpg' border=0 width=75 height='100' title='$title by $fullName' align=left valign=top></a></span>";

                        echo "<span class='info'>";
                         echo "<a href='image.php?imgid=$r[imgid]' title='$title by $fullName'>".$title."</a> <br>".$dt."<br>".$medid."<br>".$bio." ";
                      echo "</span></div>";

 

This code puts the image right beside the number.

 

                     echo "<div id='artContent'>";
                        echo "<span class='image'>";
                          echo $count++ ;
                 echo ". <a href='image/$artid/$imgid.jpg' class='thickbox' title='$title by $fullName'></span>";

                 echo "<img src='image/thumb/$artid/$imgid.jpg' border=0 width=75 height='100' title='$title by $fullName' align=left valign=top></a></span>";

                        echo "<span class='info'>";
                         echo "<a href='image.php?imgid=$r[imgid]' title='$title by $fullName'>".$title."</a> <br>".$dt."<br>".$medid."<br>".$bio." ";
                      echo "</span></div>";

 

the CSS

#artContent {margin: 0px 0px 100px; padding: 0px; color: #000;}
    #artContent .image {float: left; text-align: left; margin-left: 190px; padding: 0px; margin-top: 0px;}
    #artContent .info {color:#000000; font-size: 14px; font-family: Sylfaen;letter-spacing: 0.1em;}
    #artContent a {color:#4970BF; font-size: 14px; font-family: Sylfaen; text-decoration: none; letter-spacing: 0.1em;}
    #artContent a:hover {color:#a69; font-size: 14px; font-family: Sylfaen; text-decoration: underline; letter-spacing: 0.1em; }	
    #artContent .search {float: left; text-align: left; margin-left: 190px; padding: 0px; margin-top: 15px;}

 

Any suggestions???

 

 

images.bmp

Link to comment
https://forums.phpfreaks.com/topic/149763-css-or-php-issue/
Share on other sites

well..PHP has nothing at all to do with layout...whatsoever.

so it's definitely the CSS.

 

You forgot the beginning span tags

echo "";
echo "";
echo "";
echo "";

 

also you need to specify span in your CSS

.image span {

    float:left;

}

and tell it to float:left.

Link to comment
https://forums.phpfreaks.com/topic/149763-css-or-php-issue/#findComment-786432
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.