I am trying to center the boxes horizontally. Currently they are aligned to the left and when you resize the window they move responsively. I would still like to keep that functionality. I just want to center the boxes even when I resize the window. I tried float:center but there is no such thing...Thank you.    .mybtn { font:bold 20px"Arial Black", Gadget, sans-serif; font-style:normal; color:#ffd324;  background-color: rgba(255,0,0,.90); border:2px solid #000; text-shadow:0px -1px 1px #222222; box-shadow:0px 0px 12px #2e2300; -moz-box-shadow:0px 0px 12px #2e2300; -webkit-box-shadow:0px 0px 12px #2e2300; border-radius:15px 15px 15px 15px; -moz-border-radius:15px 15px 15px 15px; -webkit-border-radius:15px 15px 15px 15px; width:100px; height:100px; margin:5px; float:left; position:relative; }   And the HTML  &lt;div class="mybtn"&gt;  &lt;/div&gt;  &lt;div class="mybtn"&gt;  &lt;/div&gt;  &lt;div class="mybtn"&gt;  &lt;/div&gt;  &lt;div class="mybtn"&gt;  &lt;/div&gt;  &lt;div class="mybtn"&gt;  &lt;/div&gt;
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;
38137
How can I center the column when using X in tabularx environment like in this example?  \begin{tabularx}{\textwidth}{@{}lXXXXX@{}}  1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 \\    \end{tabularx}
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.
51680
I am using  \resizebox{\columnwidth}{!}{% ... %}   to fit a table which might be too wide onto a page by scaling it down.  However, my problem is that if the table is smaller than the column width, it gets scaled up, which looks really ugly, and, more importantly, it can then become too long to fit on the page.  So how do I change above to either shrink it or keep it the same, but not scale it up?  I need something along the lines of  \resizebox{min(\columnwidth,\originalwidth)}{!}{% ... %}
115468
In my large latex document, I have some figures which take a considerable height of the page (80-95%). Latex puts each of these figures alone on a page, aligned on top. I would like to have each figure aligned vertically to center. Is that possible, and if so, how? :)
112644
How do I make the cross-browser (including Internet Explorer 6) transparency for the background of a div while the text remains opaque?  I need to do it without using any library such as jQuery, etc. (But if you know of a library that does it I'd love to know so I can look at their code).
5489
I have this MWE:  \documentclass{article} \usepackage{multirow} \begin{document}     \begin{table}[here]         \begin{center}             \begin{tabular}{|l|l|c|}             \hline              \multicolumn{2}{|c|}{\textbf{SED}} &amp; \multirow{2}{*}{\textbf{\% compressione}} \\             \cline{1-2}             \textbf{MC} &amp; \textbf{DP} &amp; \\              \hline              \hline             0.00016032 &amp; 0.0001750267 &amp; 10\%\\             \hline             \end{tabular}          \end{center}     \end{table} \end{document}   It realizes this image:   The first two columns are correctly formatted to the left, but I want it so that just MC and DP will be centered, how can I do that?
30295
#container {     width: 75%;     float: right; }   If I change the width to %100 it affects the entire site, i just want the homepage to be at 100% width and all other pages with sidebar 75%
4073
how could i vertically center a &lt;div&gt; within a &lt;div&gt; ?  my code so far:  &lt;div style="height:322px;overflow:auto;"&gt;     &lt;div style="border: Solid 1px #999999;padding:5px;"&gt;     &lt;/div&gt; &lt;/div&gt;   i have tried "top:50%;" and "vertical-align:middle;" without success  EDIT: okay so it's been discussed a lot. and i've maybe started another mini flame war. but for argument sake, how would i do it with a table then? i've used css for everything else so far so it's not like i'm not trying to employ "good practices".  EDIT: the inner div does not have a fixed height
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}
66310
I am doing a proof of concept with responsive design. One web page that I am modifying has some extremely wide tables. I really don't know how to shrink the tables width so there is no horizontal scroll bar in a mobile browser.  I was just wondering if anyone had the same issue with wide tables and what they did to overcome a horizontal scroll bar in a mobile browser using responsive design. Oh and I wanted to add that I can not hide columns in the table.
78073
I need to put some text at the same height in my page, and I'm trying to do it with a minipage, but I'm not able to do it since they get centre-aligned.    This is the LaTeX for the figure I've uploaded:  \begin{minipage}[]{0.5\textwidth}     \begin{flushleft}         {\large \textit{Author}:\vspace*{0.5cm} \\          Me}     \end{flushleft} \end{minipage}% % \begin{minipage}[]{0.5\textwidth}     \begin{flushright}         {\large \textit{Supervisor}:\vspace*{0.5cm} \\          Him}\\         \vspace*{0.5cm}         {\large \textit{Advisor}:\vspace*{0.5cm} \\          Other Guy}     \end{flushright}     \end{minipage}%   Can you please explain me what I'm doing wrong?
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}
29830
This question is about Photoshop CS6. Hopefully the feature was added in this version. Before posting I looked up Google and  and  but didn't find an answer for CS6.  So the question is: Is there a feature within CS6 or a script that allows to resize a vector element with rounded corners without using the Direct Selection Tool (white arrow tool) and not changing the border radius? What would be great would be something like simply using the transform tool or something like a grid resize tool.
41602
I frequently create labels that follow the same format: white text on a 75% opaque black background, with 10px of margin around the text. Currently, I have to manually build these labels, which takes a lot of work.  In one method, I write the text, figure out its height and width, then create a separate rectangle and place it behind it. This takes a lot of clicking around for every label.  In the other method, I draw out a text box, select it directly, give it the correct background and margins, and then insert the text. However, I must then resize the box manually, meaning more clicking around and greater imprecision. There doesn't seem to be a way to directly select a text box once it has text inside it.  I tried using the script contained in  to resize the text box to the content, but it only resizes the box vertically, and removes my color and margins.  Does anyone have suggestions on how to resolve these problems, or for a better method? I'm using CS3.
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.
45029
I would like to create a table with some columns' width specified, while the text in those columns should be centered both horizontally and vertically. I found out that  \usepackage{array} \begin{tabular}{| c | c | m{5cm} |}   vertically centers the text in the last column, but justifies it horizontally (like text in normal paragraphs).  Update: With Jake's method, it seems both \\ and \hline cause an error. How to fix it?