View Full Version : Having Trouble the Little float property

03-09-2005, 03:27 PM
I have a site that has 2 images 1 is for the main logo located at the top of the page (it is centered) and one is an image located in the middle of the page. I wanted the image located in the middle of the page to allow text to wrap around the top,right side and bottom. I used this code
border:0px solid black;
margin:0px 10px 15px 20px;

to accomplish the matter and it works perfect. However it makes my main logo at the top of the page position itself to the left not the center.

Could someone please tell me why it is when I use that code it works perfect for the middle image but makes my logo at the top of the page shift to the left. Now I have the above code placed inside a <p> tag because the image sits in the middle of a long paragraph. In other words i have <p> then a whole bunch of text (in the middle of the text I have my Image) then more text and at the end of all the text is a </p>


03-09-2005, 03:33 PM
If you use just the img element selector for the float rule, it will apply to all images no matter where they are located, which is exactly what you experience.
You need to use a more specific selector for your floated image; to give any pointers, a look a the markup would be nice. It probably sits inside a containing element of sorts, which can be employed to make a more specific selector.