I'm new to frontend web coding and I wanted to make a mockup website to speed up my learning process. I wanted to make the sign-in part align in the middle of the page, i found some tutorial using flex-grow so it would scale with size, but this is what I got instead:    What did I do wrong?  (I only posted snippets of code I think would matter not to complicate things)    .sign-in {   display: flex;   justify-content: space-between;   align-items: center;   flex-grow: 1;   **&lt;THE PART WHERE THE PROBLEM ARISES&gt;** }  .sign-in-text {   display: flex;   align-items: left;   flex-direction: column;   font-size: 3.5em;   font-weight: bold;   margin: 0;   padding: 0; }  .not-sign-in-text {   font-size: 2rem;   padding: 0;   margin: 0; }  .miss-you {   font-size: 1.5rem;   font-weight: 500; }  .sign-in-form {   display: flex;   align-items: left;   flex-direction: column; } &lt;!DOCTYPE html&gt; &lt;html lang="en"&gt;  &lt;head&gt;   &lt;meta charset="UTF-8"&gt;   &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;   &lt;link href="style.css" rel="stylesheet" /&gt;   &lt;link href="index.css" rel="stylesheet" /&gt;   &lt;title&gt;ELOHSSA&lt;/title&gt;   &lt;header class="secondary"&gt;     &lt;section class="sign-in"&gt;        &lt;h1 class="sign-in-text"&gt;         sign in.         &lt;span class="miss-you"&gt;                                 We missed you already :(                                 &lt;/span&gt;       &lt;/h1&gt;         &lt;form class="sign-in-form"&gt;         &lt;div class="information"&gt;           &lt;label&gt; Username: &lt;/label&gt;           &lt;input type="text"&gt;         &lt;/div&gt;         &lt;div class="information"&gt;           &lt;label&gt; Password:&lt;/label&gt;           &lt;input type="password"&gt;         &lt;/div&gt;         &lt;div class="information"&gt;           &lt;button type="submit" class="button"&gt;                                         Sign in.                                     &lt;/button&gt;         &lt;/div&gt;       &lt;/form&gt;     &lt;/section&gt;   &lt;/header&gt;  &lt;/html&gt;     Thanks for helping!
571
I am working on a web application where I want the content to fill the height of the entire screen.  The page has a header, which contains a logo, and account information. This could be an arbitrary height. I want the content div to fill the rest of the page to the bottom.  I have a header div and a content div. At the moment I am using a table for the layout like so:  CSS and HTML    #page {     height: 100%; width: 100% }  #tdcontent {     height: 100%; }  #content {     overflow: auto; /* or overflow: hidden; */ } &lt;table id="page"&gt;     &lt;tr&gt;         &lt;td id="tdheader"&gt;             &lt;div id="header"&gt;...&lt;/div&gt;         &lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;         &lt;td id="tdcontent"&gt;             &lt;div id="content"&gt;...&lt;/div&gt;         &lt;/td&gt;     &lt;/tr&gt; &lt;/table&gt;     The entire height of the page is filled, and no scrolling is required.  For anything inside the content div, setting top: 0; will put it right underneath the header. Sometimes the content will be a real table, with its height set to 100%. Putting header inside content will not allow this to work.  Is there a way to achieve the same effect without using the table?  Update:  Elements inside the content div will have heights set to percentages as well. So something at 100% inside the div will fill it to the bottom. As will two elements at 50%.  Update 2:  For instance, if the header takes up 20% of the screen's height, a table specified at 50% inside #content would take up 40% of the screen space. So far, wrapping the entire thing in a table is the only thing that works.
81599
My only problem is making them line up three-across and have equal spacing. Apparently, spans can not have width and divs (and spans with display:block) don't appear horizontally next to each other. Suggestions?  &lt;div style='width:30%; text-align:center; float:left; clear:both;'&gt; Is what I have now.
120595
I'm having this problem, same as ever, but never try to find the right solution  code:   &lt;div id="ListOfTextAndPhotos"&gt;       &lt;div style="border-bottom: solid 1px silver;"&gt;           &lt;img src="photo.jpg" style="float: left"&gt;           Some text about the photo       &lt;/div&gt;       &lt;div style="border-bottom: solid 1px silver;"&gt;           &lt;img src="photo2.jpg" style="float: left"&gt;           Some text about the photo2       &lt;/div&gt;       &lt;div style="border-bottom: solid 1px silver;"&gt;           &lt;img src="photo3.jpg" style="float: left"&gt;           Some text about the photo3       &lt;/div&gt;   &lt;/div&gt;   Question: How do I to keep the photo inside the DIV? with the separator line under the photo
4829
I have a webpage with an elastic layout that changes its width if the browser window is resized.  In this layout there are headlines (h2) that will have a variable length (actually being headlines from blogposts that I don't have control over). Currently - if they are wider than the window - they are broken into two lines.  Is there an elegant, tested (cross-browser) solution - for example with jQuery - that shortens the innerHTML of that headline tag and adds "..." if the text would be too wide to fit into one line at the current screen/container width?
104381
I asked this question at stackoverflow and have been kindly redirected here.  I'd like to align some equations in Latex using the AMS packages. Each equation has two equal signs that need to be aligned. So something in the line of  A = B = C D = E = F   I've tried using the align-environment like this  \begin{align} A &amp;= B &amp;= C \\ D &amp;= E &amp;= F \end{align}   This works in principle (it aligns), however it adds ridiculously large spaces before the second equal sign in each line. But I just want the line to runs as if there was no additional alignment tab. Only when I replace for example "B" by "BBB" I want the equal sign before "F" to shift to right the exact amount of space.  Could anyone help me out on that one? It's kind of driving me crazy since I don't get the idea of that strange behavior and I just can't find any solution. Maybe alignat could help, but I don't really get how that environment works.  Cheers, Oliver
6298
Best way to center a &lt;div&gt; element on a page both vertically and horizontally?  I know that margin-left: auto; margin-right: auto; will center on the horizontal, but what is the best way to do it vertically, too?
68895
This code:  \begin{figure*}[t] \begin{center}         \begin{subfigure}[a]{0.3\textwidth}                 \label{im:device_front}         \includegraphics[width=\textwidth]{images/bsn_side}         \caption{a) Frontal view of the sensor system}     \end{subfigure}                 \quad         \begin{subfigure}[b]{0.3\textwidth}                 \label{im:device_schuin}         \includegraphics[width=\textwidth]{images/bsn_front}         \caption{b) Perspective view of the sensor system}     \end{subfigure}              \quad     \begin{subfigure}[b]{0.25\textwidth}                 \label{im:device_side}         \includegraphics[width=\textwidth]{images/bsn_schuin}         \caption{c) Side view of the sensor system}     \end{subfigure}  \caption{Overview of the system as worn by the subjects} \label{default} \end{center} \end{figure*}   produces result:    But I want them to be vertically aligned. How can I do this?
4175
I have equations inside an environment which has a larger left-margin than the main text (analogous to an enumerate/itemize environment, implemented with the changepage package's adjustwidth environment). Just as equations in enumerate/itemize behave, the equations are centered with respect to the entire text, rather than just the width of the container environment. I want the latter behavior.  I'm trying to accomplish this by wrapping all display-math in minipages. Namely, I'm modifying the mathdisplay environment in amsmath.sty as follows:  \makeatletter \let\oldmd\mathdisplay \def\mathdisplay#1{%   \newline   \begin{minipage}{\textwidth-\@totalleftmargin}%     \oldmd{#1}% } \let\oldendmd\endmathdisplay \def\endmathdisplay#1{%   \oldendmd{#1}%   \end{minipage} } \makeatother   This is almost working, but there are some issues with spacing which I don't understand how to fix. Here's how the the normal \[ ... \] and numbered \begin{equation} ... \end{equation} look with the above modification:      My main confusion is why the numbered version is behaving so differently from the unnumbered. But all in all I want to fix this so that the spacing above and below is even as it usually is. Any help is appreciated, thanks.  Edit: Here's a compilable example:  \documentclass{amsart}  \usepackage{lipsum} \usepackage{calc} \usepackage{changepage}  \makeatletter \let\oldmd\mathdisplay \def\mathdisplay#1{%   \newline   \begin{minipage}{\textwidth-\@totalleftmargin}%     \oldmd{#1}% } \let\oldendmd\endmathdisplay \def\endmathdisplay#1{%   \oldendmd{#1}%   \end{minipage} } \makeatother  \setlength{\parindent}{0pt}  \begin{document}  \lipsum[1]  \begin{adjustwidth}{20pt}{} \lipsum[2] \[ x \mapsto \hom(-,x) \]  \lipsum[3] \begin{equation}   y \mapsto \hom(y,-) \end{equation} \lipsum[4] \end{adjustwidth}  \lipsum[5]  \end{document}
98383
In the following piece of code  \begin{align*} [x \mapsto s]x &amp;= s \\ [x \mapsto s]y &amp;= y \qquad \text{als } y\neq x \\ [x \mapsto s](\la{y}t_1) &amp;= \la{y}[x \mapsto s]t_1 \qquad \text{als } y \neq x \text{ en   } y \not \in FV(s) \\ [x \mapsto s](t_1 \; t_2)&amp;= ([x \mapsto s]t_1)\;([x \mapsto s]t_2) \end{align*}   I am currently only aligning on the = sign. Is it however also possible to align on more than one place in the environment? I would also like the \text to be aligned, as wel as the begining of each new line.
118601
I have the following page which I am trying to get the first line to be centered without affecting the other text. However, using \centerline{} seems to ignore the page margin and does not wrap text to fit the original margin.    \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \usepackage{hyperref} \begin{document} \centerline{\textbf{\large{Appendix \hypertarget{Appendix}{F}: Construction of the Managerial Performance Indicator (MSI)}}}  \vspace{0.5 cm}  This text is just for the example \end{document}
88652
I set my \textwidth and \textheight in the preamble and would like to change both for some pages. How can this be done? E.g., the following example for \textwidth appears to work for the page number, but not for the text:  \documentclass{article}  \textwidth=5cm \textheight=5cm \begin{document} A \hfill B \eject \textwidth=10cm A \hfill B \end{document}   Output (true to scale):
18719
This is one of the minor CSS problems that plague me constantly. How do folks around Stack Overflow vertically align checkboxes and their labels consistently cross-browser? Whenever I align them correctly in Safari (usually using vertical-align: baseline on the input), they're completely off in Firefox and IE. Fix it in Firefox, and Safari and IE are inevitably messed up. I waste time on this every time I code a form. Here's the standard code that I work with:   &lt;form&gt;     &lt;div&gt;         &lt;label&gt;&lt;input type="checkbox" /&gt; Label text&lt;/label&gt;     &lt;/div&gt; &lt;/form&gt;    I usually use Eric Meyer's reset, so form elements are relatively clean of overrides. Looking forward to any tips or tricks that you have to offer!
86942
I have a container div that holds two internal divs; both should take 100% width and 100% height within the container.  I set both internal divs to 100% height. That works fine in Firefox, however in IE the divs do not stretch to 100% height but only the height of the text inside them.  The following is a simplified version of my style sheet.  #container {    height: auto;    width: 100%; }  #container #mainContentsWrapper {    float: left;     height: 100%;    width: 70%;    margin: 0;    padding: 0; }   #container #sidebarWrapper {          float: right;     height: 100%;    width: 29.7%;    margin: 0;    padding: 0; }   Is there something I am doing wrong? Or any Firefox/IE quirks I am missing out?
61850
I'm trying to horizontally center a &lt;div&gt; block element on a page and have it set to a minimum width. What is the simplest way to do this? I want the &lt;div&gt; element to be inline with rest of my page. I'll try to draw an example:  page text page text page text page text page text page text page text page text                -------                | div |                ------- page text page text page text page text page text page text page text page text
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 .
6523
I am trying to achieve a table where a few things have to work simultaneously. Several of these things have been discussed before, but I have been unable to make everything work at once (and some things at all).  I want to be able to use different font sizes in cells on the same row, and have them precisely aligned at the top. That has almost been achieved in the MWE below, but the letters of the smaller font are slightly below the letters of the larger font. (Previous discussion: , but the alignment is only close, not perfect.)  Edit: The top alignment should be for the maximum height of the font used, so that an 'a' ends up at the same height whether it is written by itself or followed by a tall letter, such as an 'l' (or, if the small 'b' next to the big 'B' in the example below is changed for a small 'a', the 'a' should not jump up to the ceiling.  I also want to be able to insert several rows of text with forced line breaks within a cell of the table, and those rows need to have the same spacing between them as normal text has. That has been achieved by nesting another table in a cell in the MWE below.  In addition, I want to be able to use \hfill to put something out in the right margin from within the nested table, which works in the MWE.  Further, the margins on the top, bottom and sides of the table should be zero, so that only the page margins determine the amount of white space around the table (as it is now, there is even a difference between the right and left margins -- although the margins were for some reason adjusted when I uploaded the pdf below, it is visible if you compile the code and look at the pdf directly).  Lastly, I would like to get rid of all automatic spacing between cells, and then define my own spacing. Preferably, I would like to be able to define the vertical spacing between cells in terms of line heights (for lines of the size that I specify for normal text, so 11pt in the example below), while the units of horizontal spacing would preferably be defined in terms of "the width of an 'm'", or something like that.  \documentclass[paper=a4,fontsize=11pt]{scrartcl} % KOMA-article class \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} % English language/hyphenation \usepackage{geometry} \usepackage{tabu} \usepackage{lipsum}  \pagestyle{empty} % No pagenumbers/headers/footers  \newcolumntype{V}{&gt;{\vspace{0pt}}p}  \begin{document} \begin{tabular} [t]{@{}V{0.2\columnwidth}V{0.8\columnwidth}} % @{} is used to remove the margins from cells \Huge\textbf A &amp; \begin{tabular}[t]{@{}p{0.8\columnwidth}} Lorem ipsum \hfill right-aligned\\ sem.\\ Lorem\\ ipsum \end{tabular} \\  \Huge\textbf B &amp; b \\  \Huge\textbf C &amp; \lipsum*[1] \\  \end{tabular} \end{document}     Edit 2013-03-25: I tried a different approach (with minipages) and asked a question: . As of writing this, I have one answer that is similar to the accepted answer below. It achieves correct spacing, but is limited to different sizes in the left column (if one wants to use \hfill in the right column), and the top alignment for the \Huge text is not perfect.  Edit 2013-03-25: I got an answer in the thread  where \strut was used to add space, and \vphantom{Qp} (adds the vertical space of what is written in the braces(Qp in this example)). That could most likely be used here to, to get the correct spacing between cells even if only short letters or letters that do not protrude downwards are used.
67778
I'm using the following code. What should I do if I don't want the fixed indent from the left margin of my page? ‎  \documentclass[‎fleqn,oneside‎]{article}‎ ‎\usepackage{amsmath}‎ .... \begin{align} a_1&amp; =b_1+c_1\\ a_2&amp; =b_2+c_2-d_2+e_2 \end{align}