473,543 Members | 1,934 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

centering vertically


Is it possible to center a div vertically without knowing the exact
height of the div?

Jul 20 '05 #1
2 1762
As far as I know -

margin-left:auto; margin-right:auto;

Hope this helps,
Jul 20 '05 #2
Timo Nentwig wrote:

Is it possible to center a div vertically without knowing the exact
height of the div?

Yes. Which div?


Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
I'm looking for work | Etsin työtä
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: George Ziniewicz | last post by:
.. I try to use CSS when possible, though I am still learning and don't maximize its use. In particular, I still use a table to provide for a centered image in a few slideshows (though table vertical align doesn't work in Mozilla): http://zintel.com/homepics.html I've used combinations of <center>, style align 'center', table cell...
by: CMAR | last post by:
To center my <div>, I am currently using something like <div id="navcontainer" align="center"> This centers fine, but is deprecated code. I have seen these two solutions recommended. 1) body { text-align: center; min-width: 500px;
by: Aaron | last post by:
Hi, I have a div with an image inside it. The image needs to be centered in the div. I thought I could do this by setting the image's margin to "auto auto", but it seems to do nothing. What am I missing here? Thanks, Aaron P.S. Here are the exact styles I'm using:
by: Kenneth | last post by:
Okay, I've been scouring Google for hours looking for a solution to this problem, but as of yet I can't find one. XHTML Transitional seems to specify that I can no longer set a table's height to 100% and vertically center content inside of it. Therefore, I'm seeking a way, preferably in CSS to vertically center a site. Here's more of a...
by: Daniel Kaplan | last post by:
Hi All, Am trying to vertically center a table, and failing miserably at it. Have tried everything with this: <table border=1 width=100% valign=MIDDLE> taking out width, etc. I just can't get the table to be centered.
by: Robert Latest | last post by:
Hello, me again. This time I'd like to align a DIV both horizontally and vertically centered within a larger DIV. The only alignment-relevant CSS property I could think of was text-align, and that didn't work. Of course I could put the DIV into a one-cell table and use the td's align and vertical-align attributes, but let's assume I...
by: anonymous | last post by:
I have created a DataGrid control with checkboxes, TextBoxes, ComboBoxes, and NumericUpDowns. Since I used the DataGridBoolColumn, the checkbox is displayed in the center of the cell, horizontally and vertically aligned. I want the other cells with data to also be centered so that it is congruent with the checkbox. I'm having problems...
by: Jerry Camel | last post by:
I want to center an image on the screen and have text centered over the image. What's the best way to do this? I've been playing with style tags and I can get the stuff to center automatically OR have the text appear on top of the image. But in the second case, the image and text aren't centered properly. Any help is appreciated... ...
by: John Pote | last post by:
1. Horizontal centering a <divin browser window. The current trend seems to be to place page content in a fixed width area in the middle of the browser window. How is this achieved? If I use a top level <divthen I can place it with CSS attribute 'left:', but this is a fixed offset. Is it possible to have a <divcentered in the browser window?...
by: Markus Ernst | last post by:
Hello This is a test example: http://www.markusernst.ch/anthracite/ http://www.markusernst.ch/anthracite/living_divani.html After googling and experimenting for several hours, I ended up doing this demo with tables. The main problems are the vertical centering of the info area, and of the text inside the squares.
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...
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...
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
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...
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...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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...

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.