I have this problem of centering the div vertically. I've looked over Stackoverflow but nothing seems to fix my problem. Here's the code:   .contactform {   width: 100%;   min-height: 100vh; }  .contact {   width: 100%;   height: 500px;   text-align: center;   background-color: rgb(36, 125, 241);   margin-top: 100px;   margin-bottom: 100px; }  .contact h1 {   font-size: 40px;   letter-spacing: 4px; }  .contact-content {   width: 70%;   height: 100%;   display: flex;   /* justify-content: center;   text-align: center; */   margin: 0 auto;   /* position: absolute; */   margin-top: 50px; }  .contact-column-one {   width: 33%;   height: 50%; }  .contact-column-one .location i {   font-size: 50px;   cursor: pointer; }  .contact-column-one .location i:hover{   color: rgb(19, 112, 233);   transition: .5s; }  .contact-column-one h1 {   font-size: 30px; }  .contact-column-two {   width: 33%;   height: 50%; }  .contact-column-two .phone i {   font-size: 50px;   cursor: pointer; }  .contact-column-two .phone i:hover {   color: rgb(19, 112, 233);   transition: .5s; }  .contact-column-two h1 {   font-size: 30px; }  .contact-column-three {   width: 33%;   height: 50%; }  .contact-column-three .email i {   font-size: 50px;   cursor: pointer; }  .contact-column-three .email i:hover {   color: rgb(19, 112, 233);   transition: .5s; }  .contact-column-three h1 {   font-size: 30px; } &lt;section class="contactform" id="contactform"&gt;     &lt;div class="contact"&gt;         &lt;h1&gt;CONTACT US&lt;/h1&gt;         &lt;div class="contact-content"&gt;             &lt;div class="contact-column-one"&gt;                 &lt;span class="location"&gt;                     &lt;i class="material-icons"&gt;                         place                     &lt;/i&gt;                 &lt;/span&gt;                 &lt;h1&gt;ADDRESS&lt;/h1&gt;                 &lt;p&gt;Address&lt;/p&gt;             &lt;/div&gt;             &lt;div class="contact-column-two"&gt;                 &lt;span class="phone"&gt;                     &lt;i class="material-icons"&gt;                         phone                     &lt;/i&gt;                 &lt;/span&gt;                 &lt;h1&gt;PHONE&lt;/h1&gt;                 &lt;p&gt;Phone Number&lt;/p&gt;             &lt;/div&gt;             &lt;div class="contact-column-three"&gt;                 &lt;span class="email"&gt;                     &lt;i class="material-icons"&gt;                         email                     &lt;/i&gt;                 &lt;/span&gt;                 &lt;h1&gt;EMAIL&lt;/h1&gt;                 &lt;p&gt;Email&lt;/p&gt;             &lt;/div&gt;         &lt;/div&gt;     &lt;/div&gt; &lt;/section&gt;    I've tried flexbox but came to no solution. I've also tried the method of making top: 50% and then transform: translateY(-50%); but still didn't fix my problem. Thank you for your time! UPDATE: When I try to make the position absolute/relative to parent/child it moves my section to hero section!
173
I want to center a div vertically with CSS. I don't want tables or JavaScript, but only pure CSS. I found some solutions, but all of them are missing Internet Explorer 6 support. &lt;body&gt;     &lt;div&gt;Div to be aligned vertically&lt;/div&gt; &lt;/body&gt;  How can I center a div vertically in all major browsers, including Internet Explorer 6?
7162
Is there a word-wrap or any other attribute that stops text from wrapping?  I have a height, and overflow:hidden, and the text still breaks.  Needs to work in all browsers, before CSS3.
8738
I have a layout that is working, but it has one very annoying problem.. when the content is taller than the screen, the background stops.  This is the desired layout in bad-ASCII-art format:  _____________________  _ |    | long    |logo|   | |    | content |    |   | |    |         |    |   | |    |         |    |   | |grad|         |grad|   | Viewport |    |         |    |   | |    |         |    |   | |    |         |    |  _| |    |         |    | |    |         |    | _____________________  |2em| &lt;-20em-&gt;| 2em|   ..or with short content..  _____________________  _ |    | short   |logo|   | |    | content |    |   | |    |         |    |   | |    |         |    |   | |grad|         |grad|   | Viewport |    |         |    |   | |    |         |    |   | |    |         |    |   | |    |         |    |   | _____________________  _|   Basically it looks like a single column, with a glow as a column either side. Over the left-glow is a logo. When the content is short, it is still the full-height.  I have tried using the , which fixes the middle column, but then the gradients only extend as far as the content (in the left column, a single &amp;nbsp;, in the right column the logo)    Here is what the layout looks like:    And the problem (when the browser window is shrunk vertically):    Finally, the problem HTML/CSS,
555
I have a div with two images and an h1. All of them need to be vertically aligned within the div, next to each other. One of the images needs to be absolute positioned within the div. What is the CSS needed for this to work on all common browsers? &lt;div id=&quot;header&quot;&gt;   &lt;img src=&quot;..&quot; &gt;&lt;/img&gt;   &lt;h1&gt;testing...&lt;/h1&gt;   &lt;img src=&quot;...&quot;&gt;&lt;/img&gt; &lt;/div&gt;
89933
Hi, I want to create a table in my lightning component. I created 2 lightning:input fields and want to change the vertical alignment to "middle" but it does not work.   I tried to do the following:  &lt;td  class="slds-align-middle"&gt;&lt;lightning:input /&gt;&lt;/td&gt;   and this:   &lt;td&gt;&lt;span class="slds-align-middle"&gt;&lt;lightning:input /&gt;&lt;/span&gt;&lt;/td&gt;   and this:  &lt;td Style="text-align: center;vertical-align:top;" valign="middle"&gt;&lt;lightning:input /&gt;&lt;/td&gt;   I am using slds:      &lt;table class="slds-table slds-table_bordered slds-table_cell-buffer slds-table_col-bordered"&gt;      &lt;thead&gt;...&lt;/thead&gt;      &lt;tbody&gt;       &lt;tr&gt; [td in the middle of the cell] &lt;/tr&gt;      &lt;/tbody&gt;     &lt;/table&gt;   I hope someone can help me. Thanks!
76067
In a beamer presentation, I am using the following code to add logos on my title page:  \titlegraphic{   \includegraphics[width=3cm]{logo-lirmm.png}   \hspace*{0.75cm}~%   \includegraphics[width=3cm]{logo-york.png}   \hspace*{0.75cm}~%   \includegraphics[width=3cm]{logo-dc.png} }   This code aligns vertically the three logos at the bottom. How can I center them vertically?
51888
I've been learning LaTeX and this community has been very helpful. Currently, I'm trying to set up corporate letters but as a newbie I'm encountering a  of , so I'm posting them one by one instead of putting it in the comments... maybe this helps others as well.  Anyway, I am trying to implement this  that indicates that I can use vbox to float an image to the right of my header. I almost have this working, but I now try to adjust this to get my logo to stick to the top of the page. So I want to have this at the right top of my document. This is quite difficult! When I place the vbox, it creates unwanted spacing, for some odd reason. So I can not get the logo to be at the right top, even though I 'reset' every possible margin to 0 (in my opinion). Here is my distilled code:  \documentclass[a4paper]{article} \usepackage{graphicx} \graphicspath{{./img/}} \usepackage{color} \usepackage{xcolor} \definecolor{orange}{HTML}{DD4616} \definecolor{white}{HTML}{FFFFFF} \usepackage{fullpage} \usepackage[margin=0cm, paperwidth=215.9mm, paperheight=30mm,top=0cm]{geometry} \parindent=0pt  \begin{document} \fboxsep0pt  \pagecolor{orange}   \fbox{\vbox to 0pt{\hfill\fbox{\includegraphics[height=3cm]{logo}}}}  \end{document}   I've used a full black logo for illustrative purposes. Here you can see this:    The black line is the vbox border. For some reason, it jumps down. The only way to get rid of this that I found out about is this:    Which means that I need to add:  \edef\theprevdepth{\the\prevdepth}\nointerlineskip \vbox to 0pt{...}\prevdepth=\theprevdepth   But there are two problems with this:   I get an error with I try this (Improper \prevdepth.) More importantly, I really want to understand my code at this point, and get to master the basics of positioning elements. This feels overcomplicated and I do not understand it at all.    Is there any easy way to position an image at the right top of a document?
99274
How do I center the text horizontally and vertically in a TextView, so that it appears exactly in the middle of the TextView in Android?
60813
I'm trying to write up a table but I'm missing the vertical rows in the last few columns. Anyone have any clues as to how to fix this?   \setlength\tabcolsep{4pt}  \begin{tabular}{|l|l|l|l|l|}  \cline{2-5}   \multicolumn{1}{l|}{} &amp; Autumn &amp; Pre-requisites &amp; Spring &amp; Pre-requisites \\\hline   \multirow{4}{*}{\textbf{Year 1}} &amp; MATH187 &amp; Either a mark of at least 80 in \\ &amp; &amp; MATH151 OR (in the NSW HSC \\ &amp; &amp; Examination) Mathematics Band \\ &amp; &amp; 4; or Mathematics Ext 1. &amp; MATH188 &amp; MATH187 \\\cline{2-5}                                &amp; MATH100 &amp; None &amp; MATH123 &amp; MATH187 or MATH141 with \\ &amp; &amp; &amp; &amp; co-requisites of MATH188 \\ &amp; &amp; &amp; &amp; or MATH142 \\\cline{2-5}                               &amp; CSIT110 &amp; None &amp; STAT101 &amp; None \\\cline{2-5}                                                                       &amp; ACCY111 &amp; None &amp; ACCY112 &amp; ACCY112 \\\hline \hline       \multirow{4}{*}{\textbf{Year 2}} &amp; MATH201 &amp; One of MATH110, MATH188 or \\ &amp; &amp; MATH283, or a mark of at least \\ &amp; &amp; 75 in MATH142 or MATH162, or \\ &amp; &amp; enrolment in course code 762A. &amp; MATH202 &amp; MATH201 \\\cline{2-5}                               &amp; MATH203 &amp; One of MATH101, MATH188 or \\ &amp; &amp; MATH283 or enrolment in course \\ &amp; &amp; code 762A. &amp; MATH204 &amp; MATH201 \\\cline{2-5}                               &amp; MATH222 &amp; One of MATH101, MATH188 or \\ &amp; &amp; enrolment in course code 762A &amp; MATH212 &amp; One of MATH101, MATH188, \\ &amp; &amp; &amp; &amp; MATH283 or enrolment in \\ &amp; &amp; &amp; &amp; course code 762A \\\cline{2-5}                                   &amp; STAT231 &amp; MATH188 or enrolment in \\ &amp; &amp; course code 762A. &amp; STAT232 &amp; STAT231 \\\cline{2-5}  \hline \end{tabular}   The output I get for the code above is:
93817
There is an alignment issue in the  page, under the Tags section the Add buttons has extra height.  Screenshot for reference:        The alignment issue is in all the Stack Exchange main and meta sites. Not sure this is due to the impact of the recent .
89710
How can I control the vertical space before an environment, e.g., tabular or minipage?   Here is an example that reproduces my problem:   \documentclass{article} \begin{document}     \noindent TEXT-A\vspace{5pt}\\   TEXT-B\\TEXT-C     \\[2em]     \noindent TEXT-D\vspace{5pt}\\   \begin{tabular}{@{}l}TEXT-E\\TEXT-F \end{tabular} \end{document}   The spacing between TEXT-A and TEXT-B is different from the spacing between TEXT-D and TEXT-E:    I have learned so far that the space between TEXT-D and TEXT-E is normal if I delete \\TEXT-F:    Any help would be appreciated!
15263
How can I vertically center the content in the cells of the left table (marked 1) so that it looks like the cells of the right table (marked 2):    My code thus far:  \begin{table}[H]     \setcellgapes{5pt}     \makegapedcells     \caption{Local Area Network vs Wide Area Network.}     \label{tab:lanvswan}     \centering     \begin{tabular}{         &gt;{\centering\arraybackslash}p{3.5cm}         |&gt;{\centering\arraybackslash}p{4.5cm}         |&gt;{\centering\arraybackslash}p{4.5cm}         }         \thead{Características}     &amp; \thead{LAN}                           &amp; \thead{WAN}                                                       \\  \hline         Extensión Geográfica        &amp; Pequeña                               &amp; Extensa                                                           \\  \hline         Dispositivos                &amp; Host, Switches (L2 y L3) y Routers    &amp; Especializados de ATM y Frame Relay, Switches (L3) y Routers      \\  \hline         Tecnologías                 &amp; Ethernet                              &amp; MPLS, ATM, Frame Relay y X.25     \end{tabular} \end{table}
29028
I understand that vertically centering columns can be achieved by using the array package with the m{} column. How do I also specify horizontal alignment?  \documentclass[12pt,letterpaper]{article}  \usepackage{array}  \begin{document} \begin{tabular}{m{5em} m{5em} m{5em}} left &amp; center &amp; right \end{document}
58280
I'm trying to center a fixed size control within a form.  Out of interest, is there a non-idiotic way of doing this? What I really want is something analogous to the text-align css property.  At the moment, I'm setting the padding property of the surrounding form to a suitable size and setting the Dock property of the control to fill.
120282
It's pretty annoying that you can't center text vertically in Ps automatically, like you can in Indd. It's even more annoying that the bounding box of text can't be 'collapsed' or 'fit to text', like in Indd.  I could convert the text to shape, but then I lose coloring. I could convert to smart object, but then its not vector anymore, for when I export to pdf.  Is there a work around anyone knows of that would make it easier to center text vertically?
75417
It seems that the align environment adds additional vertical space if it starts at the top of a page or minipage.  Below are two pages, and two minipages (on Page 1), where the first page/minipage has text followed by an align* environment, and the second page/minipage starts with an align* environment, and note that the equations are still aligned.  Attempted Solution: The closest related question I found was:    I attempted to use the  at the above by adding \setlength\abovedisplayskip{0pt} (after the preamble as per ).  Although, this did move the equations up vertically, they were still vertically aligned:  And since the problem occurs at top of a page as well, I don't think this is related to  Question:  How can I adjust the align environment to automagically not have additional space at the top of a page or minipage? Is there a reason for this behavior, and perhaps should not be changed?  Code: \documentclass{article} \usepackage[showframe,paperwidth=3.5in,paperheight=2.2in,margin=0.5in]{geometry} \usepackage{amsmath}  \begin{document}%\setlength\abovedisplayskip{0pt} Top of Page 1 \begin{align*}% Text above at top of page  e &amp;= m c^2 \end{align*}  \hrule \begin{minipage}[t]{0.45\linewidth}     Top of minipage 1     \begin{align*}% Text above this minipage      e &amp;= m c^2     \end{align*} \end{minipage} \begin{minipage}[t]{0.45\linewidth}     \begin{align*}% No text above in this minipage      e &amp;= m c^2     \end{align*} \end{minipage}  \newpage \begin{align*}% No text above at top of page  e &amp;= m c^2 \end{align*} \end{document}
42134
I wanto to center a text in a colorbox which is scaled horicontal over the complete site.    How is this possible?  \documentclass[ ]{scrreprt}  \usepackage[ ]{scrpage2}  \usepackage[ngerman]{babel}                 %% Deutsches Sprachpaket \usepackage[utf8]{inputenc}                 %% Eingabezeichensatz UTF-8 \usepackage[T1]{fontenc}                    %% Kodierung für Umlaute \usepackage[ngerman]{translator}            %% Für Abkürzungsverzeichnis benötigt \usepackage{lmodern}                        %% Moderne Version von Computer Modern \usepackage{setspace}                       %% Zeileabstand anpassen \usepackage{xcolor}                         %% Definieren von Farben  \begin{document}  \chapter{} \definecolor{lightgray}{gray}{0.5} \newcommand \colbox [1]{\par\noindent\colorbox{gray}{\begin{minipage}{\textwidth}{ {#1}} \hfill \end{minipage}}}  \colbox{TEXT}  \end{document}   Moreover I want to avoid the overfull hbox.