Click here to Skip to main content
15,905,782 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
PHP
if (mysql_num_rows($cld1v)=='1'){
	echo "<img src=images/cld1 border='1' style='max-width:400px; position:relative; top:15px; float:right; margin-bottom:15px; margin-left:15px;'><br />";
}
while($in=mysql_fetch_row($text)){
	echo "<div style='removed:relative;'>$in[0]";
}
if (mysql_num_rows($cld2v)=='1'){
	echo "<img src=images/cld2 border='1' style='position:relative; bottom:400px; float:left; left:0px; max-width:400px; margin-top:15px; margin-right:15px;'>";
}

Now in this code, the first image ist displayed on the right like I wanted it to.
Thats how it looks like at the moment:
http://imageshack.us/photo/my-images/809/wp0m.png/
And that is how I want it too look like:
http://imageshack.us/photo/my-images/843/o4to.png/

The second link is a picture from the old page, where the text is written in a .html document. The first one is from the newpage, where the text is in a mysql database and its easier to edit


I need it like this

text text text text -----------
text text text text | picture 1|
text text text text -----------
text text text text text text
text text text text text text
--------- text text text text
picture 2|text text text text
--------- text text text texthttp://www.codeproject.com/Questions/ask.aspx
Posted
Updated 2-Nov-13 3:06am
v3

Take two div tag.
in first div tag display your image and give it float:left.
in second div add your text and give padding as per your requirement.
Ex:
<div id="Main">
     <div id="firstDiv" style="float:left"><img ...="" /></div>
     <div id="secondDiv" style="padding:6%"><p>Your Text Here</p></div>
</div>
<div style="clear:both"> //to clear float effect.
</div>


Hope This Helps You.
----------------------
Pratik Bhuva
 
Share this answer
 
v3
Comments
Chi Ller 2-Nov-13 9:04am    
now the picture is just at the top of the text and next to the other picture

--------- text text text ---------
picture2| text text text |picture1 |
--------- text text text ---------
text text text text text text text

but i need

text text text text -----------
text text text text | picture 1|
text text text text -----------
text text text text text text
text text text text text text
--------- text text text text
picture 2|text text text text
----------text text text text
 
Share this answer
 
Comments
Chi Ller 2-Nov-13 8:26am    
That´s not really the problem. The problem is the text read from a mysql database, so I don´t know how to put the second image on the left side at the bottom of the page
Ok I found an other way to do this:

PHP
$count = str_word_count($string);
$split = explode(' ',$string);
$part1 = array_slice($split,0,ceil($count/2));
$part2 = array_slice($split,ceil($count/2));
$string1 = implode(' ',$part1);
$string2 = implode(' ',$part2);


first I count the words of the database, then I splitted it of after the half, and put the 2nd picture at the top oft the second half.

Thats not pefect I think, but I´m contented :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900