Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
How to float image to bottom right?
Old 06-29-2007, 11:10 AM How to float image to bottom right?
artcoder's Avatar
Skilled Talker

Posts: 89
Location: United States
Trades: 0
Below is a picture of what I want to achieve...



See how there is a div around the text and picture. But I want the picture on the lower right.

Below is the code that I'm attempting to use ...

Code:
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style>
.panel {
 border: 1px solid #00c;
 margin: 20px 20px 0px 20px;
 background-color: white;
 padding: 0px;
 width: 300px;
}
</style>
</head>
<body>
<div class="panel">
There is some text here that I want to wrap around the picture which should be banked to the bottom right of this panel.
<br /><br />I want the text to fill the area of left of the happy face.<br /><br />
Right now, the happy face is taking up the whole bottom area.
<img src="happy.gif" style="float:right;" />
</div>
</body>
</html>

As you can see on this page, it is not coming out like I wanted. The text is not flowing down into the level of the picture.

Any suggestions?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
artcoder is offline
Reply With Quote
View Public Profile Visit artcoder's homepage!
 
 
Register now for full access!
Old 06-29-2007, 11:17 AM Re: How to float image to bottom right?
Riane's Avatar
Super Talker

Latest Blog Post:
Happy Birthday, Steve!
Posts: 147
Name: Jordan
Location: Chicago, IL
Trades: 0
You're just floating the image to the right, and not really specifying anything else for it to do.

What you can do is create a class the the image, say "bottom-right."

Code:
img.bottom-right{
    border: 0;
    padding: 0;
    margin-left: 10px;
    margin-top: 10px;
    float: right;
}
The margin left/top has a 10px which allows the text to wrap the image on the top and left side without running straight into the image. You can change it for more space or less space.

And in your image you would just have (remember with XHTML Trans 1.0, you have to list an alt attribute, as well as the closing backslash.)
Code:
 <img src="image.gif" class="bottom-right" alt="image" />
Since you are using an XHTML 1.0 Trans doctype, you might want to create stylesheet.css, and put all of your CSS in that file, then link it in your header. And don't forget that you need to close your linebreaks: <br />
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE


Last edited by Riane; 06-29-2007 at 11:28 AM..
Riane is offline
Reply With Quote
View Public Profile Visit Riane's homepage!
 
Old 06-29-2007, 03:16 PM Re: How to float image to bottom right?
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
In order to make FF "wrap" the floated element, you must CLEAR the float. You can read how that's done here: http://css-discuss.incutio.com/?page=ClearingSpace
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How to float image to bottom right?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.43459 seconds with 12 queries