473,378 Members | 1,527 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,378 software developers and data experts.

How do you position an image

1
i Just wanted to know because I have so much trouble. plz help.
Jul 11 '06 #1
7 422360
sashi
1,754 Expert 1GB
Hi there,

there are few methods to do it.. i.e. using external .css file, inline style

Here's the code I used to place the image at that specific plot point:
Expand|Select|Wrap|Line Numbers
  1. <IMG STYLE="position:absolute; TOP:35px; LEFT:170px; WIDTH:50px; HEIGHT:50px" SRC="circle.gif">
  2.  
Here's What's Happening

IMG denotes that this will be an image.
STYLE= proclaims what will follow are style commands.
position:absolute; states that the image will go exactly where I say it will. If text or another picture is already there -- tough. This will go right over top of it. That is one of the drawbacks to this positioning stuff.
TOP:35px;LEFT:170px; These are the plot points for the image: 35 pixels down from the top and 170 pixels in from the left.
WIDTH:50px;HEIGHT:50px This is the height and width of the image itself.

Notice the semicolon between each section.. good luck my fren.. :)
Jul 11 '06 #2
Banfa
9,065 Expert Mod 8TB
The absolute positioning that sashi sugests should work, however it has some drawbacks, when you use absolute positioning the item postioned comes out of normal document flow. Normal document flow is how the browser positions everything automatically, when the image is no longer in normal document flow the browser will just ignore it as far as deciding where to position everything else.

The effect of this is if the image is embedded in some text, for instance, then when you absolutely position the image the text will just flow behind (or infront) of it, it will not go round it.

Another method of positioning an image (or anything else for that matter) is to float it, you can float it on the left or right like so

[html]<img style="float: left;" src="circle.gif">[/html]

A floated image appears on the left (or right) hand edge but it remains in normal documnet flow so the text it is in would flow round the image.

It is hard to give more advice with more information about what you are trying to achieve.

Finally using the inline style attribute as both sashi and I have done is bad form, you can have your styles in a section at the top of the file or in a separate file (recomended). This however is a CSS question, I would recomend a basic tutorial on CSS which will tell you about this.

http://www.w3schools.com/css/css_howto.asp
Jul 12 '06 #3
sashi
1,754 Expert 1GB
Hi Banfa,

thanks buddy.. now am a little clear about absolute positioning.. take care :)
Jul 12 '06 #4
If you want to be really simple, you can use:

<img src = "picture.jpg" align = right>

img src says what image you will insert and align = right will put it all the way to the right of the screen and text will wrap around it. Like I said, it is a simple way to do it and very limiting on options. Align can also take the values of left, center, top, middle, and bottom. Top, middle, and bottom have a different effect. Try them out and you'll see.
Jul 18 '06 #5
If you use

position:relative;

rather than absolute, it will place the image relative to where you are in the document. This is useful for doing things like embedding an image of the text of an e-mail address so the spam bots can't find what it is.
Oct 8 '10 #6
drhowarddrfine
7,435 Expert 4TB
Another post of Christmas past.
Oct 9 '10 #7
Nevo
1
I have tried to get a cookie image to align with the text in my menu, but can't seem to get Align = middle (or any other Align=) to work. Any suggestions?
The site is in danish, but you can se the image and the text in the upper right corner of the page (in the menu to the far right) here Personligpower.dk .

The code used is: <img src="/wp-content/uploads/2016/10/iconbig.png" align=middle style="width:30px;height:25px;">
I did try using: align="middle"

Kind regards
Nevo
Oct 9 '16 #8

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

Similar topics

1
by: Lam | last post by:
hi i have a problem with position of image i use this code in a "alert" function : document.getElementById("lienx").offsetLeft + " , " + document.getElementById("lienx").offsetTop with : ...
3
by: Tom | last post by:
I have a picturebox on my VB.NET form. The picturebox size mode is set to stretched. I then load an image into that form and display it. As the user moves the mouse over the form, I want to get and...
3
by: edouard.lauer | last post by:
Hello, i've a table generated by PHP which contains about 300 entries. On each row you've a link that is a reference to a picture. I want to show the image on the same document based on the...
7
by: Dan | last post by:
Hi, What is the best way to set up a "Note block" on a web page with CSS. This should consist of a colored box that contains an image on the left, and left-justified text floating to the right. ...
2
by: Dale | last post by:
This seems like it should be simple and I am pretty sure I've done similar things a hundred times before but I sure can't seem to get it right this time. I have a GridView with a column of text...
6
by: Seth Illgard | last post by:
Hi, Im writting a custom CMS and everything looks great, except when I see the results in IE. What im trying to do is: *Have an image in a layer (or relative positioned, or just margined). The...
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...
1
by: nwtreasuretrove | last post by:
I need help moving my banner image to the very top, can someone please help? Mark
3
by: NKTA | last post by:
Hello again. I have a doubt in how to obtain the position of an image in a table cell. What i want to do is: - Find the image position, and add a new image on top of that image. The...
1
by: munkee | last post by:
All, I am trying to place an image overlayed on top of another div. My knowledge of html and css is quite basic and I am currently using the script editor within access 2003 (creating a data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.