[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

Positioning of Graphics

I have two, somewhat related, questions concerning placing graphics on a web page.
1. I would like to place an image at the very top-left of my page, but when I view it in Netscape it appears that there are about 5 or so pixels "border" between the edge of the screen and where my graphic image starts.  (This is not inside a table.)
2. Can I place one image on top of another without resorting to layers?  I'd like to maintain maximum compatibility with older browsers.

Thanks.
0
thartin
Asked:
thartin
1 Solution
 
MasseyMCommented:
1) you can use the CSS positioning <IMG SRC="image.gif" STYLE="left:0;top:0;margin-left:0;margin-top:0;">

2) This will not work with the older browsers... You can only do this with CSS.
0
 
thartinAuthor Commented:
I kinda thought that I wouldn't be able to overlap graphical images without layers.  

Using CSS positioning to nudge my graphic up into the top left corner has the same drawback, however, in that only newer browsers will be able to read it.  Is there no other way (besides frames)?
0
 
thartinAuthor Commented:
< see last comment >
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
jbirkCommented:
There is another way to make it appear in the upper left corner but it too is 4.0+ browser compatible only.  MasseyM has answered the question as best as it can be answered.  (Apparently before 4.0 browsers there were no graphic designers working with the coders of the browsers, because you sure didn't have very much control over the design/layout of the page.)
0
 
sybeCommented:
1. use the image you want to position in the top-left as a backgrund in the body tag. The problem is that it will repeat itself when it's bigger then the doecumtn it is displayed in. So make the image bigger then the page, if you don't want it to be repeated. Disadvantage: lots of kb's.
2. When you use an image as background, you can place another image over it without using layers.
0
 
thartinAuthor Commented:
Thanks for the suggestion, but it won't work for what I'm doing since I already have a different background image.
0
 
tunctCommented:
Face it, I'd say... there is no way to put images without margins in older browsers other than using the background. Bummer...

T.
0
 
GrdvCommented:
1)use this in you body tag
topmargin=0 leftmargin=0 marginwidth=0 marginheight=0
if your using frames then in the frameset you should also specify
framespacing=0
then to place the image correctly, use a table:
<table>
<tr><td valign="top" align="left"><img src="whatver.gif" name="whatever"></td></tr>
</table>

2) then the only posability in older browsers also (NS3) to change the image is to refer to it in javascript and set the source of the object like this
document.images["whatever"].src="whatever2.gif";

I think that should be a reasonable answer??

// Grdv
0
 
GrdvCommented:
oops, forgot to mention that inside the table tag, you should have:
cellpadding=0 cellspacing=0 topmargin=0 leftmargin=0 border=0
that's it...
0
 
thartinAuthor Commented:
Very good!  And to think I was almost about to give up and delete the question!

A couple notes: you don't appear to need the TOPMARGIN and LEFTMARGIN parameters within either the TABLE or HEAD tags for it to work.  You do, however, need all the other parameters included (as per your answer).  And for some reason, this seems to have applied itself to my other tables further down the page, but I'm sure I can get them back to normal.


Thanks!
0
 
GrdvCommented:
TOPMARGIN and LEFTMARGIN is different in different browsers...
and
all those other parameters you can alter anyway you want further down... :)

//Grdv
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now