473,503 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how image can be vertically centralized in browser in any resolution.

1 New Member
Please if find any one...
Feb 14 '11 #1
3 2665
Ashwani Sharma
46 New Member
I've static solution for this, means if you know the size of your image which you want to centralized. suppose your image size is 200px, you can use this css:

.abc{
position:absolute;
float:left;
height:200px;
top:50%;
margin-top:-100px;
}

this will work for your problem if there is static images but if the images will come dynamically then you have to use this same css calculation using JS or any other development tool.

Regards,
Ashwani Sharma
Feb 14 '11 #2
NetDynamic
27 New Member
or just div it with margin:auto;

for a background just add:

background-attachment:fixed;
background-position:center;
Feb 20 '11 #3
Markus Igeland
14 New Member
NetDynamic: That's the best solution for centering something horizontal, and doesn't work when you want to center something vertically.
Feb 22 '11 #4

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

Similar topics

12
6818
by: techie | last post by:
Hi All, I have a portal working on an intranet for a company. The portal was designed keeping in mind the resolution of 1024*768. I am including a ..css file in all the files. Now i have to make...
4
6886
by: Bob Richardson | last post by:
Is it possible for an image to SHRINK (both height and width, keeping same h/w ratio) when the browser's width is reduced? It's easy to have both h & w increase, as needed, to fill up 100% of the...
3
1274
by: Nathan Sokalski | last post by:
I am using ASP.NET, VB.NET, and GDI+ to dynamically create images for webpages. When I right-click on the dynamically created image to try to save it to my hard drive, which I send as...
7
7174
by: gagansingh | last post by:
guys, I really want to know how i can process images in c++ (.bmp)
1
4738
by: jalpa11 | last post by:
Hi all, I have one EMF image which I want to convert to BMP. I want to scale the BMP and want to display it in my viewport area. If scaled BMP doesn't fit inside the viewport area then I want to...
8
2130
by: Jon Slaughter | last post by:
can one "stream" image data to a browser? I created an image using gd and when I do imagepng I just get the binary data for the image written as text instead of the image itself. Now I'm...
2
2751
by: jerrygadd | last post by:
Can some body help me vertically center an image using CSS? The customer only uses IE, and so the code is not debugged for other browsers! The image in question is found on line 1075 :...
4
4079
by: studentofknowledge | last post by:
hi guys .. I was wondering if someone could offer some guidance with regards to a web page positioning? I would like to position my web page or main div container to appear in the middle of a...
6
4395
by: shailendrab | last post by:
Hi, I have been trying to flip an image vertically before saving in disk in AVI format. I really dont know why i need to flip it first before saving, any idea? To do this currently i am...
2
4450
by: James Stevenson | last post by:
The website I am working on looks fine so long as the browser window is as wide or wider than the width of the background image. But as soon as I re-size the browser window down to the point where it...
0
7204
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,...
0
7464
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...
0
5586
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4680
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3162
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1516
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 ...
1
741
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
391
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...

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.