center

How do I center (vertically and horizontally) buttons in a div tag?

I am trying to determine how to center (vertically and horizontally) buttons in a div tag. Given the following CSS: div.listBoxMoverUserControl { width: 350px; height: 175px; } div.listBoxMoverUserControl div { height: 150px; } div.listBoxMoverUserControl div select { width: 150px; height: 150px; } div.listBoxMo...

How should I create an algorithm for the centroid of any System.Windows.Media.Geometry object?

I plan on having to split up the Geometry object into a series of simpler shapes, and combine their centroids using this formula: Mathematical details of this formula can be found in this Wikipedia article. NOTICE: Don't be suprised if my view of the mathematics is incorrect. I haven't done any complex math past trigonometry, and I'v...

center image in a div too small for it?

So I have a div in my body that's a percentage width, and inside that a div with inline style as follows: text-align: center; margin-left: -15px; margin-right: -15px; overflow:hidden As you can see, I have text-align center on, which would, if the image was small enough for the div, center the image. But the percentage width div is de...

How to center a string in elisp?

I would like to center justify a given input string to a given size so that what is produced is a string with padded spaces either side (left and right) of the input string. The code I have to do this: (defun center-string (string size) (let* ((padding (/ (- size (length string)) 2)) (lpad (+ (length string) padding)) ...

html - div on the centr

Hello, how can i set div position at the center of the page with size, for example, 80%/80%. UPD: margin: 0 auto; works, but only for horizontal alignment. And i also need vertical. ...

HTML: Making a link lead to the anchor centered in the middle of the page

I have a link to an anchor on my html page. When the link is clicked it causes the page to scroll to the anchor so that the anchor is at the very top of the visible part of the page. How can I make the page scroll so that the anchor will be in the middle of the page? ...

How can I get the current zoom level in a UIScrollView?

In an attempt to create a workaround for centering an image in a UIScrollView and make it behave as Apple's Photos app does, I need to get the current zoom level and use the number to calculate the amount the image should be inset at each zoom level. (Note: I am aware that some programmers are centering an image in a scrollview by cent...

CSS: Equal height divs without margin hack

Can you make two divs have equal height without 1) margin hacks because then I can't have a border : margin-bottom : -500px; padding-bottom : 500px; 2) Javascript because then there is flicker on the page for non-cached users. 3) Fixed height because then I can't add more content dynamically. It is for this page http://www.stdico...

Is it Possible to Center Content in a UIScrollView Like Apple's Photos App?

I have been struggling with this problem for some time and there seems to be no clear answer. Please let me know if anyone has figured this out. I want to display a photo in a UIScrollView that is centered on the screen (the image may be in portrait or landscape orientation). I want to be able to zoom and pan the image only to the edg...

flex 3 component using x y as center, not topleft

Hi, How can I extend components like buttons to use x and y value as the center of the component, not the top left? Thanks, Jean ...

Centering a Page issue

Ok, lets see if i can explain this. My page content has a width of 960px. It is centered in another div that has a width of 1426px (#siteWrap). #siteWrap{ margin:0px auto; width:1426px; background: url(../images/bg.jpg) no-repeat ; } What i need to find out is how to get #siteWrap to center on a page regardless of screen resolutions. ...

Center a xul dialog to screen

In a dialog, I resize some images and then force the window to sizeToContent. Then, I want the dialog to center itself to the screen. How can I do this? ...

Vertical aligning an absolute positioned div inside a containing div

I'm using the jQuery Cycle plugin to rotate images in a slideshow type fashion. That works fine. The problem I'm having is getting these images (of different sizes) to center in the containing div. The images are inside a slidshow div that has it's position set to absolute by the Cycle plugin. I've tried setting line-height/vertical-ali...

Center wrapped text around float

Hi, I have a site with a parent element that contains a right-floated image and a content div that wraps along and below it. I'm trying to center certain elements in the content div, but am having trouble getting non-IE browsers to recognize the available width. In other words, if I give the object a percentage width like "70%", non-IE ...

svg: center of path

Hi I'm trying to draw a label on a polygon of an svg file. The problem I'm facing is to find out roughly the center of this polygon to place the label, as the path's coordinates are in svg format and need to be parsed. Is there an easier way to determine the center of an svg polygon (maybe someone can point out a javascript library or a...

How to align the jquery maphilight to center?

Hi guys, yes i know how silly and dumb this question is, but i have been looking around and i can't find how to align the image so that i can position it in the middle for the excellent jquery maphilight, what i found is after the class="map" is applied to the image, it will automatically shift to the left. i can find any options to se...

Centering Content in Flex 4

Hi, I'm building a custom component that extends SkinnableContainer. I can center the content either vertically or horizontally inside it, but not both-- and that is what I need. I'm setting the layout to HorizontalLayout for the component and setting verticalAlign to middle. Then I'm creating a canvas to surround another component th...

Why is the <center> tag deprecated in HTML?

I am just curious as to why the <center> tag in HTML was deprecated. The <center> was a simple way of quickly center-aligning blocks of text and images by encapsulating the container in a <center> tag, and I really cannot find any simpler way on how to do it now. Anyone know of any simple way on how to center "stuff" (not the margin-le...

Centering float left div's in the body

hello guys! i have this piece of code <body> <? while.. (blah blah blah){ ?> <div class="product"> something </div> <? } ?> </body> and the css file is .product{ width:350px; float:left; } the problem is that body doesn´t have a width, well... actually it has, 90%, but my problem is on t...

Center Gtk.Dialog on Gtk.Window in Gtk# on Windows

Hi, I have a Gtk Dialog which should pop up over my applications main window. I tried the following: dialog.TypeHint = TypeHint.Dialog; dialog.Parent = applicationMainWindow; dialog.TransientFor = applicationMainWindow; dialog.SetPosition(WindowPosition.CenterOnParent); In any combination I could think of. Nevertheless, when callin...