Fiddle:   Description of Issue: I'm using Bootstrap to make some columns within a section. The section has zero height (e.g. height: 0) but 56.25% bottom padding in order to maintain the aspect ratio (16:9) of the other content on the page.  The problem I'm running into is how to vertically center the content within this zero-height, padded element. I've attempted a flexbox solution to no avail. I've tried inline-blocking the content and using vertical-align, which was also a no-go. I'm running out of tricks!  Any help appreciated.  Code:  #section-1 {     background-color: #0099cc;     color: #fff;     height: 0;     padding-bottom: 56.25%; }
42
How can I horizontally center a &lt;div&gt; within another &lt;div&gt; using CSS? &lt;div id=&quot;outer&quot;&gt;   &lt;div id=&quot;inner&quot;&gt;Foo foo&lt;/div&gt; &lt;/div&gt;
96569
The line-height property usually takes care of vertical alignment, but not with inputs. Is there a way to automatically center text without playing around with padding?
69967
Background  Looking to achieve a fairly complex layout from a Markdown source document. The layout resembles:    Code  \usemodule[newcolumnsets,visual]  \setuphead[chapter][   header=empty,   footer=empty,   number=no,   page=yes,   before={\blank[none]},   after={\blank[none]}, ]  \setuphead[section][   number=no,   before={\blank[small]},   after={\blank[small]}, ]  \definepapersize[BookPageSize][   width=601mm,   height=305mm, ]  \definelayout[BookPageLayout][   backspace=10mm,   cutspace=10mm,   width=585mm,   height=147mm,   topspace=10mm,   header=0mm,   footer=0mm, ]  \setuppapersize[BookPageSize] \setuplayout[BookPageLayout]  % No page number at the top. \setupheadertexts[] \setupfootertexts[]  \setupindenting[yes, small]  \definecolumnset[BookColumns][n=4,distance=0.0333\makeupwidth]  % left page (even page numbers) \setupcolumnset[BookColumns:1][width=.5\makeupwidth] \setupcolumnset[BookColumns:2][width=.125\makeupwidth] \setupcolumnset[BookColumns:3][width=.125\makeupwidth] \setupcolumnset[BookColumns:4][width=.125\makeupwidth] % right page (odd page numbers) \setupcolumnset[BookColumns:5][width=.5\makeupwidth] \setupcolumnset[BookColumns:6][width=.125\makeupwidth] \setupcolumnset[BookColumns:7][width=.125\makeupwidth] \setupcolumnset[BookColumns:8][width=.125\makeupwidth]  \definecolumnsetspan[BookIllustration][n=4]  \starttext   \startbodymatter     \startcolumnset[BookColumns]       \chapter[title={Title},reference={title}]       \subsection[title={Subsubtitle},reference={subsubtitle}]       \column        \input ward        \section[title={Subtitle},reference={subtitle}]        \input knuth       \input tufte        \section[title={Subtitle},reference={subtitle}]        \startformula  \frac{\dot{R}^2}{R^2} = \frac{8\pi G}{3}\rho - \frac{kc^2}{R^2}  \stopformula        \startformula  \frac{\ddot{R}}{R} = -\frac{4\pi G}{3} \left(\rho + \frac{3p}{c^2}\right)  \stopformula        \input tufte        \placefigure[bots]{}{\externalfigure[https://i.imgur.com/nSBuPAA.jpg][width=\paperwidth]}     \stopcolumnset   \stopbodymatter \stoptext   This code produces the following, which is pretty close:    Problems  There are a few issues:   The fourth column contains a lot of whitespace at the top. The second column contains garbled text (could be a page height issue). The image is displayed on the second page.   Questions  How can I resolve these issues without changing the body matter, but affording some tweaks to \placefigure such that:   the last column is aligned to the top; the garbled text does not appear; and the image is on the same page as the text?   Version  Using ConTeXt 2019.04.04 13:31.
31813
Although elements like &lt;div&gt;s normally grow to fit their contents, using the float property can cause a startling problem for CSS newbies: If floated elements have non-floated parent elements, the parent will collapse. For example:   &lt;div&gt;   &lt;div style="float: left;"&gt;Div 1&lt;/div&gt;   &lt;div style="float: left;"&gt;Div 2&lt;/div&gt; &lt;/div&gt;    The parent div in this example will not expand to contain its floated children - it will appear to have height: 0. How do you solve this problem? I would like to create an exhaustive list of solutions here. If you're aware of cross-browser compatibility issues, please point them out. Solution 1 Float the parent.   &lt;div style="float: left;"&gt;   &lt;div style="float: left;"&gt;Div 1&lt;/div&gt;   &lt;div style="float: left;"&gt;Div 2&lt;/div&gt; &lt;/div&gt;    Pros: Semantic code. Cons: You may not always want the parent floated. Even if you do, do you float the parents' parent, and so on? Must you float every ancestor element? Solution 2 Give the parent an explicit height.   &lt;div style="height: 300px;"&gt;   &lt;div style="float: left;"&gt;Div 1&lt;/div&gt;   &lt;div style="float: left;"&gt;Div 2&lt;/div&gt; &lt;/div&gt;    Pros: Semantic code. Cons: Not flexible - if the content changes or the browser is resized, the layout will break. Solution 3 Append a &quot;spacer&quot; element inside the parent element, like this:   &lt;div&gt;   &lt;div style="float: left;"&gt;Div 1&lt;/div&gt;   &lt;div style="float: left;"&gt;Div 2&lt;/div&gt;   &lt;div class="spacer" style="clear: both;"&gt;&lt;/div&gt; &lt;/div&gt;    Pros: Straightforward to code. Cons: Not semantic; the spacer div exists only as a layout hack. Solution 4 Set parent to overflow: auto.   &lt;div style="overflow: auto;"&gt;   &lt;div style="float: left;"&gt;Div 1&lt;/div&gt;   &lt;div style="float: left;"&gt;Div 2&lt;/div&gt; &lt;/div&gt;    Pros: Doesn't require extra div. Cons: Seems like a hack - that's not the overflow property's stated purpose. Comments? Other suggestions?
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?
73817
I am trying to create a simple page using Bootstrap within salesforce. I need this page to have the standard salesforce header and sidebar.  When I use the standard bootstrap library via a CDN and the page is affecting all the CSS styling for my standard salesforce headers and side bars. Any help on how to prevent this ?
36692
I work in Beamer extensively (specifically the Madrid theme). Sometimes, my "title" is quite long. Beamer puts this title at the bottom, but when it's too long it cuts it off. I'd really like to know how to increase the size of the bottom middle rectangular footer.    Here's the code (sorry for all of the packages and commands):  \documentclass[t]{beamer} %Add "mathserif" to script math lettering. "t" places all text to start at the top of each slide \usetheme{Madrid}  %Packages  \usepackage{amsmath} %Math mode \usepackage{amssymb} %Math mode \usepackage{commath} \usepackage{graphicx} %Including pictures \usepackage{color} %Define colours \usepackage{setspace} %Enables double-spacing/variable spacing \usepackage{pgfplots} %Draw graphs \usepackage{upgreek} %Insert theta symbol as unitalicized  \usepackage[version=3]{mhchem} %Chemistry equation mode \ce{} \usepackage[export]{adjustbox} %Place black borders around images \usepackage{scrextend} %Used to change font size \usepackage{caption} %Used to utilize * in caption function \usepackage{subfig} %Used to place figures side-by-side with sub-captions \usepackage{siunitx} %SI Units (+ scientific notation) \usepackage{cancel} \usepackage{fancybox} %\usepackage{enumitem} %Making lists %\usepackage[english]{babel} %Lists with letters  %Erases Beamer Navigation Symbols on the bottom left \setbeamertemplate{navigation symbols}{}  %\setbeamertemplate{footline}{} \captionsetup[subfigure]{labelformat=empty}  %Defined Colours \definecolor{orangered}{RGB}{255,69,0} \definecolor{darkgreen}{RGB}{0,100,0}  \definecolor{firebrick}{RGB}{178, 34, 34} \definecolor{navy}{RGB}{0,0,128} \definecolor{lightsteelblue}{RGB}{176,196,222} \definecolor{steelblue}{RGB}{70,130,180} \definecolor{darkslateblue}{RGB}{72, 61, 139} \definecolor{forestgreen}{RGB}{34, 139, 34} \definecolor{Gold}{RGB}{218,165,32}  %Defined Colour Theme and List Sizing \setbeamercolor{structure}{fg = Gold} \setbeamertemplate{navigation symbols}{}  \setbeamerfont*{itemize/enumerate body}{size=\normalsize} \setbeamerfont*{itemize/enumerate subbody}{parent=itemize/enumerate body} \setbeamerfont*{itemize/enumerate subsubbody}{parent=itemize/enumerate body}  %Opening Title Page \title{Chapter 7 - Absolute Value and Reciprocal Functions} \subtitle{Section 7.3 - Absolute Value Equations} \date{}  \begin{document}     %Slide 1     \maketitle \end{document}
4125
I want to create a table with multiple rows of the following form: a cell that contains text and then multiple cells that contain images. The text should be vertically centered and the contents of every column should also be centered horizontally. I am aware of the m{} column type but somehow this seems to fail if an image is contained in the row and determines the row height. Any ideas?  Minimal example:  \documentclass{article} \usepackage{graphicx} \usepackage{array} \begin{document} \begin{figure} \begin{tabular}{m{3cm}c} (a) &amp; \includegraphics{some_picture.pdf}\\ \end{tabular} \end{figure}  \end{document}
9647
Given the following HTML:   &lt;div id="container"&gt;   &lt;!-- Other elements here --&gt;   &lt;div id="copyright"&gt;     Copyright Foo web designs   &lt;/div&gt; &lt;/div&gt;    I would like #copyright to stick to the bottom of #container. Can I achieve this without using absolute positioning?
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?
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?
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!
9513
I want my chapter titles to look like as asked in this . I have followed the method suggested by "lockstep", that is, using package titlesec. It works perfectly fine but here is the question: I want this format for main chapters only and for the rest, that is Contents, Declaration, Index, Bibliography etc I want them centered with normal vertical spaces before and after the title. Pasting the code at the start of Chapter 1 solves the problem partially; it leaves the starting ones (contents, declaration) totally unchanged and applies the same format to Index and Bibliography. Please help.
1077
I have a div 200 x 200 px. I want to place a 50 x 50 px image right in the middle of the div.   How can it be done?  I am able to get it centered horizontally by using text-align: center for the div. But vertical alignment is the issue..
10949
I have multiple figures placed in my document (all of which are using [htbp], [ht] etc. and are placed correctly). The last figure receives a separate page (which is alright) but it's centered on this page, which looks weird as the figure is quite small.  Is there any way to get this figure on top of this page? As written above, its a separate page and the last one in this chapter.  I can't really provide a minimal example (since I guess that the position depends on my previous figures), but here's the code I use for the figure (I've tried [ht], [ht!], [htbp] etc but none of them work - I've also deleted the .aux files before compiling):  \begin{figure}[t!] \centering \begin{tabularx}{\columnwidth}{cc} \subfloat[Results 1] { \centering    \includegraphics[width=0.47\textwidth,height=0.47\textheight,keepaspectratio]{images/plot1} } &amp; \subfloat[Results 2] { \centering    \includegraphics[width=0.47\textwidth,height=0.47\textheight,keepaspectratio]{images/plot2} } \end{tabularx} \caption{Blabla} \end{figure}   Thanks in advance!
5071
I just noticed that here on meta the footer doesn't stick to the bottom of the page, I know that it's not that big of a deal but it does look a bit clumsy.    Shouldn't there be an easy fix for this?  EDIT:  Since this has been reproduced and discussed by some members I was wondering if anyone is actually trying to fix this?  EDIT: (imported from , )  #footer.categories #svnrev has margin-bottom: 10px;. It should have margin:0, or be moved alongside #copyright.
122554
I have a Twitter Bootstrap based table with responsive CSS. Everything looks good but, when I try to put more columns than the size of the table supports, I have a line breaking. I tried to change font size. But I think it would be strange or confusing for the user if I have different font sizes in each table. So I am in a dead end. Some restrictions  Maximum width: The table must not exceed 940 pixels. Single Table: I can't divide the information in multiple tables.  This is what I have:  Is there a better way to display tabular data considering the restrictions?