I'm trying to center a basic user login in React JS using inline styles, but I can't seem to figure out how to do it. I'm using React Bootstrap and I have currently managed to partially center the form using flexbox, but it's still appearing at the top of the page. What do I need to do so that it appears right in the middle? Please see the attached image for the current issue. const LoginPage = () =&gt; {      return (         &lt;Container &gt;             &lt;Row                 style={{                     display: 'flex',                     alignItems: 'center',                     justifyContent: 'center',                     marginTop:'5px'                 }}             &gt;                 Enter API Key:             &lt;/Row&gt;             &lt;Row                 style={{                     display: 'flex',                     alignItems: 'center',                     justifyContent: 'center',                     marginTop:'5px'                 }}             &gt;                 &lt;Form&gt;                     &lt;Form.Control                         id='apiKeyString'                         name='apiKey'                         size='sm'                         style={{ width: '250px' }}                         onChange={(e) =&gt; setApiKey(e.target.value)}                     &gt;&lt;/Form.Control&gt;                 &lt;/Form&gt;             &lt;/Row&gt;             &lt;Row                 style={{                     display: 'flex',                     alignItems: 'center',                     justifyContent: 'center',                     marginTop:'5px'                 }}             &gt;                 &lt;Button type='submit' onClick={submitApiKey} size='sm'&gt;                     Submit                 &lt;/Button&gt;             &lt;/Row&gt;         &lt;/Container&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;
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
26505
I think I'm not going to solve my problem with the Floats and positioning of figures. I have 4 diagramms and I need to place them on two pages and at the end of the second page the caption for all 4 figures. So two figures on each page. For the the diagramms on the second page I need to place the upper image near to the top because I need some place for the caption. On the page before I need both figures to be centered in the middle with some spacing between them. So this is my code:   \begin{figure}[c] \centering \includegraphics[width=\linewidth]{45.pdf} \end{figure} \begin{figure}[c] \centering \includegraphics[width=\linewidth]{46.pdf} \end{figure} \makeatletter \setlength{\@fptop}{0pt} \makeatother \begin{figure}[t!] \centering \includegraphics[width=\linewidth]{47.pdf} \captionsetup[figure]{font=small,skip=0pt} \includegraphics[width=\linewidth]{48.pdf} \caption{Konzentrationsprofile von Al, Re, Ta und W entlang der &lt;110&gt;-Richtung in der UC. } \end{figure}   The problem for the secong page was solved, but the figures on the first page were also forced to the top which I don't want!
108496
I am trying to use the titlesec package to achieve this but I'm not certain as to what the syntax should be...  \usepackage{titlesec}  \newcommand{\centeredsection}{\titleformat{\section}{\centering}}   Thanks for your help.
82858
There is an alignment issue with the displaying of usernames in the Stack Apps site's  and  tabs. The last characters of the usernames are not being displayed correctly.  Screenshot for reference:     After inspecting the element, the alignment issue appears to be at the in-line styling margin-right : 5px;. If margin-right : 5px; is changed to margin-right : 8px; the issue will be solved.  The issue is occurring in Chrome and IE 11 and the same fix solves the problem in both browsers.  Screenshot for reference:    Chrome Version 47.0.2526.106 dev-m IE Version 11.20.10586.0
32381
After switching from the report class to the book class and starting to use the fancyhdr package to control headers/footers, the page numbers in my footers are no longer centered.  This is my fancyhdr setup:  \usepackage{fancyhdr} \fancypagestyle{plain}{% \fancyhf{} % clear all header and footer fields \fancyfoot[C]{\thepage} % except the center \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt}} %activate the style: \pagestyle{plain}  \usepackage{geometry} \geometry{a4paper} %paper format \geometry{left=27.5mm,right=27.5mm,bottom=27.5mm,top=27.5mm} %margins  With this the page numbers are placed off-center. On even pages they are to the right of the center and on odd ones they are to the left of it. What I want is a perfectly centered (with respect to the page) pagenumber in the footer of even and odd pages alike (like it was when I used the report class and no fancyhdrs).
73184
I can't figure out how to achieve the following layout with CSS (probably because I don't actually know CSS).  I have a bunch of divs like this:  &lt;div class="right"&gt; &lt;p&gt;1&lt;/p&gt; &lt;/div&gt; &lt;div class="left"&gt;  &lt;p&gt;2&lt;/p&gt; &lt;/div&gt; &lt;div class="left"&gt;  &lt;p&gt;3&lt;/p&gt; &lt;/div&gt; &lt;div class="left"&gt;  &lt;p&gt;4&lt;/p&gt; &lt;/div&gt; &lt;div class="right"&gt; &lt;p&gt;5&lt;/p&gt; &lt;/div&gt; &lt;div class="right"&gt; &lt;p&gt;6&lt;/p&gt; &lt;/div&gt;   (not the real contents)  Now I want the layout to look like two equal columns of divs, with the "right" ones on the right, and the "left" ones on the left, thus:  2 1 3 5 4 6   [Edit: In a previous version of this question I had textareas inside the divs, and the divs all had different names like "one" and "xyz".] I tried something like  div.right { width:50%; float:right; clear:right; } div.left { width:50%; float:left; clear:left;}   but it doesn't quite work: It produces something like:  2 1 3  4 5   6   (without the "clear"s, it blithely produces   2 1 3 4 6 5   which is not what is wanted).  It is apparent that it can be made to work if the divs are ordered differently, but I'd like not to do that (because these divs are generated dynamically if the browser has Javascript, and I don't want to change the actual order that is displayed in the absence of Javascript, for semantic reasons). Is it still possible to achieve the layout I want?  [For what it's worth, I'm willing to have it not work on IE or older versions of other browsers, so if there is a solution that works only on standards-compliant browsers, that's okay :-)]
112335
Lets say I have a text box that I want to fill a whole line. I would give it a style like this:  input.wide {display:block; width: 100%}   This causes problems because the width is based on the content of the text box. Text boxes have margin, borders, &amp; padding by default, which makes a 100% width text box larger than its container.  For example, here on the right:    Is there any way to make a text box fill the width of its container without expanding beyond it?  Here is some example HTML to show what I mean:  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" &gt; &lt;head&gt;     &lt;title&gt;Untitled Page&lt;/title&gt;     &lt;style type="text/css"&gt;         #outer{border: 1px solid #000; width: 320px; margin: 0px;padding:0px}         #inner{margin: 20px; padding: 20px; background: #999;border: 1px solid #000;}         input.wide {display:block; margin: 0px}         input.normal {display:block; float: right}     &lt;/style&gt; &lt;/head&gt; &lt;body&gt;     &lt;div id="outer"&gt;         &lt;div id="inner"&gt;             &lt;input type="text" class="wide" /&gt;             &lt;input type="text" class="normal" /&gt;             &lt;div style="clear:both;"&gt;&lt;/div&gt;         &lt;/div&gt;     &lt;/div&gt; &lt;/body&gt; &lt;/html&gt;   If this is run, you can see by looking at the "normal" text box that the "wide" text box is sticking out beyond the container. The "normal" text box floats to the actual edge of the container. I'm trying to make the "wide" text box fill its container, without expanding beyond edge like the "normal" text box is.
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}
20230
I just got a short algorithm on my page, and it keeps getting aligned at the center of the page. But I want to have it aligned at the top, what do I have to do?
41926
We're about to go live with Live Agent (the version that built into your Salesforce instance).  We're using some a prechat form which appears as a popup window when the user clicks the "Chat" button.  When the window pops up, our form doesn't fit fully inside. I'm trying to find where to define the size of that pop-up window.  I can't find it in any setting, and changing the Visualforce page that represents the Pre Chat form doesn't make a difference.  Does anyone know where the Size of the pop up window is referenced?   Update**  ***Per the comment below - I also thought it would be in the code for the button. Nearest I can tell it calls a method onclick called "Liveagent.startChat()" but I don't see that javascript anywhere.  &lt;body style="background:transparent"&gt;         &lt;span class="buttonSmall"&gt;                                                 &lt;a id="liveagent_button_online_573400000004CMA" href="javascript://Chat" style="display: none;" onclick="liveagent.startChat('573400000004CMA')"&gt;                 &lt;img src="~/hgstatic/img/hgLiveChatButtonBig.png" alt="Live Chat" /&gt;             &lt;/a&gt;          &lt;/span&gt;                &lt;div id="liveagent_button_offline_573400000004CMA" style="display: none;"&gt;&lt;a href="http://www.healthgrades.com/contactus?application=manage-my-profile" target="_new"&gt;&lt;img src="~/hgstatic/img/hgContactUsBig.png" alt="Contact Us" /&gt;&lt;/a&gt;&lt;/div&gt;           &lt;script type="text/javascript"&gt;              if (!window._laq) { window._laq = []; }              window._laq.push(function () {                  liveagent.showWhenOnline('573400000004CMA', document.getElementById('liveagent_button_online_573400000004CMA'));                  liveagent.showWhenOffline('573400000004CMA', document.getElementById('liveagent_button_offline_573400000004CMA'));              });         &lt;/script&gt;                        &lt;script type='text/javascript' src='@ConfigurationManager.AppSettings["SalesForceScriptLink"]'&gt;&lt;/script&gt;         &lt;script type='text/javascript'&gt;             liveagent.init(@Html.Raw(ConfigurationManager.AppSettings["SalesForceLiveAgentInitLink"]));         &lt;/script&gt;     &lt;/body&gt;
14638
I'm new with LaTeX and I'm trying to make a table with the elements centered vertically and horizontally. I've searched for this question, it seems like most people were trying to do things a little more complicated than this, resulting in complicated answers I couldn't understand. The table below is already centered horizontally, but the elements are aligned to the top of the cells instead of the center. How do I fix this?      \begin{tabular}{*{5}{|c}|}         \hline         $p$ &amp; $q$ &amp; $p \land q$ &amp; $p \lor q$ &amp; $p \to q$\\         \hline         T &amp; T &amp; T &amp; T &amp; T\\         \hline         T &amp; F &amp; F &amp; T &amp; F\\         \hline         F &amp; T &amp; F &amp; T &amp; T\\         \hline         F &amp; F &amp; F &amp; F &amp; T\\         \hline     \end{tabular}
26668
I have a rather wide table for which I have a designated page in landscape mode. The rest of the document is in portrait mode. Currently, the first row of the table begins at the very top of the page and ends somewhere in the middle. I'd like the table to be vertically centered though. How can I achieve this? I'm using the tabular environment.
58040
I want to add background image, to part of my header i wrote code like this.  but its not working.   &lt;div style="{!'background:' + v.backgroundColor + ' url(' + v.backgroundImageURL +') no-repeat;background-position: center;background-size: cover;'}"&gt;  &lt;/div&gt;     doInit : function(component, event, helper) {          var url = $A.get('$Resource.RollingHillsGrey1');         component.set('v.backgroundImageURL', url);     }
89395
Currently I am posting this on a page without any CSS style. Anyone else experiencing this?  I am using Firefox 3.5.2 and have tried refreshing (CTRL + F5) multiple times, even closing the browser. I do have Stylish installed and was using it to create a Hot Dog Stand theme, but it was inactive when this happened.  Screenshot:
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?
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?