For whatever reason, I cannot get the image on this page to float to the right: bonaweiss.atspace.com/help/float.html No matter what I've tried, the image sticks to the left side. I have no clue what I'm doing wrong, any ideas? Thanks in advance.
do you want the whole thing (image+box and text) to go to the right of the whole screen... or just the image to go to the right hand side of the box? if its the latter.... maybe just try a text-align:right; in your css?
Try the code below: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head><title>Untitled Document</title> <style type="text/css"> html { overflow-y: scroll; } .somediv { width:530px; margin:-20px 0 0px 0px; clear:both; border:1px solid gray } .somediv .floatbox { float:left; width:185px; margin:2px 0 0px 2px; display: inline; } .somediv p { margin-top:0; margin:0px 0px 0px 325px; font-size:10px; } h1 { font-family:Sans-serif; font-size:12px; color:#fcc; margin-top:0px; margin-bottom:0px } h2 { font-family:Sans-serif; font-size:12px; color:#fff; text-align: left; margin-top:-10px; margin-bottom:-15px } h3 { font-family:Sans-serif; font-size:12px; color:#fff; text-align: right; margin-top:0px; margin-bottom:0px } h4 { font-family:Sans-serif; font-size:12px; color:#fcc; text-align: right; margin-top:-14px; margin-bottom:0px } img.floatRightClear { float: right; clear: right; margin: 4px; } .floatLeftClear { float: right; clear: left; margin: 4px; } A { text-decoration:underline; font-family:Sans-serif; font-size:12px; color:#fff; text-align: center; margin-top:0px; margin-bottom:0px } body {scrollbar-3dlight-color:#000000; scrollbar-arrow-color:#000000; scrollbar-base-color:#000000; scrollbar-track-color:#876969; scrollbar-darkshadow-color:#FFC0CB; scrollbar-face-color:#FFC0CB; scrollbar-highlight-color:#FAEBD7; scrollbar-shadow-color:#000000} </style></head><body bgproperties="fixed" background="float_files/backgroundnews.htm"> <div class="somediv"> <h1>Fruits</h1><h4>September 1, 2006 1:34am</h4> <h2>Fruits is now available under FILM.</h2><img src="float_files/fruits_frame1.jpg" class="floatRightClear"> <br clear="all" /><br /> </div> </body></html> Code (markup):
You should also google for: float css tutorial I do that EVERY time, even now I know how to use it because the tmeplates it offers are just so quick. I can copoy and paste it really quickly. Its the top link
Thanks for the help everyone. The problem was (as I see that CliveRay noticed) that I didn't close my h4 tag, canceling out all of the CSS below it. Dumb mistake I know, but I'm new to this. I have one more problem with floating, I'm wondering how to make this page: bonaweiss.atspace.com/help/newssetup.html Look like this: bonaweiss.atspace.com/help/44.html
My images are floating, I just wonder how to code it so that it does what it's doing in the second link.
Sorry, i was replying to your original question at the same time that you were posting that you got it. for your 2nd question, 1) you have 2 body tags. Remove the one right below <title>. also, you should not put your background in the body tag, it should go in your styles. 2) apply the background image to .somediv in your css.
Done. Does this apply to how it looks in the second link though? It seems as if I would need to put a new css code in there to make it do so.