Questions tagged [center]

The center tag in HTML causes its contents to be centered within the parent element. It is deprecated and should no longer be used.

0
votes
4answers
19 views

How can I center multiple inline-block divs in a div? [duplicate]

I see this. I have a div with inside 20 inline-block div. I centered with "text-align:center". A javascript code write some text to first div. The first div is above than others. How can I center ...
0
votes
1answer
31 views

center text in banner with out extra div

I'd like to create a full width banner and combine it with flex's justify content and max-width to avoid using an extra div. I'm not sure it's possible. But I'd like to try to avoid my first instinct ...
0
votes
3answers
30 views

How to vertically center content in body using bootstrap 4

I am trying to align the container fluid container class in the middle of the screen both horizontally and vertically. I did try many classes which were supposed to work with bootstrap but they didn'...
-2
votes
0answers
6 views

Vertical Align within Float Box

I am not generally adept in CSS. The basic, perhaps. But I am venturing into odd realms lately. <a href="https://codepen.io/TheLollirot/pen/xyYzBq">Current Code</a> I am trying to align ...
0
votes
3answers
39 views

HTML, CSS center H1 and P under Image

I'm in need of help to centre text under a few images. For some reason the text is off by a few. The H3 needs to be on-top of the p and the H3 & P needs to be center under the IMG /*--...
1
vote
1answer
24 views

CSS Problem : Center Text in a box with Image

Can anybody help? I'm struggling to get some CSS- Code to work. I need three boxes; they need to look like in the picture But when I run my code the text is always below the image. Please can ...
-1
votes
0answers
17 views

TIP: Splash Page Image with Link - Perfectly Centered and Sized

This is a script-free solution for perfectly centering an image with a hyperlink on a "splash" page. It is responsive and should limit the size of the image to 90% of the page width. This was tested ...
2
votes
1answer
68 views

How do I horizontally and vertically center a textbox from the bottom border of the navigation menu to the end of the banner image?

How do I horizontally and vertically center a textbox from the bottom border of the navigation menu to the end of the banner image on a responsive website? I would appreciate any suggestions. I ...
-1
votes
0answers
30 views

Width is not working well with text align: center

I am trying to have my text centered with a costum width. Setting the width or max width will restore the position of the line to left. I am doing it like this: HTML file CSS file Result I need to ...
0
votes
2answers
27 views

Center and horizontally align two divs, and then vertically align on smaller screen

I basically have two side by side lists and I want them to be centered within their container. I can't copy all the code surrounding the div because there are a million spaces before it since the HTML ...
0
votes
0answers
35 views

JLabel Text Uncentered After Making Text Bold

I have three JLabels of identical dimension. They all have their horizontal alignment set to center: setHorizontalAlignment(javax.swing.SwingConstants.CENTER); This works fine, and produces the ...
0
votes
2answers
49 views

Way to center a grid of images in CSS/HTML?

I'm trying to figure out a way to center the photo grid that I have on the following page of my website: http://www.thefloodplains.com/Gallery As you can see, all of the gridded content seems to ...
0
votes
2answers
42 views

Center TextView over ImageView programmatically

I have image and text that I want to put on my app. I need the text to be centered over the image. Everything is done programmatically with RelativeLayout Object. For some reason, I only succeed to ...
0
votes
0answers
36 views

Python: Formatting Console Input

Good Afternoon, I'm just currently playing around with Python and wanted to know if it is possible to format the location of where a user types their input. For example, when they are typing their ...
0
votes
1answer
40 views

How to vertically center a view inside vertical linear layout?

I have a vertical linear layout that wraps another vertical linear layout. how can i make the inner linear layout to be vertically centered? as I know vertical linear layout force its children to ...
-5
votes
0answers
55 views

How to center elements in div

I try to center the elements in the div id d21.quickbook on the page http://gruener-baum.pp-kundenserver.de/ how do I center the inner elements? I tried around with margin 0 auto, but nothing changes....
0
votes
1answer
29 views

Center current cell view on datagridview c#

How can i center view on my selected current cell in datagridview? For example i have datagridview like this : for (int i = 0; i < 200; i++) { dataGridView1.Columns....
0
votes
2answers
37 views

SVG into coumpoundDrawable doesn't look centered to text

I have this layout: <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <TextView android:id="@+id/...
1
vote
2answers
42 views

Highcharts - Combine & superimpose columns

I found tutorials and answers about how to combine charts, superimpose them, but none about both at the same time. Here is a picture of what I mean: I tried some stuff, here is what I have done so ...
0
votes
0answers
23 views

Swift AVMutableVideoComposition scale and center calculation

I am scaling a AVMutableVideoComposition to fit my full screen view. When I do this it scales from the bottom left corner so I am trying to center it. here is my code... let scale = max(...
0
votes
1answer
18 views

Centering text on Input Form

I have scoured the Forum but can't find an answer to what is probably a simple question. I have a Form and can centre the text for the heading line but cannot centre text on subsequent "input" lines. ...
0
votes
1answer
14 views

Excel checkbox in the center of cell

Is it possible to move box of checkbox to center of the cell? I am creating checkbox. Checkbox itself is on the left side and text is on the right side. I am deleting text so there is only "checkbox" ...
0
votes
0answers
28 views

Display flex with justify-content center is misaligned on a few browsers like IE and mobile Safari 10

URL to view the HTML and CSS site with good/broken alignment issues: http://jimmiheiserman.com/bannerDev/crossTest/ I am creating a mismatched brickwork layering effect with differently sized divs, ...
0
votes
0answers
11 views

centering compundDrawable without setting bounds and sizing canvas?

I have some code to set a compundDrawable next to a textView I used to set the bounds of the drawable and the size of the canvas - because I want the drawable to be vertically centered to the ...
1
vote
0answers
72 views

How can I center only the viewImage in a compundText and leave the text itself aligned to it parent bottom?

I want to fix a bu of non centered image in compoundText view. In a compound textView, the code adds an image with size 6x10 dp TextViewCompat.setCompoundDrawablesRelative(targetTextView, null, null,...
1
vote
4answers
29 views

Centering an image horizontally using “center”

I'm having trouble centering an image horizontally. This is my code: <img src="https://dummyimage.com/300x200/000/fff" alt="johnson johnson" style="width:300px; height:225px;" class="center"&...
0
votes
0answers
14 views

iOS Notification or Control center displayer event

In my app I need to know when Notification or Control center are displayed (I'm displaying some information when app goes to background). In my AppDelegate I "listen" to events like when app goes to ...
-2
votes
2answers
55 views

How do I get images in Javascript array centered

I am so stumped at this point and its bugging me to no end that I can not figure it out so I have decided to switch the way I enter images on my github site its a small meme site dedicated to cats and ...
0
votes
1answer
27 views

Flex box issue - Center Element truncated on overflow [duplicate]

I'm using some flex box attributes to place a simple div to the center of the screen : //CSS html { width: 100%; height: 100%; } body { width: 100%; height: 100%; margin: 0px; ...
0
votes
1answer
52 views

All margins are equal, but some margins are more equal than others

div { width: 100px; margin: 0 auto; } This CSS horizontally centers a block element. Is it possible to offset auto margins' proportions? For instance, make the left margin twice as big as ...
0
votes
2answers
42 views

Caption centered and at the bottom of a background

I'm a React beginnerCan you explain me how to place a .herogroup (composed by h1, p and a button) in the middle and 20px far away from the bottom of a background (belonging to .Hero)? <div> &...
0
votes
0answers
45 views

Pinch to zoom to the center with an Ionic component

I have simplified this component which permits to zoom into images : https://www.npmjs.com/package/ionic2-zoom-area I would be able to zoom and unzoom under the scale 1 but when I do the center ...
0
votes
0answers
23 views

How to transform images to div center? [duplicate]

EDIT: The linked 'duplicate' does not resolve my problem; I am not transforming divs, I am transforming images aligned on the same row with input fields within a div. EDIT 2: Solution found: use '...
-1
votes
2answers
43 views

How to vertically align text in html/css? [duplicate]

I am working on a fiddle in which I want to vertically align James text in html/css as shown below in the image. The HTML code which I have used for that is: <div class="tab-pane" id="reviews" ...
0
votes
1answer
31 views

Centering Roll-Over Images

I found the following code on Les Vesti. However, the code does not center images. Can some one help me? The HTML: <div class="photo"> <a href="#"> <img src="https://www....
-3
votes
1answer
56 views

Center Span Over Div Button

I have a div button that I was created through a PayPal integration and I have some text in a span that I would all like to align under my checkout button. The issue is that I can't seem to align the ...
0
votes
3answers
30 views

Center fields using Bootstrap

I'm newbie using bootstrap, so I would like you help to center these couple of textBoxes and the button. I appreciate if there any other enhancement I can do with the code This is part of the code I ...
0
votes
4answers
53 views

Centering a TextView vertically in a LinearLayout

I am trying to center a TextView in a LinearLayout and it is centering horizontaly but not vertically. below is my code <LinearLayout android:layout_width="fill_parent" ...
0
votes
1answer
33 views

How to center sub elements under a div in bootstrap 4?

I have looked at the documentation of boostrap 4. To center the content horizontally we could use justify-content-center class. for example i have 4 sub elements in a div like images and text, i ...
0
votes
6answers
267 views

Center Image Vertically and Horizontally in Bootstrap Grid

I'm having trouble figuring out how to center an image vertically and horizontally. Essentially I have two rows of images, all have a width of 150 but heights vary. CSS .image-center { display: ...
1
vote
0answers
21 views

Keeping instantiated grid in the centre of the screen?

everyone, I'm making a mobile game and I need help. In the game, I instantiate a grid of dots as seen in the first attached file below.My problem is the grid is not in the centre of the screen I could ...
1
vote
0answers
43 views

Android center children in HorizontalScrollView

I have a HorizontalScrollView with an ImageView and a RelativeLayout on top of the ImageView. The RelativeLayout gets multiple ImageButtons created and assigned on runtime dynamically. <...
2
votes
2answers
58 views

How do I center specific content?

I've got a slideshow with 2 pictures and a text under it. I just want to center it in the middle of my header. For some reason I'm struggling. The content which should get centered is in my body and ...
0
votes
0answers
22 views

Center a Menu in Mobile Version but not in Desktop Version

Im making a Website with Media Queries. In the Mobile Version there should be a Hamburger-Dropdown Menu, where the Items are Centered, but on the Desktop Page the Menu-Items are not centered (they're ...
0
votes
0answers
7 views

How can I center a second background

I have a background fixed and I want a second background centered. I have the following code: HTML <section id="contacto" class="section-padding"> <div class="page-relative"> ...
0
votes
2answers
43 views

CSS - Position element above others and in the middle of screen

I want to position a div in the middle of the screen, above all other elements so it makes them unclickable and covers them with its background. .myElement { position: absolute; top: 50%; ...
1
vote
0answers
32 views

JavaFX Application proportions are not right

I am trying to set my applications center in the middle of the screen, and I apparently figured out myself the common solution proposed on other threads here at StackOverFlow, although you can clearly ...
0
votes
1answer
24 views

Centering a button and responsive design

I have a simple question about responsive design. I have a button that I want on the top right of the screen on PC but on the bottom center on mobile. Do I need to use @media or is there another way? ...
0
votes
0answers
17 views

Smoothly update Google Map API center with user coordinates on mobile browser

I coded an function in Javascript that updates the center of a Google Map with the current user's position. It refreshes every 2 seconds. setInterval(function UpdateMapPosition() { if (...
0
votes
0answers
45 views

How to rename the dynamic outputs using command center

I am generating the multiple PDF outputs using command center and i want to rename the each outputs dynamically i.e. I want to keep prefix & suffix as is of output file name and middle word(Which ...