> -----Original Message-----
> From: M M [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, 16 March 2005 2:54 PM
> To: [email protected]
> Subject: [WSG] Css Floating Image
> 
> I am having problems floating an image in a div cell using css.
> I want to have the whole page centered and static width.  
> Then styling on 
> the wrapper div, with the image floating so that text will 
> line up next to 
> it. Right now the problem is a gap under the image.
> 
> body{text-align: center;}
> #wrapper{
>       text-align: left;
>       border: 1px solid #000000;
>       width: 700px;
> }
> #box{
>       float: left;
>       background-color: #FF0000;
>       border: 1px solid #3300FF;
> }
> #text{background-color: #00FF00;}
> 
> </style></head><body >
> <div id="wrapper">
>       <div id="box">
>               <img src="images/test.jpg" >
>       </div>
>       <div id="text">this text should float to the right of 
> the image</div>
> </div>
> </body></html>
> 

I didn't get around to checking it in a browser yet, but from your code I
guess you have difficulties with it in IE? This could be caused by not
having a width for your #box. If you float you should always have a width.
So in this case you might want to try 

#box{
float: left;
background-color: #FF0000;
border: 1px solid #3300FF;
Width: [width of test.jpg]
}

HTH.

Andreas Boehmer
User Experience Consultant

Phone: (03) 9386 8908
Mobile: (0411) 097 038
http://www.addictiveMedia.com.au
Consulting | Accessibility | Usability | Development 


******************************************************
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help
******************************************************

Reply via email to