I am trying to create a red box inside a pink box, but i can't get even this simple thing to work. I would like the red box to be in the center of the pink box. It would be even better if the red box was also center of the browser window.     I try copying code from other answers but it does not work for me.  .main {       height: 300;       width: 300;       background-color: pink;       display: flex;       flex-flow: row wrap;       justify-content: center;     }  .aaa {       height: 200;       width: 200;       background-color: red;     }   &lt;html&gt; &lt;head&gt;   &lt;title&gt;test&lt;/title&gt; &lt;/head&gt; &lt;body bgcolor="#000000"&gt;   &lt;div className="main"&gt;     &lt;div className="aaa"&gt;       A     &lt;/div&gt;   &lt;/div&gt; &lt;/body&gt; &lt;/html&gt;
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?
68803
update i discovered lately  where Nickolay Kolev uses  \tikz inside a tikzpicture environment. A lot of users think that is a wrong practice and I agree that is very strange but sometimes very useful. I agree too that it's preferable to avoid this kind of situation. I use this possibility in  pgfornament.  I don't understand why if I invert the two lines of the tikzpicture (the wrapper) I get different results. overlay I think, resets the bounding box but why inside the second tikzpicture, the overlay resests the general bounding box. When I use a scope, the problem disappears ?   update I suppose that tikz's experts think it's preferable to use a scope and the question is stupid ...  Or in the pgfmanual, I read      All graphic options are local to the {tikzpicture} to which they   apply.   The picture in red has no bounding box.  \documentclass[11pt]{scrartcl} \usepackage{tikz}     \begin{document}  baseline\begin{tikzpicture}[baseline=(current bounding box.north west)]   \tikz[overlay] \path (0,0) --  (1,1) node  {\color{blue}$\bullet$};  \draw[help lines,blue!20] (0,0) grid (2,2) ; \end{tikzpicture}baseline% %  \begin{tikzpicture}[baseline=(current bounding box.south west)]    \draw[help lines,red!20] (0,0) grid (2,2) ;   \tikz[overlay] \path (0,0) --  (1,1) node  {\color{red}$\bullet$};  \end{tikzpicture}baseline     \end{document}   With pgfinterruptboundingbox     Picture in green. The bounding box is correct. The first bounding box is protected.  The solution is to place the line with overlay inside a pgfinterruptboundingbox environment so the problem is linked to the current bounding box.    baseline\begin{tikzpicture}[baseline=(current bounding box.south west)]       \draw[help lines,green!50] (0,0) grid (2,2) ;   \begin{pgfinterruptboundingbox}    \tikz[overlay] \path (0,0) --  (1,1) node  {\color{green}$\bullet$};    \end{pgfinterruptboundingbox} \end{tikzpicture}baseline       No problem with a scope   \documentclass[11pt]{scrartcl} \usepackage{tikz}  \begin{document} baseline\begin{tikzpicture}[baseline=(current bounding box.north west)]   \tikz[overlay] \path (0,0) --  (1,1) node  {\color{blue}$\bullet$};  \draw[help lines,blue!20] (0,0) grid (2,2) ; \end{tikzpicture}baseline  \begin{tikzpicture}[baseline=(current bounding box.south west)]    \draw[help lines,red!20] (0,0) grid (2,2) ;  \begin{scope} [overlay] \path (0,0) --  (1,1) node  {\color{red}$\bullet$}; \end{scope}   \end{tikzpicture}baseline  \end{document}    ( What is the real differences between a scope and a tikzpicture ?)  update The question is perhaps too general, better is How tikz performs overlay ?
66335
(clickable)  Mainad has a valid height and width, however it isn't shown like subad1/subad2. Which are in essence exactly the same! (just a different background image).  Firebug shows my div as greyed out for some weird reason. Replacing the contents of mainad with just some text doesn't solve the problem (problem isn't related to inner elements)..   What's going on?! :(
66188
On a windows 7 computer how might one set the desktop to be a webpage. I want to have a local html file that I can edit as needed. Then windows should show that file as the background for the desktop but I should be able to click on links and interact with the page. Certain links would launch certain programs.   So I want to go this route because there is no way that I know to corral a group of icons to a certain part of the screen. When I disconnect and reconnect monitors and such things move around. No icons are forced to stay in part of the group they are supposed to be a part of. At this point I just have folders on the desktop with the app links in those folders. This means I have to open multiple folders to get where I want.   Any ideas on the html angle or other ideas on how to accomplish this?  thanks,  bye.
44783
You can currently only resize the text box in chat. Given that there's only a few pixels below the text box, this resizing doesn't help all that much.    Would it be possible to make the entire bottom div resizeable, rather than just the text box (with the height of the text box dependent on the height of the div)?  (No longer suggesting resizing the textbox itself upwards, as this doesn't appear to be a possibility)
89884
I am trying to position node(2) in a page in coordinates related to the page (origin at upper left corner of the body of the page). My code is:  \documentclass[border=10pt,a4paper]{memoir} \usepackage[total={16.51cm,21.59cm}, top=1.2in, left=0.9in, includefoot]{geometry} \usepackage{tikz} \usepackage{fancyhdr} \usepackage{comment} \pagestyle{fancy} \fancyhf{} \renewcommand{\headrulewidth}{2pt} \renewcommand{\footrulewidth}{1pt} \begin{document} \begin{tikzpicture} \node[](1) at (0cm,0cm) {1}; \node[](2) at (0.5\textwidth,-0.5\textheight) {2}; \end{tikzpicture} \vspace{1cm} \noindent \end{document}   For node(2) to be positioned in the centre of the page at (0.5\textwidth,-0.5\textheight) I have to create another node (1) in the origin, otherwise node(2) will be put at (0,0). I would like that someone could explain this strange behaviour.
110500
I need to do a &quot;work breakdown structure&quot;. As it has to many items on the second level i would like to arrange it horizontally? On  I found following code by Gonzalo Medina: \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows,shapes,positioning,shadows,trees}  \tikzset{   basic/.style  = {draw, text width=2cm, drop shadow, font=\sffamily, rectangle},   root/.style   = {basic, rounded corners=2pt, thin, align=center,                    fill=green!30},   level 2/.style = {basic, rounded corners=6pt, thin,align=center, fill=green!60,                    text width=8em},   level 3/.style = {basic, thin, align=left, fill=pink!60, text width=6.5em} }  \begin{document} \begin{tikzpicture}[   level 1/.style={sibling distance=40mm},   edge from parent/.style={-&gt;,draw},   &gt;=latex]  % root of the the initial tree, level 1 \node[root] {Drawing diagrams} % The first level, as children of the initial tree   child {node[level 2] (c1) {Defining node and arrow styles}}   child {node[level 2] (c2) {Positioning the nodes}}   child {node[level 2] (c3) {Drawing arrows between nodes}};  % The second level, relatively positioned nodes \begin{scope}[every node/.style={level 3}] \node [below of = c1, xshift=15pt] (c11) {Setting shape}; \node [below of = c11] (c12) {Choosing color}; \node [below of = c12] (c13) {Adding shading};  \node [below of = c2, xshift=15pt] (c21) {Using a Matrix}; \node [below of = c21] (c22) {Relatively}; \node [below of = c22] (c23) {Absolutely}; \node [below of = c23] (c24) {Using overlays};  \node [below of = c3, xshift=15pt] (c31) {Default arrows}; \node [below of = c31] (c32) {Arrow library}; \node [below of = c32] (c33) {Resizing tips}; \node [below of = c33] (c34) {Shortening}; \node [below of = c34] (c35) {Bending}; \end{scope}  % lines from each level 1 node to every one of its &quot;children&quot; \foreach \value in {1,2,3}   \draw[-&gt;] (c1.195) |- (c1\value.west);  \foreach \value in {1,...,4}   \draw[-&gt;] (c2.195) |- (c2\value.west);  \foreach \value in {1,...,5}   \draw[-&gt;] (c3.195) |- (c3\value.west); \end{tikzpicture} \end{document}  Which leads to following result:  (source: ) How can the code be modified in a way that the diagram will expand from the left to the right?
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?
87305
I have a problem, I'm fairly new to LaTeX but I think I got the basics.  My problem is that wants to create a environment that can create a minipage with a background color and some text in it.  I can make this by doing it by hand, but I have a lot of boxes, and to write mostly the same over and over again is to my a bit redundant.  \documentclass[12pt,a4paper]{book}   % Book settings + layout  \usepackage{xcolor}         % Extended colors \usepackage{color}         % Color extended names  %DEFINE ENVIRONMENT BLOCK % Riddle \newenvironment{colbox}[3]{        % Riddle environment   \begin{center}                   % Centering minipage     \colorbox[HTML]{#1} {          % Set's the color of minipage       \begin{minipage}[b]{380px}   % Starts minipage    \textbf{#2}\\ \textit{#3}       % Set's title and starts italic for text   \end{minipage}}                  % End minipage }{\end{center}}                    % End Riddle environment   \begin{document}  \begin{center}     \colorbox[HTML]{F8E0E0}{      \begin{minipage}[c]{380px}       \textbf{Riddle: }\\ \textit{some text here}      \end{minipage}} \end{center}  Some other text  \begin{colbox}{F8E0E0}{Riddle:}   some text here \end{colbox}  Some more text  \begin{colbox}{F8E0E0}{Riddle:}   {some text here} \end{colbox}  \end{document}     As I can see it, the problem is that in my environment colorbox is not ended by the end parameter, and I need to move \end{minipage} the same place, but I can't move it before the \end{colorbox} is moved, is there a way to do this right?  %DEFINE ENVIRONMENT BLOCK % Riddle \newenvironment{colbox}[3]{        % Riddle environment   \begin{center}                   % Centering minipage     \colorbox[HTML]{#1} {          % Set's the color of minipage       \begin{minipage}[b]{380px}   % Starts minipage    \textbf{#2}\\ \textit{#3}       % Set's title and starts italic for text   \end{minipage} }                 % End minipage }{\end{center}}   I can "fix" the out-of-box problem by putting {} on the text like this  \begin{colbox}{F8E0E0}{Riddle:}   {some text here} \end{colbox}   But that's not really what I want.  If it's possible I would like to keep everything in what's default in LaTeX cause I'm not the only one maintaining this document and special packages is not well liked,
25010
I'm having some difficulty on how to use the "stretch" optional argument of \parbox. Is it supposed to equally interspace lines of text inside a box of determined size?  If I code it like:   \documentclass{article} \begin{document}   Text   \fbox{\parbox[c][15cm][s]{5cm}{I want to stretch this text inside this box}} \end{document}   This is the outcome I get:   I also experimented with \parbox and got some unexpected outcomes. In the following code, I merely deleted the alignment optional argument (default is center) from the previous test:  \documentclass{article} \begin{document} Text \fbox{\parbox[15cm][s]{5cm}{I want to stretch this text inside this box}} \end{document}   As a result, this came out:   Which confused me, because I thought deleting the first optional argument would simply put it in default. I also didn't get why the text from the mandatory argument was substituted by the letter "s", a shortcut for "stretch" in the third optional argument.  Another test:   \documentclass{article} \begin{document} Text \fbox{\parbox[15cm]{5cm}{I want to stretch this text inside this box}} \end{document}   Which yielded me:   In this last one, I deleted the stretch optional argument, but the height of the box was not drawn.  Why did I get those results? I'm barely a starter at TeX, so might me missing obvious points on the use of optional arguments.
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!
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!
81946
I'm working with overleaf and trying to add texts in these red marked positions. For example, I want to add 4,5 and 6 respectively. I've tried with \put(0,0), but it always disables the \resizebox attribute and makes the image out of proportion, also the text doesn't get placed in the position at all. What changes can I make in the code mention below to add 4,5 and 6 in these three positions? Picture can be found in . \begin{figure}[!h]     \centering     \resizebox{1\linewidth}{!}{%     \includegraphics{picture.png}     }     \caption{Flowchart of Heuristic adjustment 1.}     \label{fig:heuristic_1_FC} \end{figure}
555
I have a div with two images and an h1. All of them need to be vertically aligned within the div, next to each other. One of the images needs to be absolute positioned within the div. What is the CSS needed for this to work on all common browsers? &lt;div id=&quot;header&quot;&gt;   &lt;img src=&quot;..&quot; &gt;&lt;/img&gt;   &lt;h1&gt;testing...&lt;/h1&gt;   &lt;img src=&quot;...&quot;&gt;&lt;/img&gt; &lt;/div&gt;
27088
I am building data table, here is html code from browser before rerendering table. I use actionFunction with rerender attribute. The problem is that svg disappears after rerendering.  Before rerender:  &lt;th aria-label="Account Name" class="slds-is-sortable slds-is-resizable" scope="col"&gt;     &lt;a class="slds-th__action slds-text-link--reset" href="javascript:void(0);"&gt;         &lt;span class="slds-assistive-text"&gt;Sort&lt;/span&gt;         &lt;span class="slds-truncate" title="Account Name"&gt;Account Name&lt;/span&gt;         &lt;div class="slds-icon__container"&gt;             &lt;svg aria-hidden="true" class="slds-icon slds-icon--x-small slds-icon-text-default slds-is-sortable__icon"&gt;                 &lt;use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/resource/1454076265000/SLDS01201/assets/icons/utility-sprite/svg/symbols.svg#arrowdown"&gt;&lt;/use&gt;             &lt;/svg&gt;         &lt;/div&gt;         &lt;span aria-atomic="true" aria-live="assertive" class="slds-assistive-text"&gt;&lt;/span&gt;     &lt;/a&gt; &lt;/th&gt;   After rerender:  &lt;th aria-label="Account Name" class="slds-is-sortable slds-is-resizable" scope="col"&gt;     &lt;a class="slds-th__action slds-text-link--reset" href="javascript:void(0);"&gt;         &lt;span class="slds-assistive-text"&gt;Sort&lt;/span&gt;         &lt;span class="slds-truncate" title="Account Name"&gt;Account Name&lt;/span&gt;     &lt;/a&gt;     &lt;div class="slds-icon__container"&gt;&lt;/div&gt;     &lt;span aria-atomic="true" aria-live="assertive" class="slds-assistive-text"&gt;&lt;/span&gt; &lt;/th&gt;   How to solve this? The response of request for rerender in Chrome dev tools looks like this:  &lt;html lang="en_US" xmlns="http://www.w3.org/1999/xhtml"&gt;   Maybe the issue is that xmlns="http://www.w3.org/2000/svg" is missing?
52292
I used this: wrapper    { background-color:yellow; } but I want really everything in the background to get colored. how to? Code above just makes the wrapper background change.
45957
I am creating a block-diagonal matrix and want to use boxes along the diagonal but the boxes don't touch each other, so it looks funny.  What's a workaround for this?  Here's my code:  \documentclass{article} \usepackage{amsmath} \begin{document} \[   \begin{bmatrix}            \fbox{$B_1$} &amp; 0 &amp; 0  \\      0 &amp; \fbox{$B_2$} &amp; 0 \\      0 &amp; 0 &amp; \fbox{$B_3$} \\    \end{bmatrix} \] \end{document}   something like the matrix in the middle ...of this answer (but without the red and color filling)    Thanks,