473,770 Members | 1,629 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Position fixed image different screen resolution

170 New Member
Hi,

I have a 314 x 190 png which I want displayed basically halfway between the end of some form fields and the side of the #wrapper. So I put it in a div
Expand|Select|Wrap|Line Numbers
  1. <div style='position:absolute;left:45%;top:50%;'>
  2. <img src=images/front1.png border=0>
  3. </div>
which looks great on res 1280 x 1024, 1200 x 800, 1200 x 768, 1152 x 864

It's pushed to the right on 1024 x 768 and 800 x 600
It's pushed way left on 1600 x 1200

Two questions:
1) Which screen res are the important ones to get right?
2) I thought % would take care of the problem but I clearly don't uinderstand css enough. What do I need to change to have the image stay in the same position?

Many thanks for any answers
Jun 21 '09 #1
5 15750
drhowarddrfine
7,435 Recognized Expert Expert
Get a quicker answer
Jun 21 '09 #2
Skeer
6 New Member
Try putting the div outside of any parent with restricted widths then adding "margin: auto auto;" Which makes the div have auto left and right margins. In other words, centered. Try removing the right and left positions and play around with the "position" style. Make sure the div width is set to image width.
Jun 21 '09 #3
beary
170 New Member
@drhowarddrfine
Skeer, thanks heaps for your answer. It gives me something to try. It hasn't totally solved it, but it gives me something to go on. Much appreciated.

Drhowardfine, taking into account your 5,197 posts and the fact that you're designated an expert, your answer didn't help. I posted code. And I'm fairly sure that the answer to my 1st question (take another look) is not found on the page you linked to. Honestly, I appreciate the fact that you've made a lot of posts, but would it be possible to try and provide "answers"? (And please don't flame me, this is a genuine request.)
Jun 22 '09 #4
drhowarddrfine
7,435 Recognized Expert Expert
@beary
And former moderator of this forum.
your answer didn't help. I posted code.
Reread the link I sent you. My first line is "I see these mistakes over and over again." and I'm seeing it again. That's why I created that post and it's been stickied there for years.
would it be possible to try and provide "answers"? (And please don't flame me, this is a genuine request.)
You'll get answers when you provide proper information. Again, reread the link I gave you. That's why it's titled "How to get a quicker and more complete answer." The information you give is not enough to answer the question. We can pass the ball back and forth for quite a while and still wind up with what you did with Skeer:
It hasn't totally solved it
If I'm going to take time to help solve your problem, I don't want to waste it going off in one direction only to find out you didn't have a doctype and that would solve everything with no effort.

The answer to your first question is....there is none. Pick one and someone will argue another, but THAT is not your problem. The problem is you can't get your image in the right place in different resolutions. Fixing that problem maybe makes the first question moot.

So, I provided you with a way to get a quicker better answer by giving more and better information with little to no guess work or minimal back and forth. If you want a lot of back and forth and guessing spread over several days, I'm sure Skeer will help you with that.
Jun 22 '09 #5
beary
170 New Member
@drhowarddrfine
Well I would've included that if I'd known! :)
More stuff you wrote
Fair enough. I see your points.

Actually, I was wrong: Skeer's efforts did solve the problem. I realised the containing div wasn't positioned relative and with his suggestion to margin:auto auto, it stays exactly where it should now in every resolution I can test.

But I completely take your point, as a post of the html and css would have shown you I was missing the position:relati ve.

The answer to your first question is....there is none.
Thankyou.

Fixing that problem maybe makes the first question moot.
Point taken...

So, I provided you with a way to get a quicker better answer by giving more and better information with little to no guess work or minimal back and forth. If you want a lot of back and forth and guessing spread over several days, I'm sure Skeer will help you with that.
Yeah I reckon he would as well :)

Thanks for your further explanations (sincerely). Case closed I think.
Jun 22 '09 #6

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

Similar topics

7
8111
by: tim | last post by:
can someone tell me which function returns the screen resolution in java script?
5
6208
by: Maxi | last post by:
I have a 30X16 cells table in my html page. Table height and width are set to 100%. I have set size of every cell inside the table to 24 pixel. When I open the html page in maximize state in either resolution 800 X 600 or 1152 X 864 it takes up the entire explorer size. In screen resolution 800 X 600, if I insert a pictures of 24 X 24 pixel in the cells it takes up the entire cell size (ideally it should as the cell size is also 24 X...
6
3117
by: Sandy Pittendrigh | last post by:
I have a fishing related site with a billion photos, where 600 pixels as a maximum photo width looks OK at both low resolution and high resolution, but spectacular in neither. Browser stats sites say 37% of all users still use 800x600 resolution. So if you have a site you have to deal with that issue somehow. But compromises piss me off. The pages you make (as php developer) could
4
5906
by: pedestrian via DotNetMonster.com | last post by:
I'm creating WinForm app. I would like to set the form position according to current Screen resolution. So how could I find the current resolution? Thanks... -- Message posted via DotNetMonster.com http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-vb-net/200608/1
35
4161
by: Friendly_Lola | last post by:
What Screen Resolution do You use? 800 X 600 1024 X 768 1280 X 1024 Wow! 1600 X 1200 (i can't imagine this) I use 1024 X 768. For what resolution you optimize your web pages?
7
2475
by: Norman Swartz | last post by:
I want to place some graphic images on the web that are optimally viewed at a resolution of 1024 by 768 pixels. Is it possible, within Javascript,to force a particular screen resolution?
0
2168
Shashi Sadasivan
by: Shashi Sadasivan | last post by:
Hi All, I will start working on a form soon which runs as an mdi container (in the main screen) However there is this "new" requirement, there will be 4 screens, and one of the features of the program is to open child forms (not within the mdi container) but in a totally different screen (as in a second one, not the primary one). Now it is going to be a quad screen system. not even 2. I wrote a small snippet Form frm1 = new Form(); ...
23
3395
by: salmobytes | last post by:
I try to do all css with percents and ems (elastic/liquid) so my displays look as much the same as possible, regardless the user's screen resolution. But I (still) never seem to get what I want. Compromises seem to lurk at every moment. ==========Static html for instance: font-size: 10px; /* looks drastically different at 768 wide compared to 1024 */
6
3035
mikek12004
by: mikek12004 | last post by:
I want to load a different swf in PHP based on the viewer's screen resolution. All would be fine if I could get the screen resolution in a variable in PHP. Problem is that after I done a bit of a digging that this can be only done through javascript(or so most claim) and to pass the resolution from javascript to PHP you would need to refresh the page again (to put the resolution in the URL or in a coockie) The other solution is to use ajax and...
0
9595
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10232
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10008
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
9873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7420
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5454
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3974
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
3578
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2822
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.