473,387 Members | 1,347 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Image Left Align Error

228 100+
Hi,

This thing that might simple is really drivin me crazy. I have a small image that i want to align to the top left and the text would revolve around it. It seems to work in IE but not in others. In opera,mozilla and safari, the image doesn't start at top. Instead, there is a paragraph or so on top of it. The image and the text are located within the same div. Here is my code:

Expand|Select|Wrap|Line Numbers
  1. <div>
  2. <img src="d.jpg" id="leftalign"> Content goes here content goes here
  3.  
  4. </div>
  5.  
  6.  
The css code:

Expand|Select|Wrap|Line Numbers
  1. #leftalign {float:left;width:150px; height:152px; margin: 0 15px 15px 0;}
  2.  
  3.  
i have tried clear:both and display:block but nothing changed. what am i doin wrong here?
Mar 27 '10 #1
4 2128
drhowarddrfine
7,435 Expert 4TB
The rule is this: if it works in IE but not Firefox/Opera/Safari/Chrome, then your markup is wrong. Never, ever trust IE to do anything right.

The text should continue on to the end of the line and the screen. There's not enough text in your example to make it wrap around but, if you wish, just change the width of the div to make that happen and then it will also wrap around the image.

I don't have IE with me right now but who knows what it will do.
Mar 27 '10 #2
samvb
228 100+
Hey,

The text i included in the e.g. is just an e.g. other wise it is a full page text in my site. Sorry but could you please paste kinda of a complete code?
Mar 28 '10 #3
drhowarddrfine
7,435 Expert 4TB
To be sure, I used your markup as is and added 12 paragraphs. The text properly wraps around the image in all the modern browsers: chrome/opera/firefox.
Mar 28 '10 #4
Hi Samvb,

I totally agree with Drhowarddrfine with his views. The CSS code you are using doesn't have any error but if it not working with modern browsers then it could be markup problem with your document. Please let yourself know first that you are using the same markup code which is compatible to all modern browsers.
Mar 30 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Markus Mohr | last post by:
Hi, everyone, I have a special problem: For every monitor resolution in 200 pixel steps from 800 to 1600 pixels I have an image to be shown as centered background-image. Those images all...
8
by: Cardman | last post by:
I am hopeful that someone can quickly solve my image alignment issue when things are just not going right and where my attempts to solve this alignment issue have all failed. First of all take a...
2
by: Eugene Anthony | last post by:
I am having a problem with this code. The problem I am facing is that the first image is displayed in its original size. But when I click the next button, the next image not displayed in its...
1
by: rsteph | last post by:
I've got some product information pages, with images and text, all setup within a table. I'm trying to add a small image in the upper right hand corner of the content div (where all the important...
4
by: yatin | last post by:
hi, friend. i have a problem in image validation plz check it. i have to include a image validation in foam 1. but i sending a details through form2. But when i include a image validation in foam1,...
1
by: swc76801 | last post by:
I desperately need help. My understanding of CSS is non-existent. I have a store http://astore.amazon.com/texasheat-20 with Amazon.com. According to the information from Amazon.com "Write your own...
4
by: mukeshrasm | last post by:
<table width="85%" height="32" border="0" align="left" cellpadding="0" cellspacing="0"> <tr valign="bottom"> <td width="21%" align="left" valign="middle">Caption1</td> <td...
1
by: sravani1 | last post by:
This code runs like when i submit the form it takes the image and displayed and top of the image a map will displayed. But actually i want that when i give the image it checks the location in the map...
3
by: premprakashbhati | last post by:
hi, good evening.. i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button() here is the code ...its work fine...
2
by: studentofknowledge | last post by:
For some unknown reason ie is placing images I have in a div in a weird way. One image is overlapping another but this problem is not occuring in mozilla. I have looked at my code over and over again...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...

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.