473,657 Members | 2,426 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 2680
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:absolu te;
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:fixe d;
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
6830
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 the file compatible for both 1024*768 and 800*600 resolutions. I don't want to change all the files to include an alternate css. Can i write some javascript conditions in the css files to change the class definitions based on resolutions. I am not...
4
6895
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 <td>, but I don't see how to have the image shrink. Without JavaScript, the standard seems to be scrollbars when the browser shrinks. I'd like the picture to shrink in size and avoid the scrollbars.
3
1284
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 ImageFormat.Gif, my browser (Internet Explorer 6.0) wants me to save it as a *.bmp file. The VB.NET line of code that I use to send the image to the browser is: textbitmap.Save(Response.OutputStream, ImageFormat.Gif) Why is my browser forcing me to save...
7
7181
by: gagansingh | last post by:
guys, I really want to know how i can process images in c++ (.bmp)
1
4746
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 change the scale such that image can fit inside it. If device is screen then my image gets scaled properly and fits inside the viewport area. But if my device is printer then my image gets scaled properly but it doesn't fit inside the viewport...
8
2141
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 writing the file to a temp file and using html to load the temp but seems like a waste of cycles and space ;/ Anyway around this? Thanks,
2
2767
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 : "div.layout_img img" The image size is unknown I have tried to use the "margin:0px auto;" method with no success. I include the code here
4
4096
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 browser regardless of the end user's chosen resolution.. is this possible? below is my html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html...
6
4404
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 performing a simple algorithm... public Bitmap RotateFlip(Bitmap source, RotateFlipType change) { Bitmap dest = new Bitmap(source.Size.Width, source.Size.Height); int MaxWidthIndex = source.Size.Width - 1;
2
4460
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 becomes narrower than the background image, the latter moves to the left and eventually out of the screen, while the rest of the tables and images remain lined up and stop moving once the left-hand edge reaches the edge of the screen. The...
0
8402
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
8315
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8508
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
8608
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
6172
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
5633
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4164
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4323
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.