center

Horizontal Primary and Sub menu is not align center, why?

此生再无相见时 提交于 2019-12-13 08:25:13
问题 I'm building simple site from Drupal but the primary and submenu are not aligned center as it should. I have tried many of CSS3 properties but none of them is working. This is how it structured <div class="nav"> <ul> <li>Primary Menu 1</li> <li>Primary Menu 2</li> <ul> <li>Submenu 2.1</li> <li>Submenu 2.2</li> </ul> <li>Primary Menu 3</li> <li>Primary Menu 4</li> </ul> </div> I want to display both of primary and submenu to be horizontal and align center with CSS3, how can I do that, please

How to make the switch button center in dialog

↘锁芯ラ 提交于 2019-12-13 07:09:40
问题 I want to switch button center in dialog,but it's failed... Why is this? Switch sw = new Switch(MainActivity.this); sw.setTextOn("start"); sw.setTextOff("close"); sw.setGravity(Gravity.CENTER_HORIZONTAL); AlertDialog.Builder myDialog = new AlertDialog.Builder(MainActivity.this); myDialog.setTitle("title"); myDialog.setMessage("message"); myDialog.setView(sw); 回答1: Try with below code Switch sw = new Switch(MainActivity.this); sw.setTextOn("start"); sw.setTextOff("close"); LinearLayout

How to center paragraph vertically and horizontally w/ other criteria?

倾然丶 夕夏残阳落幕 提交于 2019-12-13 05:19:08
问题 So I have been working on my first website, and I'm having lots of fun doing it. However, I have found it very difficult to achieve centering a paragraph (spanning more than one line) vertically and horizontally inside of it's div container. The div has a proportional width (96%), and it is not set by pixels. Also, the paragraph has a set amount of padding (ex: 20px top and bottom). Is there a trick to center vertically and horizontally in this situation? Thanks a bunch! 回答1: See this fiddle

Javascript Google map api V3 fitbounds with center location

纵然是瞬间 提交于 2019-12-13 02:25:10
问题 I want to fitbound pushpins to visible all around user's location pushpin. i wrote the following code it center the user location but few pushpin goes out of map ?? FYI: userPinLoc is pushpin object which is already populated function setInitialZoom() { mapZoom = googleMap.getZoom(); var bounds = new google.maps.LatLngBounds(); bounds.extend(userPinLoc); for (i in nearestEntitiesToZoom) { entity = nearestEntitiesToZoom[i]; var googleLatLng = new google.maps.LatLng(entity.latitude,entity

Vertically centred div which increases parent height

喜你入骨 提交于 2019-12-13 02:17:38
问题 There is a div which has a dynamic content. The height of the parent is 100% of the body and child is unknown. translateY(-50%) technique works good only if a child content height is less than parent. But if it's more child div(green) starts to overflow the parent (yellow) as on below image. What's a proper way to set parent div increase the height and add some paddings. .body { height: 300px; background: red; } .parent { height: 100%; position: relative; background: rgb(105, 199, 115); }

animate a div and expand from center

為{幸葍}努か 提交于 2019-12-12 13:33:11
问题 I have a simple code that expands a div horizontal and vertically from center, but it only expands to the left or to the bottom, I want it expands to both side(left=50px, right=50px) or (top=50px, bottom=50px) from center with total equal to 100px. here the code: <!DOCTYPE html> <html> <head> <style> div { background-color:#bca; background: #fff; position: absolute; top: 50%; left: 50%; background-repeat: no-repeat; background-position: center center; border:1px solid green; padding:10px; } <

Java - how to center vertical column of components?

风格不统一 提交于 2019-12-12 10:56:50
问题 It's very simple, what I want to do, but I can't figure out a way to do it. In a JFrame or JPanel, how do you center components vertically? That is, analogous to using the center tag in HTML. The components are in a column and they are all centered. I have tried BoxLayout, with Y_AXIS and PAGE_AXIS, but it aligns the components in a strange way for me. I have tried to use FlowLayout with preferred size set so it wraps around, but it doesn't center it. I'd rather not resort to something

How to remove unwanted spaces at the right of CheckBox?

前提是你 提交于 2019-12-12 08:21:48
问题 I am working on a custom list view. I want to show a CheckBox at the custom view. There is no text for the CheckBox . I found it always have some spaces at the right of the CheckBox . Here is my layout xml file: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:background="#fa9654" android:paddingTop="65dp" android

How can I vertically center my bootstrap columns?

扶醉桌前 提交于 2019-12-12 05:27:32
问题 Here's a link to a JSFiddle of my problem. I'm using a .center-y class to try to vertically center the text elements, but getting no results. http://jsfiddle.net/2LKXQ/1/ .center-y { vertical-align: center; } 回答1: remove max-height and put top and bottom margin i hope this will helpful to you #WhatIsMasterPhoto { margin:25% auto; bottom: 10px; } 回答2: Check the updated jsfiddle - http://jsfiddle.net/chetangawai/2LKXQ/2/ <!-- What is Master Page --> <div class="container-fluid" style="display: