I have the following markup:  &lt;div class="wrapper"&gt;   &lt;div class="block new-block"&gt;&lt;/div&gt;   &lt;div class="block used-block"&gt;&lt;/div&gt;   &lt;div class="block service-block"&gt;&lt;/div&gt;   &lt;div class="block certified-block"&gt;&lt;/div&gt;   &lt;div class="block offer-type-block"&gt;&lt;/div&gt; &lt;/div&gt;   And the following css with it:  .wrapper {   width : 800px;   height : 100px;   background : #393533;   margin : auto; }  .block {   width : 19%;   height : 80px;   background : salmon;   display : inline-block; }   I want to center the inner 5 divs horizontally and vertically in the container wrapper container, how can I achieve this using css. Thanks ahead!
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?
51545
Does anyone know how to make text align top-to-bottom in a div.  SO won't even let me demonstrate it . . . I just want the letters to stack on top of each other in a vertical line down the page like the stories of a building. Was hoping I didn't need to do it with an image.
75501
I'm using the \align* environment from the amsmath package.  How can I center one of the lines inside the environment?  In the following example, I want to the \vdots to be centered, instead of awkwardly aligned with the b above it.  \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} &amp; a = (a_1, a_2) \\ &amp; b = (b_1, b_2) \\ &amp; \vdots \\ &amp; z = (z_1, z_2) \end{align*} \end{document}
32505
After reading this question , I want to know the answer of the following.  When should we use \begin{center} instead of \centering?  For example, should we use this one?  {% \centering &lt;other contents&gt; }   or this one?  \begin{center} &lt;other contents&gt; \end{center}
14534
I created a horizontal menu using a HTML lists and CSS. Everything works as it should except when you hover over the links. You see, I created a bold hover state for the links, and now the menu links shift because of the bold size difference.  I encounter the same problem as . However, the post does not have proper solution. I've searched everywhere for a solution and can't find one. Surely I can't be the only one trying to do this.  Does anyone have any ideas?  P.S: I don't know the width of the text in menu items so I cannot just set the width of the li items.    .nav { margin: 0; padding: 0; } .nav li {      list-style: none;      display: inline;      border-left: #ffffff 1px solid;  } .nav li a:link, .nav li a:visited {      text-decoration: none;      color: #000;      margin-left: 8px;      margin-right: 5px;  } .nav li a:hover{      text-decoration: none;      font-weight: bold;  } .nav li.first { border: none; } &lt;ul class="nav"&gt;     &lt;li class="first"&gt;&lt;a href="#"&gt;item 0&lt;/a&gt;&lt;/li&gt;     &lt;li&gt;&lt;a href="#"&gt;item 1&lt;/a&gt;&lt;/li&gt;     &lt;li&gt;&lt;a href="#"&gt;item 2&lt;/a&gt;&lt;/li&gt;     &lt;li&gt;&lt;a href="#"&gt;item 3&lt;/a&gt;&lt;/li&gt;     &lt;li&gt;&lt;a href="#"&gt;item 4&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;
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?
3041
In a web application, I have a page that contains a DIV that has an auto-width depending on the width of the browser window.  I need an auto-height for the object.  The DIV starts about 300px from the top screen, and its height should make it stretch to the bottom of the browser screen.  I have a max height for the container DIV, so there would have to be minimum-height for the div.  I believe I can just restrict that in CSS, and use Javascript to handle the resizing of the DIV.  My javascript isn't nearly as good as it should be.  Is there an easy script I could write that would do this for me?  Edit:  The DIV houses a control that does it's own overflow handling (implements its own scroll bar).
29940
How can I add horizontal line after header and before footer?   header ---------  --------- footer
20717
What is the best way to vertically center the content of a div when the height of the content is variable.  In my particular case, the height of the container div is fixed, but it would be great if there were a solution that would work in cases where the container has a variable height as well. Also, I would love a solution with no, or very little use of CSS hacks and/or non-semantic markup.
42944
Consider this example:  \begin{enumerate}     \item Blablabla bla bla bla.         \begin{tabular}{l}             Lorem ipsum dolor sit amet.\\             Consectetur adipiscing elit.\\             Donec eu ante non mi sagittis molestie.\\         \end{tabular}     \item Next question \end{enumerate}   LaTeX will vertically center the table, which looks pretty weird. It basically looks like this:                            Lorem ipsum dolor sit amet. 1. Blablabla bla bla bla. Consectetur adipiscing elit.                           Donec eu ante non mi sagittis molestie.   How can I manage for the consecutive lignes to line up under the first one (with the same margin)? Something which would look like this:  1. Blablabla bla bla bla. Lorem ipsum dolor sit amet.                           Consectetur adipiscing elit.                           Donec eu ante non mi sagittis molestie.   Any ideas?  Thanks!
121259
I have the following table:  \begin{tabular}{|p{3cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|} \hline \centerline {image}  &amp;    \multicolumn{2}{c|}{ABC} &amp; \multicolumn{2}{c|}{DEF} \\ \hline  &amp; \centering A&amp;\centering B&amp;\centering C&amp;\centering D  \\ \hline \centerline 1&amp;&amp;&amp;&amp; \\ \hline \centerline 1&amp;&amp;&amp;&amp; \\ \hline \centerline 1&amp;&amp;&amp;&amp; \\ \hline \centerline 1&amp;&amp;&amp;&amp; \\ \hline \end{tabular}   When I try centering D, I have a problem in the shape of the table. Why is that? How can I center it appropriately?  Thanks.
83912
I'm trying to use an image as a background for Beamer presentation according to  post.  However, I do not want the image spanning the entire background. Thus, I'm doing something like:  \usebackgroundtemplate{% \centering \hspace{4.5cm} \includegraphics[width=1.5in]{image.jpeg} }   The \hspace command works, but \vspace does not work. Basically, I'm trying to get the image to be at the center of the page. Any ideas on how this can be done?
65063
Hi I am wondering whether it is possible to place the beamer footnotes into multiple columns or display as horizontal, instead of vertical.   \documentclass{beamer} \usepackage{booktabs} \begin{document}  \begin{frame} \begin{table}[htbp]   \centering %  \caption{Add caption}             \resizebox{\textwidth}{!}{%     \begin{tabular}{rrr}     \toprule     \centering     Animal estimated by tracking  &amp; \textbf{2 Equation approach} &amp; 1 Equation \\     50\%   &amp; $\frac{\partial C\footnote{dye }(t,\vec{x})}{}$      &amp;  \\      &amp;  $\frac{\partial \alpha\footnote{age }(t,\vec{x})}{}$     &amp; $\frac{\partial A\footnote{A refers to "animal"}}{}$ \\     \bottomrule     \end{tabular}}% %  \label{tab:addlabel}% \end{table}% \end{frame} \end{document}   I would appreciate if anyone could explain me how to get the horizontal footnotes.
102812
&lt;div class="subheader"&gt;         &lt;h1&gt;         &lt;/h1&gt; &lt;/div&gt;   .subheader has style border-bottom: 1px solid #e4e6e8;.  The bottom border should be below the whole title (I guess, the point is to separate the whole title). But the height of this div is hardcoded height: 40px;.  Shouldn't it be like this? (the screenshot with height: 80px;).
13086
I want to put two &lt;div&gt;s next to each other. The right &lt;div&gt; is about 200px; and the left &lt;div&gt; must fill up the rest of the screen width? How can I do this?
35
Why won't vertical-align: middle work?  And yet, vertical-align: top does work.   span{   vertical-align: middle; } &lt;div&gt;   &lt;img src="https://via.placeholder.com/30" alt="small img" /&gt;   &lt;span&gt;Doesn't work.&lt;/span&gt; &lt;/div&gt;
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?