473,656 Members | 2,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Replacing <IMG ALIGN=RIGHT ...> with CSS equivalent

When I replaced older <IMG ALIGN=RIGHT ...> tags with a CSS definition

<IMG class=right ...>

xxx.css:

IMG.right { BORDER: 0; align: right }

I notice that the effect is NOT the same. While in the past the text was flowing smoothly around the picture
on the right side there is now a hard cut: Text, then picture below with white space on the left and finally
the text continues BELOW the picture.

How do I achieve that the text is flowing around the picture as before ?

T.

Jul 20 '05 #1
12 95534
Ted Mencini wrote:
When I replaced older <IMG ALIGN=RIGHT ...> tags with a CSS definition

<IMG class=right ...>

xxx.css:

IMG.right { BORDER: 0; align: right }

I notice that the effect is NOT the same
This is becuase there is no "aligh" property in CSS.
How do I achieve that the text is flowing around the picture as before ?


Look up the float property

--
David Dorward <http://dorward.me.uk/>
Jul 20 '05 #2
Ted Mencini wrote:
When I replaced older <IMG ALIGN=RIGHT ...> tags with a CSS definition

<IMG class=right ...>

xxx.css:

IMG.right { BORDER: 0; align: right }


When using CSS, you don't simply put HTML attributes into a stylesheet. CSS
has its own set of properties that only occasionally overlap with obsolete
HTML attributes.

There is no such property as 'align' in CSS. You are looking for the
'float' property. If a browser does anything with an align property, then
it's proprietary behaviour that will not work across multiple browsers.

<p>
<img src="..." alt="..." />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus ornare,
justo vitae faucibus ornare, est enim pretium elit, in hendrerit tortor
purus ac dolor. Class aptent taciti sociosqu ad litora torquent per conubia
nostra, per inceptos hymenaeos. Ut et nisl. Fusce sed erat. Proin ut est eu
arcu interdum volutpat. Vestibulum nibh velit, congue nec, sodales vel,
faucibus eu, magna. Cras odio quam, adipiscing nec, luctus eu, pellentesque
nec, urna. Integer feugiat, velit et ultrices tempus, sapien erat molestie
dolor, id pretium felis justo ac lectus. Cum sociis natoque penatibus et
magnis dis parturient montes, nascetur ridiculus mus. Fusce nec erat. Nam
euismod tortor eget urna. Praesent vestibulum.
</p>

img {
float: right;
}

--
Jim Dabell

Jul 20 '05 #3
A curious thing is happening, when I use display:inline; and background:
url(); my object(<div> do you call that an object?) disappears.

Jim Dabell wrote:
Ted Mencini wrote:

When I replaced older <IMG ALIGN=RIGHT ...> tags with a CSS definition

<IMG class=right ...>

xxx.css:

IMG.right { BORDER: 0; align: right }

When using CSS, you don't simply put HTML attributes into a stylesheet. CSS
has its own set of properties that only occasionally overlap with obsolete
HTML attributes.

There is no such property as 'align' in CSS. You are looking for the
'float' property. If a browser does anything with an align property, then
it's proprietary behaviour that will not work across multiple browsers.

<p>
<img src="..." alt="..." />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus ornare,
justo vitae faucibus ornare, est enim pretium elit, in hendrerit tortor
purus ac dolor. Class aptent taciti sociosqu ad litora torquent per conubia
nostra, per inceptos hymenaeos. Ut et nisl. Fusce sed erat. Proin ut est eu
arcu interdum volutpat. Vestibulum nibh velit, congue nec, sodales vel,
faucibus eu, magna. Cras odio quam, adipiscing nec, luctus eu, pellentesque
nec, urna. Integer feugiat, velit et ultrices tempus, sapien erat molestie
dolor, id pretium felis justo ac lectus. Cum sociis natoque penatibus et
magnis dis parturient montes, nascetur ridiculus mus. Fusce nec erat. Nam
euismod tortor eget urna. Praesent vestibulum.
</p>

img {
float: right;
}


Jul 20 '05 #4
Before doing anything else, please fix the wrapping in your newsreader.

Ted Mencini wrote:
When I replaced older <IMG ALIGN=RIGHT ...> tags with a CSS
definition

<IMG class=right ...>
not the best choice for a class name.
xxx.css:

IMG.right { BORDER: 0; align: right }

I notice that the effect is NOT the same.
As well it shouldn't, since there is no align property in CSS.
How do I achieve that the text is flowing around the picture as
before ?


Start by reading the manual
http://www.w3.org/TR/REC-CSS2/

or a tutorial
http://www.google.com/search?q=css%20tutorial

If you want text to flow around the image, then you probably want

img {float: right;}

--
Brian
follow the directions in my address to email me

Jul 20 '05 #5
In article <bt************ *@news.t-online.com>,
te*******@hotma il.com (Ted Mencini) wrote:
When I replaced older <IMG ALIGN=RIGHT ...> tags with a CSS definition

<IMG class=right ...>

xxx.css:

IMG.right { BORDER: 0; align: right }
In CSS there is no such thing as the align property.

I notice that the effect is NOT the same. While in the past the text was
flowing smoothly around the picture
on the right side there is now a hard cut: Text, then picture below with
white space on the left and finally
the text continues BELOW the picture.

How do I achieve that the text is flowing around the picture as before ?


img.right { border: 0; float: right; }

--
Kris
kr*******@xs4al l.netherlands (nl)
Jul 20 '05 #6

"Ted Mencini" <te*******@hotm ail.com> wrote in message
news:bt******** *****@news.t-online.com...
When I replaced older <IMG ALIGN=RIGHT ...> tags with a CSS definition

<IMG class=right ...>

xxx.css:

IMG.right { BORDER: 0; align: right }

The style should be:

img.right { float: right; }

and the HTML

<img class="right" other attributes /><p>text goes here</p>
Jul 20 '05 #7
On Sun, 04 Jan 2004 17:14:40 +0100, Ted Mencini wrote:
How do I achieve that the text is flowing around the picture as before ?


Try floating it? (float:right)

--

..

Jul 20 '05 #8
te*******@hotma il.com (Ted Mencini) wrote in
news:bt******** *****@news.t-online.com:
When I replaced older <IMG ALIGN=RIGHT ...> tags with a CSS definition

<IMG class=right ...>

xxx.css:

IMG.right { BORDER: 0; align: right }

I notice that the effect is NOT the same. While in the past the text
was flowing smoothly around the picture on the right side there is now
a hard cut: Text, then picture below with white space on the left and
finally the text continues BELOW the picture.

How do I achieve that the text is flowing around the picture as before


float: right
Jul 20 '05 #9
Ted Mencini wrote:
When I replaced older <IMG ALIGN=RIGHT ...> tags with a CSS definition

<IMG class=right ...> [snip] IMG.right { BORDER: 0; align: right }
I wasn't aware of an "align" property!

I use a style such as:

img.right { float: right; }
I notice that the effect is NOT the same. While in the past the text
was flowing smoothly around the picture on the right side there is
now a hard cut: Text, then picture below with white space on the left
and finally the text continues BELOW the picture.

How do I achieve that the text is flowing around the picture as
before ?


I lied about the above (for simplicity). What I really use is something like:

img.right { float: right; margin: 0.5em 0 0.5em 1em; }

This pushes the image to the right as far as it can go, but leaves some space
around it.

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2346
by: Gianpiero Colagiacomo | last post by:
VBScript: Can anyone help me figure out why the image within this IF statement shows as a place holder rather than the image itself when the statement is returning true? If I remove the IF the image shows... <% If (events.Fields.Item("picURL").Value) <> "" Then
15
3091
by: Philipp Lenssen | last post by:
My friend has the following problem (background: we want to transform XML to XHTML via XSLT): "We copy XHTML fragments into an output by using the following template: <xsl:template match="*" mode="xhtml"> <xsl:element name="{local-name()}"> <xsl:copy-of select="@*"/> <xsl:apply-templates mode="xhtml"/> </xsl:element>
7
2625
by: Zhang Weiwu | last post by:
Hello. This is problem puzzled me a long time. I wish to organize some block elements and let them flow one after each other like text. Think about a album, I wish the album have 12 thumbnails, each one has a comment line under the picture. And I wish when the screen size is big, this thumbnails arrange 3 rows, 4 columns; if the browser window is smaller, arranges 4 rows, 3 columns; if it's even smaller, 6 rows with 2 columns. If there...
2
3039
by: btfbg | last post by:
I am using Response.ContentType = "application/msword" Response.AddHeader "Content-Disposition", "attachment;filename=Letter.doc" to download my asp page to the client. The download process works great but when I open the .doc file it is missing the image included within the html <img> tag of the .asp page. How do I get the image to come down with the text? If someone could help me out it would be greatly appreciated. here is the image...
3
5442
by: Henry Johnson | last post by:
Okay - I'm spinning my wheels on this one... can someone help me figure out how to programmatically populate a table cell as follows (from C# code-behind)? I've tried using a Literal control in the TableCell, a HyperLink control, and an Image, but I'm not getting the results I want. Here's the source of what I'm after (retrieved by viewing the source of a page I'm trying to emulate): <td><a...
2
1689
by: R.A.M. | last post by:
Hello, (sorry for my English...) Could you help me please with one asp.net problem? I am beginner... I am writting simple Demo .NET application. On start page I have: <h1>Demo .NET</h1> <br /> <p style="vertical-align: middle;"> <img src="App_Data/DotNet_360x280.jpeg" alt="Microsoft .NET
4
4262
by: manu3d | last post by:
Hi everybody, I'm using the event "onload" to trigger a function when an image has been preloaded. But it seems to me that the function is triggered right at the beginning of the transfer from remote to local rather than at the end of it. Can anybody confirm this? Thank you.
4
9072
by: SammyBar | last post by:
Hi all, I wonder is it possible to upload the content of an <imgfield to a server. The content of the <imgwas downloaded from a web site different from the one it should be uploaded. The image file should not be saved locally before uploading. It should not be visible any <input type=file on the form. How can it be done? I'm working on a project where client javascript requests an image server to generate dynamic images. The client...
6
5321
by: terry13 | last post by:
Hi there, This code is working fine in IE7 as submit button for the search form, but not in Firefox. Any ideas why. <img src="../../Images/Go.jpg" width="45" height="20" align="absmiddle" style="Cursor:Hand;" onClick="funcSearchUsers();"> Thanks.
4
1978
by: bgold12 | last post by:
Hey, I've come across a strange behaviour that shows itself in IE 7.0 and Firefox 3 and probably other browsers. In the code below, which is a complete HTML document which validates as XHTML 1.0 Strict, I display an image named Images/DivLine1.jpg (which is a simple 1x5 pixel blue line) inside two divs across 100% of their width, the first of which has 50px height and the second of which has 100px height. In both cases, I set the image...
0
8710
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8497
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7310
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4299
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2721
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1928
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1598
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.