I used all options on the web but this seems to trick me every time.  u used flex  vertical alignment  I don't want to add margin or padding.  You can comment to start the discussion.  I am just adding this bcox its asks for more explanation:     .topnav {      overflow:hidden;   background-color: #333;   padding-top: 10px;   padding-bottom: 10px;   padding-left: 5px;   margin: 0px; }   .topnav div {   float: left;   display: flex;   color: #f2f2f2;   font-size: 15px;   margin:auto;   text-align: center;   padding-left: 10px;    }   .topnav div:hover {   background-color: #ddd;   color: black;   margin:auto;   position: relative;   vertical-align: middle; }  .topnav div.active{    color:white;    display:flex;    font-family: Arial, Helvetica, sans-serif;    font-size: 20px;    margin:auto; }     &lt;div class="topnav"&gt;         &lt;div class="active"&gt;Some Title&lt;/div&gt;         &lt;div&gt;Link&lt;/div&gt;              &lt;/div&gt;
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;
99731
In the question , there was an answer to how to place additional sign over the equal sign. And my question is, what if I also want to have some symbol/text under the equal sign? Or if I want to use \stackrel to label my equal sign that follows an tab alignment character (&amp;=)?
7162
Is there a word-wrap or any other attribute that stops text from wrapping?  I have a height, and overflow:hidden, and the text still breaks.  Needs to work in all browsers, before CSS3.
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?
54412
My code are as follows:   \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{lipsum}     \usepackage{booktabs}     \input{insbox}     \makeatletter     \@InsertBoxMargin = 12pt     \makeatother     \usepackage{nccmath}     \usepackage[showframe, nomarginpar]{geometry}     \usepackage{etoolbox} \usepackage{graphicx}     \newcommand*{\wrapitem}{\apptocmd{\labelenumi}{\hskip\leftmargin}{}{}\item\apptocmd{\labelenumi}{\hskip-\leftmargin}{}{}}     %     \newcommand{\InsertListL}[3][]{%     \setlength{\leftskip}{\leftmargin}\mbox{}\vspace*{-\baselineskip}%     \InsertBoxL{#2}{#3}[#1]\par \hspace{\itemindent}     }%     \newcommand{\InsertListR}[3][]{%     \mbox{}\vspace*{-\baselineskip}\setlength{\leftskip}{\leftmargin}%     \InsertBoxR{#2}{\hskip-\leftmargin#3\hskip\leftmargin}[#1]     }%      \begin{document}      \begin{enumerate}%      \wrapitem%     \InsertListL[2]{2}{\includegraphics{./images/c01uf006.pdf}}%     \lipsum[1]       \item     \InsertListR[12]{-40}{\includegraphics{./images/c01uf007.pdf}}     \lipsum[2]      \wrapitem%     \InsertListL[2]{2}{\includegraphics{./images/c01uf006.pdf}}%     \lipsum[1]      \end{enumerate}      \end{document}   Please suggest the below:   How can I move the wrap images vertically (upper and down movement)? How can I control unnecessary vertical white spaces?   Also, please correct any errors in coding.
71633
With HTML/CSS, how can I make an element that has a width and/or height that is 100% of it's parent element and still has proper padding or margins?  By "proper" I mean that if my parent element is 200px tall and I specify height = 100% with padding = 5px I would expect that I should get a 190px high element with border = 5px on all sides, nicely centered in the parent element.  Now, I know that that's not how the standard box model specifies it should work (although I'd like to know why, exactly...), so the obvious answer doesn't work:  #myDiv {     width: 100%     height: 100%;     padding: 5px; }   But it would seem to me that there must be SOME way of reliably producing this effect for a parent of arbitrary size. Does anyone know of a way of accomplishing this (seemingly simple) task?  Oh, and for the record I'm not terribly interested in IE compatibility so that should (hopefully) make things a bit easier.   EDIT: Since an example was asked for, here's the simplest one I can think of:  &lt;html style="height: 100%"&gt;     &lt;body style="height: 100%"&gt;         &lt;div style="background-color: black; height: 100%; padding: 25px"&gt;&lt;/div&gt;     &lt;/body&gt; &lt;/html&gt;   The challenge is then to get the black box to show up with a 25 pixel padding on all edges without the page growing big enough to require scrollbars.
44092
In the 'menu' under the post, some extra space has been added (I presume accidentally) between the 'flag' link and the other options:    It looks like the separators are always shown, even though their corresponding options might be hidden. Here's how a full menu looks, and it's still evenly spaced:
9939
There is an alignment issue in the  Inbox, Achievements dialog and Site Switcher. The icon is not properly padding with the adjacent text.  The alignment in inbox, achievement and site switcher from other sites are fine. I can verify this alignment issue in Chrome and Firefox.   Screenshot for reference:
78990
It's just a minor CSS issue. See the following gif:
81769
When my browser renders the following test case, there's a gap below the image. From my understanding of CSS, the bottom of the blue box should touch the bottom of the red box. But that's not the case. Why?  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;  &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"&gt; &lt;head&gt;&lt;title&gt;foo&lt;/title&gt;&lt;/head&gt; &lt;body&gt;   &lt;div style="border: solid blue 2px; padding: 0px;"&gt;    &lt;img alt='' style="border: solid red 2px; margin: 0px;"    src="http://stackoverflow.com/Content/Img/stackoverflow-logo-250.png" /&gt;   &lt;/div&gt;  &lt;/body&gt; &lt;/html&gt;
27756
Here is a screenshot from  page, with the floating sidebar: (all good so far)        After I scroll down to footer it just combines both:        Can it please be fixed?
41703
I have the following code that produces the table that is shown. What I am trying to do is to get the fourth and fifth column titles vertically aligned at the top. Is this possible?  \documentclass{article} \usepackage{multirow} \usepackage{array}  \newcolumntype{x}[1]{% &gt;{\raggedright\hspace{0pt}}p{#1}}%  \begin{document} \centering \renewcommand{\arraystretch}{1.2} \begin{tabular}{| m{2cm} | p{2cm} | p{2cm} | p{2cm} | p{2cm} | p{2cm} |} \hline     \multirow{3}{1.7cm}{Data Set} &amp;%     \multicolumn{3}{c |}{Raw Data} &amp;%     Offline Processing Time &amp;     Index Size (KB)\\ \cline{2-4} %     &amp; %     RDF N3 File SizeKB (sec)    &amp;%     Number of Triples &amp;%     Number of Entities\\    \hline \end{tabular} \end{document}
109050
I have a title page, which used a \vfill from the middle of the page, to push a line of text to the bottom. I inserted an image in this page, and wanted it place in the middle (vertically) between middle-of-page and the bottom text, and so inserted another \vfill there. This, however, doesn't seem to make the spaces on top and bottom of the images exactly equal.   I think that is somewhat demonstrated on this MWE:  \documentclass{book} \usepackage{filecontents} \begin{filecontents*}{test-image.tex}   \documentclass{standalone}   \usepackage{tikz}   \begin{document}   \begin{tikzpicture}   %\draw[thick] (0,0) rectangle (3cm,3cm);   \draw[line width=2mm] (2.8cm,1.5cm) arc [start angle=0, end angle=-240, radius=13mm];   \end{tikzpicture}   \end{document} \end{filecontents*}  \immediate\write18{pdflatex test-image.tex}  \usepackage{graphicx} \usepackage[   paperwidth=15cm,   paperheight=20cm,   outer=2cm,   inner=2cm,   top=2cm,   bottom=2cm   ]{geometry} \usepackage[a4,center]{crop} \crop[cam,info] % info is default, noinfo has to be set; use [off] to turn off all marks  \usepackage{lua-visual-debug}  \begin{document}  \frontmatter \begin{titlepage}   \begin{center}     {\Huge Testing the testing test, of the testing test}   \end{center}   %   \vspace{4 cm}   \begin{center}     {\large       Line One     }\\     \vspace{0.2cm}     {\Large       Line Two     }   \end{center}   % BOTTOM PART   \vfill   \begin{center}                                  % INSERT   \includegraphics[width=4.75cm]{test-image.pdf}  % INSERT   \end{center}                                    % INSERT   \vfill                                          % INSERT   \begin{center}     The bottom line is here.   \end{center} \end{titlepage} \end{document}   Compile this with lualatex -shell-escape test.tex. The resulting PDF I opened in inkscape, and added dimension lines and their length in what Inkscape sees as millimeters, and got this (note Inkscape corrupted some of the fonts; click for high-res):    So, the top and bottom length should be equal, but the top is 18.34 mm and the bottom is 19.72 mm in height (and in my actual example, I think I have an even more extreme difference, I just couldn't reconstruct it here).  Basically, the way I understand \vfill, if there are two \vfills, since they are of the same "order of infinity", the remaining space should be equally split between them; but apparently, there is a difference. Why does this difference occur - and how could I position the inserted logo, so the vertical spaces above and below it will be exactly equal?
48709
Every time I try to do something seemingly-simple in CSS, it doesn't work.  I have a content div that contains a 460x160 image. All I want to do is position the image at the bottom-right corner and wrap my text around it.  &lt;div id="contents"&gt;     &lt;img src="..." /&gt;     text text text text text text ... &lt;/div&gt;   So I want it to look like:  ------------------ | text text text | | text text text | | text text -----| | text text |    | ------------------   Doing it with a top-left or top-right image is cake:  #contents img { float:right; }  ------------------ | text text |    | | text text -----| | text text text | | text text text | ------------------   Now how do I push that to the bottom? The best I've come up with so far are:  #contents img { float:right; margin-top: 90%} // really needs to be 100%-160px  ------------------ | text text      | | text text      | | text text -----| | text text |    | ------------------   In this case the text does not print in the margin, so there is white space above the image.  #contents { position:relative; } #contents img { position:absolute; right:0; bottom:0; }  -or-  // move the img tag under the text in the html and: #contents img { float:right; margin-top:-160; }  ------------------ | text text text | | text text text | | text text -----| | text text | te | ------------------   In this case the text prints over or under the image.  So... how can I accomplish this?
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!
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?
58280
I'm trying to center a fixed size control within a form.  Out of interest, is there a non-idiotic way of doing this? What I really want is something analogous to the text-align css property.  At the moment, I'm setting the padding property of the surrounding form to a suitable size and setting the Dock property of the control to fill.