Software, your way.
How To Get Good Custom Software
(Download)
(PDF)
burger menu icon
WillMaster

WillMaster > LibraryWeb Page and Site Features

FREE! Coding tips, tricks, and treasures.

Possibilities weekly ezine

Get the weekly email website developers read:

 

Your email address

name@example.com
YES! Send Possibilities every week!

Fixed Position Image

I'll show you how to place an image within the browser window that stays in position even with page scrolling.

Generally, this would be a small image at an edge of the browser window. But it can be any size image and the image can be positioned at any location within the window.

Although out of scope for this article, coding can be done to link the image to another page, to give it mouseover functionality, or even to switch the image like a slideshow.

Placing the image is done with HTML and CSS. Here is example code:

<div style="position:fixed; left:0; top:200px;">
<img src="https://www.willmaster.com/images/wmlogo_icon.gif" alt="Willmaster logo">
</div>

That code will place the Willmaster logo along the left edge of the browser window, 200 pixels down from the top-left corner.

To customize the feature for your own web page, make these changes to the above code:

  1. Replace left:0; top:200px;" with the position for your image.

    The edges top, right, bottom, and left may be used to specify a position. Generally, either left or right is used and also either top or bottom.

  2. Replace the red colored URL with the URL to your image. You may add CSS for your image, such as dimensions width and/or height.

When you place your image in its position within the browser window, it will stay there so long as your web page is being viewed, even when your page is scrolled.

(This content first appeared in Possibilities newsletter.)

Will Bontrager

Was this article helpful to you?
(anonymous form)

Support This Website

Some of our support is from people like you who see the value of all that's offered for FREE at this website.

"Yes, let me contribute."

Amount (USD):

Tap to Choose
Contribution
Method

All information in WillMaster Library articles is presented AS-IS.

We only suggest and recommend what we believe is of value. As remuneration for the time and research involved to provide quality links, we generally use affiliate links when we can. Whenever we link to something not our own, you should assume they are affiliate links or that we benefit in some way.

How Can We Help You? balloons
How Can We Help You?
bullet Custom Programming
bullet Ready-Made Software
bullet Technical Support
bullet Possibilities Newsletter
bullet Website "How-To" Info
bullet Useful Information List
software index page

© 1998-2001 William and Mari Bontrager
© 2001-2011 Bontrager Connection, LLC
© 2011-2024 Will Bontrager Software LLC