View Full Version : align right

01-10-2004, 02:22 AM
how do i align an image (in css) right, so that the image does not go in the next line:

I want text that is align left and then an image in the SAME line aling right

is that possible?

01-10-2004, 03:57 AM
Originally posted by JAVAEOC
I want text that is align left and then an image in the SAME line aling right

is that possible?

/me is just a guessing® 'cept just a fter® searchin' on google.com for... css align=right ... /me seems to see just a lotta® css saying to just a lign® the 'text' left n' the image twould thennn just a go® to the right???

/me doesnt do css 'cept thought she try to offer just a suggestion® til the pros come just a long® lol...

01-10-2004, 01:32 PM
style="float: right;" inside ur image tag should do it.

Shouldn't really use inline styles but i'm sure you know how to move this into a stylesheet

01-10-2004, 02:05 PM
Hi there JAVAEOC,

This is how I would do it....

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta content="mshtml 6.00.2800.1264" name="generator" />
<title>Float right</title>
<style type="text/css">
div#one{width:43%;float:left; text-align:justify;text-justify: newspaper;}
<div id="one">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Praesent blandit venenatis purus. Integer massa libero,
vehicula id, consequat sed, tincidunt nec, purus. Class
aptent taciti sociosqu ad litora torquent per conubia
nostra, per inceptos hymenaeos. Suspendisse potenti.
Nunc vulputate magna non magna. Aenean lorem eros,
adipiscing quis, semper non, dictum a, nunc. Curabitur
ut sem. Pellentesque a est id neque hendrerit ultrices.
Donec vulputate tincidunt turpis. Curabitur dignissim
vestibulum nunc. Aliquam felis lorem, ultrices sit amet,
convallis a, accumsan vel, ante. Proin aliquam turpis
sed augue. In pellentesque, magna a pulvinar adipiscing,
est orci adipiscing felis, sed laoreet urna magna quis
neque. Proin facilisis aliquet urna.
<div id="two">
<img src="some.gif"alt="name of the picture"width="324"height="200"/>


01-10-2004, 02:09 PM
you you would wrap a paragraph in a div tag without using a <p> tag, wrap an image needlessly in an empty div and assign IDs that have no bearing on their content?

good plan.

01-10-2004, 02:29 PM
with this float right stuff the image still goes in the next line

and with the two div containers the image would not be aligned right

01-10-2004, 03:07 PM
put the image first then float it right:

<p><img src="whatever.jpg" style="float: right" />Blah blah blah blah blah blah blah blah blah</p>

01-11-2004, 02:43 AM
or like he said except instead of style="float... just use align="right"

01-11-2004, 03:42 AM
/me just a whispers® to isl...
"quote...instead of style="float... just use align="right"...endquote"

thattts how /me would just a do® it tooo...'cept theyyy are just a looking® on howww to do it via css...aka /me thinks ourrr method??? isnt just a proper/uptostandard® coding...lol...

01-11-2004, 08:46 AM

I have the same thing on my website, http://richardmedek.com/current/. On the left is an img that says "Current" and on the right is an img with the links "prev/next". What I did was, since the basic page was aligned to the left, used a class "right" in the css
.right {clear:both; float:right} (you know, I don't remember what the clear:both is doing in there, but I remember it was needed ;) ) and then put this in the XHTML...
<span class="right"><img src="../imgs/prev.gif" width="50" height="25" alt="prev" />...etc...</span><img src="../imgs/titlecurrent.gif" width="200" height="25" alt="" /> Note that the item on the right is actually typed first, because the float takes the element out of the flow.

Hope this helps...