center

How To Center A CSS Drop Down Menu [closed]

[亡魂溺海] 提交于 2019-11-30 21:06:58
I'm in need of some help. I have a CSS dropdown menu but i want the titles to be centered so on all screen sizes it would be in the middle, as at the moment its stuck to the left. http://jsfiddle.net/y4vDC/ Any help would be greatly appreciated. Here is a bit of the HTML code: <div id='cssmenu'> <ul> <li><a href='events.html'><span>Events</span></a></li> </ul> replace this css with what you have for #cssmenu > ul > li: #cssmenu > ul > li { display:inline-block; margin-left: 15px; /* This is when the drop down box appears */ position: relative; } and add this to your css codes: #cssmenu > ul {

How do I open a JInternalFrame centered in a JDesktopPane?

孤街醉人 提交于 2019-11-30 20:33:13
I am adding a bunch of JInternalFrame s into a JDesktopPane , as the user selects to open various features through the menus. But I would like the internal frames to open centered in the desktop pane, as opposed to the upper left, where they seem to default. How can I specify that the JInternalFrames open centered, or move them to the center after opening? jDesktopPane.add(jInternalFrame); // jInternalFrame is not centered! For reference, here is the solution I used, based on dogbane's advice: Dimension desktopSize = desktopPane.getSize(); Dimension jInternalFrameSize = jInternalFrame.getSize(

ios: programmatically ask for Game Center sign-in?

女生的网名这么多〃 提交于 2019-11-30 20:12:15
I have a simple question, but I’ve looked through Apple’s documentation and done some searching and I can’t find the answer to it. Is it possible to programmatically pull up Game Center’s sign-in view? I have a UIButton that requires Game Center, and if the client does not sign in when the app is opened (iOS pulls up the sign-in view at launch), I want to provide a second chance for the user to sign in. I'm assuming you're calling this GKLocalPlayer method on launch: -setAuthenticateHandler: (>= iOS7) or -authenticateWithCompletionHandler: (<= iOS6) If the user cancels the presented login

Grey area in Google maps

纵饮孤独 提交于 2019-11-30 20:02:58
I have implemented Google maps in my app (in a modal), however as you can see on the images below there is a grey area that I of course want to get rid of. It is possible to move the map so that the grey area disappears, but that shouldn't be needed. Thing is that the map is shown inside a modal box, which contains of a lot of content that's dynamically created when the button for showing the modal is clicked. It seems that the problem could be that the map content isn't fully loaded before the modal is loaded, but I'm not sure... html: ... <div id="myModal" class="modal hide fade" tabindex="

Div height doesn't adjust to fit content

∥☆過路亽.° 提交于 2019-11-30 18:34:12
问题 How can I center a div horizontally and vertically and adjust height to fit content? fiddle Here is my html code: <div class="sprite"> </div> <div class="content"> <span>close</span> <div class="centered"> lorem lipsum..... </div> </div> And css: .sprite{ position: fixed; left: 0px; top: 0px; z-index: 20; width: 100%; height: 100%; background-color: gray; opacity: 0.6; } .content{ border:1px solid red; z-index:21; position: absolute; margin:auto; padding:10px; left: 0px; top: 0px; bottom:0px;

Self resize and center a window using javascript (no jquery) on page load

a 夏天 提交于 2019-11-30 14:50:40
This is not something we'd normally do but we're trying load a video into the blank window opened by a clickTag (from a banner ad) - and make it feel like a modal window as much as possible. Is it possible to use javascript to self-resize the blank window opened by the clickTag and center it on the screen? We can't apply anything to the link that is clicked so... Everything has to self-run as the page loads If possible, it would be nice to not see the browser tabs and address bar We're not loading jquery Are browser security alerts a potential problem? Essentially the user clicks to watch a

Center image vertically and horizontally inside of DIV with float:left?

独自空忆成欢 提交于 2019-11-30 14:45:06
I need a working solution to do a trival task of centering images with different dimensions, to a square div when float:left is used to place images in rows.I use div inside of div to do the trick : .outer-element{ //wrap tile div display:table-cell; width:300px;height:300px; text-align:center ; vertical-align:middle ; float:left; margin-bottom:15px; } .inner-element{ //div with image inside display:inline-block; } BUT I must use use float: left for outer-element to put images into rows and when I do images are not centered vertically (they are aligned to top border of the div) I tried some

Center Crop an Android VideoView

谁都会走 提交于 2019-11-30 14:35:28
问题 I am looking for something like the CENTER_CROP in ImageView.ScaleType Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding). The image is then centered in the view. From XML, use this syntax: android:scaleType="centerCrop" but for a VideoView. Does anything like this exist? 回答1: You can only achieve this with a TextureView. (surfaceView won't

Zooming in JavaFx: ScrollEvent is consumed when content size exceeds ScrollPane viewport

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 13:40:30
I have an application that requires zoom inside a ScrollPane, but with my current approach I'm still facing 2 challenges. In order to replicate the problem, I have written a small application ZoomApp that you will find the code for underneath. Its' limited functionality allows zooming in and out (using Ctrl + Mouse Wheel) on some arbitrary shapes. When the zoomed content grows outside the bounds of the window, scroll bars should apperar. Challenge 1. When the scroll bars appears as a consequence of innerGroup scales up in size, the ScrollEvent no longer reach my ZoomHandler. Instead, we start

Get Location From Center of Screen Swift MapKit

僤鯓⒐⒋嵵緔 提交于 2019-11-30 09:54:24
I'm new on Swift Programming, and I'm trying to build an app that I can get the coordinates of the center of the view with MapKit and Swift 2. I already can get the current location, but I need if I move on the map, the location set to the new point which will be the center of the screen. Can you help me with this please?. Regards, You can use the regionDidChangeAnimated delegate method and call mapView.centerCoordinate. It will look like the following: func mapView(mapView: MKMapView, regionDidChangeAnimated animated: Bool) { var center = mapView.centerCoordinate } Also make sure that your