FAQ Database Discussion Community


How to I center this text?

html,css,css3,text,centering
So I can't figure out how to center this text (I'm talking about the "See who Matthew is" and "View his Curriculum Vitae" etc... I can center it horizontally, but not vertically. I always suck when it comes to centering text in divs, so any help would be appreciated. Thanks!...

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...

How can I vertically and center 3 buttons on my mobile site?

css,html5,button,vertical-alignment,centering
I am working out of wordpress. I have 3 buttons i would like to place on my mobile site. I would like for these buttons to be centered vertically in the middle of the page. I don't really know how write this code the proper way , nor the css....

Centre 2 line text in box

css3,text,centering
I have 2 boxes with some text going across positioned in the centre of each box. The problem is when there is 2 lines of text the text doesn't get centred anymore. Here's an example The positioning of the text is made by the following CSS as the boxes have...

centering absolute positioned items

css,centering
I have a slideshow and on it are the small circles where u can see how many pics there are and which one is active. Those circles are position: absolute; and i'm trying to make them be centered. How do i do that? Heres HTML: <div id="circles"> <img src="slike/active.png" id="circle1">...

Overlay text over an image and align ALL center using only css and/or HTML

html,css,image,centering
I've read through several posts regarding both overlaying text over an image, AND on centering. None of the answers work for my situation. Below is both the HTML and the CSS I'm using. Frankly - the only thing I've found that will work to center my image UNDER my text...

Centering multi div

html,css,centering
I am trying to center multiples div so that it works a cross all browser. <style> .boxContent { width: 288px; height: 288px; background-color: #777; margin: 2px; display: inline-block; } .boxContainer { background-color: #333; text-align: center; display: table; } </style> <body> <div class="container"> <div class="row"> <div class="boxContainer center"> <div class="boxContent">asda</div> <div...

Center tag works on link but not CSS or align attribute

html,css,centering
I'm trying to center a button that is an <a> tag. However, the only thing that will work is the <center> tag. I've tried using <a style="text-align: center">Button</a> and <a align="center">Button</a>, but none of the two worked. Why is it that only the center tag works? My CSS is this:...

Vertically centering image in flexbox figure element

html,css,centering,flexbox,figure
I'm currently doing a redesign of a portfolio section for a website, and the idea is to have a representative image for each client that serves as a background of a link block, and when you mouse over the image, a semi-transparent overlay with some brief text summary eases in....

How to center a GameObject between a LineRenderer and an empty GameObject dynamically in Unity3D?

unity3d,centering
I'm generating a playerController dynamically through a server (each time someone connects). My problem is being able to center it in the X axis, using as references both an EmptyGameObject and a LineRenderer element. Here's how it is looking I need that rectangle to update it position each time either...

Why is this working differently in firefox, chrome and IE?

css,table,centering,onmouseover
I just wanted to ask the following : Why does table behave in a strange way in different browsers? Is this behavior same with other tags??Even my data, though being repeatedly centered doesn't displays the way it should.Is something wrong with the way i used 'test-align'? (i have not found...

AS3 Center Video in StageVideo

actionscript-3,flash,video,centering,stagevideo
I've a brief question that I'm sure some AS3 genius knows. I'm surprised I haven't seen any other topics on this after 30 minutes of Google-fu, StageVideo seems to be largely silent. So I've been trying out the StageVideo API in place of traditional Videos for better video playback. This...

Line-height vs paddings to vertically center one-lined text

html,css,centering
I can vertically center one-lined text with line-height, but also with padding-top and padding-bottom. What are the pros and cons of each? body { font-size: 12px; font-family: sans-serif; } div { border: 1px solid #333; padding-left: 10px; padding-right: 10px; display: inline-block; } .vcenter1 { line-height: 50px; } .vcenter2 { padding-top:...

Center DIV Horizontally and Vertically

html,css,alignment,centering
I have this HTML structure: <div class="metaboxdet"> <div class="metd"> <h1>Hello World!</h1> </div> </div> http://jsfiddle.net/fvueL00n/2/ the problem here is I cant center the div "metd" horizontally and vertically. I have tried adjusting the top, bottom, left and right but it return a not so accurate results. Is there a way where...

How to center image when creating images from PDF using GhostScript

pdf,centering,ghostscript
I have several pdf files with different sizes and different width to height ratios. Now I want to create fixed-size thumbnails from 1st page of these files. I do this using this command: gs -dNOPAUSE -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -sOutputFile=d:\test\a.jpeg -dJPEGQ=100 -g509x750 -dUseCropBox=true -dPDFFitPage=true -q d:\test\a.pdf -c quit Since the original...

SVG Animation rotate group around its center

css,svg,rotation,centering
I have a svg image that contains a circle group and a text group. The circle group consists of multiple dots. This Circle group should rotate around its circle center, but it keeps rotating around the svg's top left corner. To solve this issue I have searched everywhere, but I...

How to center parts of a list efficiently with CSS [Img Inside]

php,html,css,while-loop,centering
the problem is, i know i can center all the three objects in the list correctly using 3 while loops with CSS, but i also know than use 3 whiles loops for something like that is a waste of resources Also i love if the solution includes order them...

prestashop css vertical and horizontal centering [closed]

css,geometry,prestashop,centering
Hi i need help with centering few images on my prestashop webpage. I need help with 3 circles on bottom of the page (not with social icons) . I don't how center the images in circles. Please help...

Positioning element in the middle of dinamicaly sized element

css,position,centering
I have to put "Play" icon and text "Play" in the center of element that contains and its height and width depend of that image - they are changing depending of the user's screen. I was trying to use it like this a.thumbnail:hover:after { content: "Play"; width: 50px; height: 20px;...

C#, Windows Forms: Cant start center the form

c#,winforms,centering
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainScreen()); } This is my main that creates and runs the main screen, I have tried using: Form.StartPosition = CenterScreen/ CenterParent Manually changing the form location in the constructor. I have even tried creating the form separately then changing its StartPosition and...

How do I automatically center a fixed element?

html,css,centering
I'm currently attempting to keep my header menu fixed at the top of the screen, even when scrolling. The issue is that whenever I set the position to fixed, it loses it's centering, and margin has no effect on it. I want to be able to center the element while...

How to Center Rotated text with CSS

css,rotation,transform,centering
I'm trying to write a bar with rotated tabs. Rotation is done with transform:rotate. The problem: width:100% is computed before rotation, so it will actually be set to 100% of the height of the rotated tab. .tab-caption { position: absolute; width: 100%; /* width before rotation! */ top: 50%; height:...

How to get every line of text / elements of a page centered horizontally?

css,centering,text-align
I am trying to have every line of text/elements centered horizontally so that my page looks lke this https://hootsuite.com/. How do I style the page in CSS to look like that ? Here is my page : <div class ="wrap"> <% if user_signed_in? %> <div class="row"> <aside class="col-md-4"> <section class="user_info">...

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...

How can I center a frame in GridSpec?

python,image,matplotlib,centering
How can I center an image in a GridSpec divided frame? I've got the below image, and I want to have the upper picture to be centered. The relevant code (part of it, especially the units, is from the AMUSE framework) : lim = [-5,5] | units.kpc bins = [100,100]...

Center object in X axis, between two other objects

unity3d,centering
I need my PlayerController (which is generated dynamically) to have it's position updated each frame, so it is always centered between the center line and the anchor end: https://goo.gl/G9ZZTp Here is the code I am using right now: using UnityEngine; using System.Collections; public class CenterPlayer : MonoBehaviour { private GameObject...

How do I center a button in an angular-ui-grid cell?

css,centering,angular-ui-grid
I define a column as follows: { name: 'button', displayName: '', cellClass: 'ui-grid-vcenter', enableColumnMenu: false, enableFiltering: false, enableSorting: false, cellTemplate: '<div><button ng-click="grid.appScope.rowButtonHandler(row.entity.id)">clicky</button></div>' } Resulting in: <div class="ui-grid-cell ng-scope ui-grid-coluiGrid-010 ui-grid-vcenter" ui-grid-cell="" ng-class="{ 'ui-grid-row-header-cell': col.isRowHeader }" ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by...

How to center text inside div in this specific situation? [duplicate]

css,image,responsive-design,centering
This question already has an answer here: How to center an element horizontally and vertically? 2 answers How to center the text inside that box? Here's how I want elements sorted out: In a smaller screen, elements stack on top of each other, and the .text-box div, that contains...

Nav bar not centered properly (HTML/CSS)

html,css,navbar,centering
I'm a beginner trying to set up my first website. I want it to be responsive from the beginning, so I don't want to have a fixed width. Alright, now I created a nav bar - consisting of 4 nav elements - which I want to be centered. I tried...

WPF create one Window for each screen, and center them on each screen

c#,wpf,centering,multiple-monitors
EDIT: I solved it. See my fix in the answer below. I'm working on an application that should open a small popup window on each screen connected to the computer it runs on. Simple enough to do on a single screen (using WindowStartupLocation = CenterScreen), but surprisingly difficult to do...

Responsive diamond shape with center aligned content using transform rotate

html,css3,rotation,transform,centering
I am having great difficulties trying to create a centered, responsive diamond shape in the center of a 100% x 100% container, with the diamond containing a center aligned logo. Sound confusing? Well, this is what I mean: (images are self-drawn graphics) I have managed to get the responsive diamond...