How To Float an Image to the Left of Text
Hi All, This Tutorial is dedicated to all the web programmers around the world.
While Designing Websites as web programmers we all face a small headache with images and texts.We have separate tags in html for images and also for text.
We use the tag br to go to next line.But, if we have and image and a text the text that is next to image will automatically go down without even specifying a break.
So we use lot of poistioning in css. But its will only double the work.So i am gonna teach you how to get this solved in a simple way
Web programmers have a problem with text coming below image when use use an img tag before any text (see the Image Below)
So to Solve This Problem what you have to do ? Well the Answer is simple if you want text to be left side of image use the code below
<p>
<img src="new.jpg" style="float:left">This is the sample text on right Side
</p>
See image below
and if you want the text to be on right side of text then use
<p>
<img src="new.jpg" style="float:right">This is the sample text on right Side
</p>
See image below
So the attribute of tag "float:left" will move your image to the left so giving space for your text and in the right side its vice versa
Hope u liked it....
While Designing Websites as web programmers we all face a small headache with images and texts.We have separate tags in html for images and also for text.
We use the tag br to go to next line.But, if we have and image and a text the text that is next to image will automatically go down without even specifying a break.
So we use lot of poistioning in css. But its will only double the work.So i am gonna teach you how to get this solved in a simple way
Web programmers have a problem with text coming below image when use use an img tag before any text (see the Image Below)
So to Solve This Problem what you have to do ? Well the Answer is simple if you want text to be left side of image use the code below
<p>
<img src="new.jpg" style="float:left">This is the sample text on right Side
</p>
See image below
and if you want the text to be on right side of text then use
<p>
<img src="new.jpg" style="float:right">This is the sample text on right Side
</p>
See image below
So the attribute of tag "float:left" will move your image to the left so giving space for your text and in the right side its vice versa
Hope u liked it....
Comments
Post a Comment