FAQ Database Discussion Community


Center multiple UILabels on a line

ios,swift,view,uilabel,center
I want to horizontally center multiple UILabels - as a group - on a line in Interface Builder. One the straight view controller i could not figure out how to do this. I read comments about place the UILabels in a View and then centering the view in the view...

Divs 'left / center / right' - how to perfectly center without 'width'?

css,css-float,center
This question is based on this answer: http://stackoverflow.com/a/23876839/994141 I read many threads on this subject, and it seemed to me the best answer because I would like to avoid setting a width. But the content at the center isn't well centered but based on the content on the left and...

Loading a FXML into borderpane center

javafx,center,fxml,borderpane
Good evening guys, I am playing around with JavaFX. The aim is to load a prepared fxml into the center element of a borderpane on button click. Unfortunately, I am getting the following error: Caused by: javafx.fxml.LoadException: /D:/Coden/Eclipse%20Workspace/Project%20Tango001/bin/application/Page1Gui.fxml:8 at javafx.fxml.FXMLLoader.constructLoadException(Unknown Source) at javafx.fxml.FXMLLoader.access$700(Unknown Source) at javafx.fxml.FXMLLoader$ValueElement.processAttribute(Unknown Source) at...

Rotating words and how to center it

html,css,center
I want to make center this Miss, hug... This is my site: https://www.ajdinalic.cf/ Image: http://prntscr.com/69oewr I am still new at this coding, and found this code on google This is on weebly btw, i tried to fix but i dont know and i dont want to make it worse .rw-wrapper{...

Making Linked Image Relative to Background Image Center

html,css,image,position,center
Sorry if this is a stupid question, but I'm having trouble with a 404 error page I'm trying to make. Basically, I've set it up as a 'Where's Wally' style page with a large background image. I'm trying to create a transparent button to click on that will return the...

Header moves to the right because of padding

wordpress,header,center,padding
I want my header in Wordpress to center in the body-content. Now the Page-id Div has a padding of 40px both left and right. When adding my Header in the Header.php with a width of 960 + 40 + 40 = 1040, the Header is centered within the body-content, but...

Centering Pop Up Message - Javascript [duplicate]

javascript,center
This question already has an answer here: Javascript alert position not in center in chrome 4 answers How can I put this popup error message at the center of my webpage? Here is my code: echo "<script language=\"JavaScript\">\n"; echo "alert('User does not exist!');\n"; echo "window.location='login.php'"; echo "</script>"; thank you!...

CSS/HTML Trying to center nav ul element

html,css,html-lists,center,nav
I'm just messing around on jsfiddle trying to practice and I came across an issue that I couldn't solve. So hopefully some of you could help me a bit here. This seems like such a silly question on the very basics of CSS but for some reason this one has...

Cannot position a dialog at the center of the view

android,dialog,position,center
I want to put a custom dialog at the center point of a specific layout. However the dialog does not go to the center. actually i tried various ways however now i am stuck... such a headache. I tried like the code below. showCustomDialog(){ View view = (View) getLayoutInflater().inflate(R.layout.abc, null);...

Horizontal menu center elements

html,css,menu,center,horizontallist
I have the following files: html file <nav> <ul> <li><b><a href="">Alle Rezepte</a></b></li> <li><b><a href="">Alle Zutaten</a></b></li> </ul> </nav> css file nav { } nav ul { text-align: center; } nav ul li { display: inline; } And it looks like this in the browser But I want the two elements two...

How to center images in div

html,css,center,centering
How to make these images stay in center? Here are my css and html codes. My html code: <div id="logos"> <div id="q"> <img id="round" src="img/i1.jpg" /> <img id="round" src="img/i1.jpg" /> <img id="round" src="img/i1.jpg" /> </div> </div> My css code: #logos { display: inline-block; width:100%; } #q{ display: block; } #round...

Align an image center, bottom of a responsive div

html,css,alignment,center
<div id="banner" class="cf"> <div class="banner container"> <hr/> <p class="banner-text"> Some text here <span class="sub-bt">That's it.</span> </p> <a href="#" rel="nofollow" class="learn-btn">Learn More</a> <img src="<?php echo get_template_directory_uri(); ?>/library/images/responsive_ex.png" class="res-ex"> </div> </div> This is the code for the issue as far. I need to position the image with a class of "res-ex" to...

Centering list items

html,css,center
I tried center my nav menu with margin:0 auto;, but nothing. And I tried with <center></center> and still nothing. Can somebody help me? This is my html code: <div id="cssmenu"> <ul> <li class='active has-sub'><a href='#'><span>Filmovi</span></a> <ul> <li class='has-sub'><a href='#'><span>Akcijski</span></a></li> <li class='has-sub'><a href='#'><span>Triler</span></a></li> <li class='has-sub'><a...

Vertically align a div in a parent which has height auto AND min-height set?

css,css3,center,vertical-alignment
I'm stuck on this one. I want to vertically center a div. Its parent has an unknown height, however, it does have a min-height. How can I do this?...

Cant Center my li within my ul In sidebar

html,css,html-lists,center
i'm pretty new to css and html and trying to make a site to work on improving and learning. I've been searching and cant figure out how to fix my menu in the sidebar, to me it looks like the li's in the ul are floating to the right for...

HTML, CSS: Append inline-element to the right of a centered inline-element

html,css,center,inline
(The title might sound stupid but I don't know how to put it more sophisticated.) As you can see in the follwing screenshots, I have 3 stacked divs. <div class="col-xs-3"> <div class="center-horizontal-inline"> <a class="upvote" href="#" data-id="iZheLNnewWtMhPTQd"> </div> <div class="score"> 115 <span class="badge score-diff vertical-align"> +5 </span> </div> <div class="center-horizontal-inline"> </div>...

Responsive Lightbox not centering content

css,center
I am working with this demo: http://blog.templatemonster.com/demos/coding-a-responsive-lightbox-image-gallery-for-website-portfolios/demo/index.html From here: http://blog.templatemonster.com/2014/05/20/coding-responsive-lightbox-gallery-portfolios-tutorial/ Is there a way to center the thumbnails? It looks like the right is off by about 25px. ...

How to center CSS-shapes within a wrapper in a row

html,alignment,center,css-shapes
how do I center shapes that are within a wrapper in a row. So far Iv got them into the row but I cant get them to center horizontally. Here is the html code that deals with that part: .wrapper { overflow: hidden; /*make sure the wrapper has no dimension*/...

vertically centering video inside a video tag

html5,video,alignment,center
how do you center vertically a video inside a video tag? currently the video is flush top and the bottom is getting cut off. what i would like to do is for the middle of the video to be in the middle of the video container. the video's height will...

CSS: How to scale an image from the center instead of top-left

css,scale,center,transition
So my problem is that I have an image and I set its CSS to have a max-width: 100% which scales it at lower resolutions ( as will be seen in the fiddle below ). What I want is for the transition to take effect from the center of the...

Delete top and bottom margins in dynamic Textviews Android

android,textview,android-linearlayout,center,gravity
How do I delete the top and bottom margins of the dots in the green LinearLayout? I have tried with setMargins to 0 but it not works This are my Java class and my XML's MainActivity.java public class MainActivity extends Activity { private ViewPager viewPager; private MyViewPagerAdapter myViewPagerAdapter; private ArrayList<Integer>...

display div horizontally and vertically center inside parent div?

css,center
I am wanting to know how I can horizontally and vertically center a div inside a parent div. At the moment my div is horizontally vertical but not vertically horizontal. Please can someone show me where i am going wrong? thanks Desired Result: |- - - - - - -...

Cannot Centre a Div to be in the Middle of Page

html,css,position,center
I am trying to get my Div to be centered in the page, however I cannot get it to work properly. Despite using Margin-left: auto and Margin-Right:auto it still doesn't center in the middle of the page. Any help would be appreciated! HTML: <div class="OuterService"> <div class="service"> <div class="virus" style="width:250px;...

Vertical centering of image in fluid nav bar

css,center,dreamweaver,fluid
I am trying to get a fluid navigation bar done in Dreamweaver, which will also change the size of the logo when changing the viewport. This works and looks perfectly, except that the logo image will not stay vertically centered when it gets smaller. <div class="gridContainer clearfix"> <div id="div1" class="fluid">...

Contact Form won't center within parent div

html,css,forms,center
I can't get my form to align in the center of a div. Driving me nuts! I simply need this contact form to be centered, no matter the viewport size. Right now it's off to left, but I can't figure it out. I've included a codePen here And here's my...

jQuery - Show/hide has problems with centered items

jquery,hide,center,show
All I want is, as the code says, to loop a show-hide animation. Somehow it seems to automatically move to the left and back to the center. What's happening and how do I keep it fixed to the center? <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> function running(){ $("#hider").show("slow").hide("slow", running); } $(document).ready(function(){...

iOS Set autoLayout button place to the remain space at center in storyboard

ios,autolayout,center
I have a autolayout problem. I use storyboard to drag the constraints. I have a top green view. It was fix height. And the green view left,top and right constraints are 0. The bottom view is blue. It was fix height. And the blue view left, bottom and the right...

Get center of any UIView in Swift

swift,uiview,center
I'm trying to write a global function that adds an activityIndicator to any view (mostly imageViews though) by calling such function. The function I have right now is made of: public func addActivityIndicatorToView(activityIndicator: UIActivityIndicatorView, view: UIView){ //activityIndicator configuration ... activityIndicator.center = view.center view.addSubview(activityIndicator) activityIndicator.startAnimating() } But I don't get the...

Linking a center aligned image on a landing page to another page

css3,alignment,anchor,center
I'm trying to center a single clickable image on my landing page that links to another page in a password protected directory (folder2). I am able to center align the image, but I'm not able to figure out how to link the image to the page in the password protected...

Center login form bootstrap

html,css,bootstrap,center
please help, i want this form dead center both vertical and horizontal so it looks like this http://www.creattor.com/files/14743/5515/futuristic-login-form-screenshots-1.jpg and so it is dynamical center hope you can help me. <html> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> <style> body{ background-color:#33383E; } .login input{ width:150px;;...

Nav menu will not center

css,menu,alignment,center
My nav menu will not center. And I can't find the fault in the code. Maybe someone can help me?! #nav-header { height: 60px; width: auto; background-color: rgba(255, 255, 255, 0.7); margin-top: 80px; } #nav-header li.nav-link { display: inline; padding: 20px 20px 20px 20px; font-family: 'Source Sans Pro', sans-serif,"Open Sans",...

Absolute vertical and horizontal center text in responsive div

javascript,jquery,html,css,center
I am really stuck trying to figure this out - I am attempting to both vertically and horizontally text in a responsive div that appears over an image on hover. Here's a jsfiddle of the basic HTML and CSS structure. Here's an example of what I'm attempting to do. I've...

text-align: center; not working

html,css,center,jsfiddle,text-align
I've recreated it in JSfiddle and still can't get it to work. What am I missing? Here's the HTML <div class="row"> <div class="6u 12u$(small)"> <span class="image fit"><img src="images/pic01.jpg" alt=""></span> <h2green class="h2green">HIDE IN PLAIN SIGHT</h2green> <p>Escape to the big city of your choice; top floor of the tallest skyscraper with a...

Bootstrap: Need help to center a button

css,center
Im trying to center this button but can't seem to get it to work, any help is much appreciated. <div class="cta-btn"> <a class="btn btn-cta text-center" href="#" role="button">EXPLORE</a> </div> And the CSS .btn-cta{ padding: 25px 80px; border: 3px solid white; background-color: transparent; color: white; font-family: Tahoma, Verdana, Segoe, sans-serif; text-transform: uppercase;...

Android ViewPager center item on screen

android,dialog,android-viewpager,fragment,center
I am trying to show a dialog over my screen. And that dialog should have ViewPager in it with FragmentPagerAdapter. Each item in adapter has width set to .7f. What is important to me is that when some item is selected it should be snapped to center of the ViewPager...

GMSMarker icon from center (iOS)

ios,google-maps,google-maps-markers,center,gmsmapview
I just switched from Apple Maps to Google Maps. An issue that I can't seem to find an answer to is how do you make the icon for a GMSMarker to start from the center rather then from the bottom of the image. An example of what I mean is...

center content with full background

css,center,margin
Inside a div I want a full width background color and center the content inside. I have read in some other posts that it needs an outer div to set the background-color there, and then an inner div with the width of my content and margin:0 auto;. I tried that...

How to get this form to be in the center of the page horizontally

html,css,center
I simply need the form to be within the center of the screen, and for its width to be 325px. Currently it is slightly to the left of the center. You can see here. The text that says "In the middle" is not directly in the center of the form....

Android: How to center a component in a custom view in action bar?

android,layout,view,center
I have a layout like this : <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="50dp" > <TextView android:id="@+id/title_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:layout_toRightOf="@+id/backToScan" android:gravity="center" android:textAllCaps="true"...

How to center a group of images in HTML/CSS?

html,css,image,center
I'm making a simple website for a friend and I can't seem to center 5 png images? I have them in a div and the images itself are using display: block; and margin: auto; to center which did work earlier using for only 1 picture as you'll see down below....

Vertically centered a rotate text

css,rotation,center
I tried the solutions in the previous questions, but none was successful. I've 2 dynamic text that need to be rotated and centered into their content div (left and right). All the solution that I tried doesn't work Here's the code: #sideLeft span, #sideRight span { bottom: 50%; display: block;...

Issue with Llinear layout hierarchy and alignment

java,android,alignment,android-linearlayout,center
I've some line of code in parent XML as below: <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <include android:id="@+id/header_parent_layout" layout="@layout/common_header_layout" /> <include android:id="@+id/title_header_layout" layout="@layout/title_header_layout" /> <LinearLayout android:id="@+id/content" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" />...

CSS Background horizontal centering

html,css,css3,center
I have an image as background with the following CSS setup #background { background-image: url('../img/bgimage.jpg'); background-repeat: no-repeat; background-attachment: fixed; background-position: center; opacity: 0.8; filter:alpha(opacity=80); top:0; } My aim was to center the background ( add a little opacity ), but still have its beginning at the top of the page....

how to center an image under the status bar in swift?

xcode,image,swift,center
I just can't seem to find the right code for it. I want to place an image 20 points under the status bar (this will be the Y) and center it (this would be the X of course). I can easily do it with storyboard but i'm struggling to do...

Can't center align values in table header in asp.net

asp.net,table,center
I am trying to center align the values for my table header cells 'cow' and 'heifer'. Programatically I have already done this for the table rows, but for some reason it won't do this for the header rows. I'm doing this for each individual cell because I don't want the...

Centering navigation bar won't work

html,css,replace,navigation,center
I have made a navigation bar and I am trying to make it centered to fit all screens, with position absolute and then use left: 50%; and then place it by margin-left: 100px; to get it exactly where I want it. I have done this to all my buttons and...

Vertical align center in div

html,alignment,center
I have this code and i cannot vertical align content in second div to center. <div style="min-height: 317px"> <!-- this min div is auto generated--> <div class="verticalalign"> <h1>Heading</h1> <p>Some text</p> </div> </div> How CSS for class .verticalalign i must write to vertical align center for second div ? Parental div...

Vertical center of menu in a header

css,center
I am not able to center my menu in a header-bar. I've tried display: table-cell and display: table but it doesn't work. The only thing I can do is a fixed margin-top, which I want to avoid. <header> <div class="container"> <div id="logo"></div> <div id="mainnav"> <div class="clearfix"> <?php wp_nav_menu( array( 'theme_location'...

how to align 5 div side by side in center using css?

jquery,html,css,responsive-design,center
I have problem to make a div always center, when we going to tab also... What actually there: HTML .main { width: 100%; overflow: hidden; } .col { width: 30%; height: 100px; float: left; background: #09c; margin-right: 2%; margin-bottom: 5px; } <div class="main"> <div class="col"></div> <div class="col"></div> <div class="col"></div> <div...

how to center perfectly image and text inline in the center of page

html,css,image,text,center
Please help me with CSS to center an image-logo and text in the center of the page. Usually, in Google suggests about vertical-align, but I need horizontal align. what I want to achieve - is to create a footer line where to center logo and copyright text horizontally centered correct....

How to center ImageView in a toolbar?

android,android-actionbar,imageview,center,toolbar
Been trying to center a logo inside my toolbar. When i navigate to the next activity, the "up affordance" icon is present, and it will push my logo slightly to the right. How can I keep my logo at the center of the toolbar, without removing the up affordance icon?...

Center a div or span while between other spans

html,css,center
I have a div container in which there are already 2 spans: one floating left and one floating right. Now I want to add a third span that will be in the center of the div. I've tried a ton of things, most promising tracks include things like this on...

Why is my div not horizontally centered?

css,center,margin,auto
I have two divs horizontally aligned next to each other, each taking ~50% of the page width. Now if the browser window changes, my I want to keep one div centered (<div id="featured">) but it doesn't, even tho I set margin: 0 auto;) How can I keep it centered in...

I am making a sign in page using bootstrap. How do I center it?

css,twitter-bootstrap,center
I am doing a school project and I need to make a sign in page. I have found this code, but it is not showing up in the center of the page. It is showing up on the left side of the page. Well, the first part is showing up...

Where and how to put a progressbar on a existing layout?

android,xml,position,progress-bar,center
i created an activity that includes an AsyncTask for fetching json from internet. I add a progressbar to the existing layout so users can't interact with EditText till up the data download is completed. WHERE to put the progressbar widget on existing layout? HOW to make users not to click...

CSS Centering of Image

css,asp.net-mvc,image,center,centering
I'm working in visual studio with the following code, however, the URL images refuse to center in the columns like the h2 tags did. ive tried multiple options such as background-image: url('http://i59.tinypic.com/314uzyb.jpg'); background-position: center center; background-repeat: no-repeat; also background: url('http://i59.tinypic.com/314uzyb.jpg') center center; background-repeat: no-repeat; here is what it currently looks...

css centering dynamic div

html,css,dynamic,center
I have a div #content where i on the run add left floated divs #block and there are divs with fixed width on either side of div (a) , #lcontent and #rcontent How do i get #content to remain at center when side divs have dynamic height and #content changes...

how to set column in center position

c#,center
Well, I used this code to named a column, listView1.Columns.Add("x").Width =100; How to make 'x' column appear in Center position?...