that creates a centered list of buttons. Unfortunately at the top of the page.   &lt;html&gt; &lt;head&gt;     &lt;style&gt;         #test {             display: table;             margin: 0 auto;             bottom: 5em;         }         .mybtn .button {             background-color: orange;             border: 1px solid green;             width: 120px;             color: white;             font-size: 14px;             padding: 10px;             text-align: center;             text-decoration: none;             display: block;         }     &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="test"&gt;     &lt;div class="mybtn"&gt;         &lt;button class="button"&gt;Result&lt;/button&gt;         &lt;button class="button"&gt;Result&lt;/button&gt;         &lt;button class="button"&gt;Result&lt;/button&gt;         &lt;button class="button"&gt;Result&lt;/button&gt;     &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt;   any reason why bottom: 5em does not work ?  as a beginner in css I would appreciate any hint on why I need also to set .mybtn make the css work !
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?
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}
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?
29285
What's the difference between &lt;div class=""&gt; and &lt;div id=""&gt; when it comes to CSS? Is it alright to use &lt;div id=""&gt;?  I see different developers doing this in both ways, and since I'm self taught, I've never really figured it out.
17969
I have a div in my HTML page. I am showing this div based on some condition, but the div is displaying behind the HTML element where I pointed the mouse cursor.  I have tried all values for z-index from 0 - 999999. Can anyone tell me why this is happening?  Is there any minimum or maximum value of Z-INDEX property of CSS?    .divClass {      position: absolute;       left: 25px;       top: 25px;       width: 320px;      height: 300px;       z-index: 1000;  } &lt;table cellspacing="0" cellpadding="0" width="100%"&gt;   &lt;tr&gt;     &lt;td&gt;       &lt;asp:HyperLink ID="lnkProgram" runat="server"&gt;&lt;/asp:HyperLink&gt;     &lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;      &lt;td&gt;          &lt;div class="divClass"&gt;            Some Data          &lt;/div&gt;      &lt;/td&gt;   &lt;/tr&gt;  &lt;/table&gt;     I am showing and hiding the div with .divClass onclick via the &lt;asp:hyperlink&gt; using jQuery.
60624
In the markup shown below, I'm trying to get the content div to stretch all the way to the bottom of the page but it's only stretching if there's content to display. The reason I want to do this is so the vertical border still appears down the page even if there isn't any content to display. Here is my DEMO:   body {     font-family: Trebuchet MS, Verdana, MS Sans Serif;     font-size:0.9em;     margin:0;     padding:0; } div#header {     width: 100%;     height: 100px; } #header a {     background-position: 100px 30px;     background: transparent url(site-style-images/sitelogo.jpg) no-repeat fixed 100px 30px;     height: 80px;     display: block; } #header, #menuwrapper {     background-repeat: repeat;     background-image: url(site-style-images/darkblue_background_color.jpg); } #menu #menuwrapper {     height:25px; } div#menuwrapper {     width:100% } #menu, #content {     width:1024px;     margin: 0 auto; } div#menu {     height: 25px;     background-color:#50657a; } &lt;form id="form1"&gt;   &lt;div id="header"&gt;       &lt;a title="Home" href="index.html" /&gt;   &lt;/div&gt;    &lt;div id="menuwrapper"&gt;       &lt;div id="menu"&gt;       &lt;/div&gt;   &lt;/div&gt;    &lt;div id="content"&gt;   &lt;/div&gt; &lt;/form&gt;
97365
I'm trying to get some console output in my homework. I put it in a listings environment but I want it to be centered horizontally on the page.  The only thing I get centered is the caption ;-/  \begin{minipage}{1\textwidth} \begin{center} \begin{lstlisting}[caption={Ausgabe des C-Programms},label={ggt_c_ausgabe}] a  |  b  |  q  |  u  |  s  |  v  |  t   ---------------------------------------- 78 |  21 |   1 |     |   1 |   1 |  -1  21 |  15 |   3 |   1 |  -3 |  -1 |   4  15 |   6 |   1 |  -3 |   4 |   4 |  -5   6 |   3 |   2 |   4 | -11 |  -5 |  14   3 |     |   2 | -11 |  26 |  14 | -33  ---------------------------------------- \end{lstlisting} \end{center} \end{minipage}
11621
I have the code:  \documentclass{article} \usepackage[a4paper]{geometry} \usepackage{tabularx} \usepackage{lipsum} \begin{document} \begin{tabularx}{\textwidth}{ | X | c | }   \hline   \lipsum[1] &amp; top\\   \hline   \lipsum[1] &amp; center\\   \hline   \lipsum[1] &amp; bottom\\   \hline \end{tabularx} \end{document}   Gives this:    The top row is already aligned top. How can I vertically align the center row at the center? And the bottom row at the bottom?
49404
I want to style the last TD in a table without using a CSS class on the particular TD.  &lt;table&gt;   &lt;tbody&gt;     &lt;tr&gt;       &lt;td&gt;One&lt;/td&gt;       &lt;td&gt;Two&lt;/td&gt;       &lt;td&gt;Three&lt;/td&gt;       &lt;td&gt;Four&lt;/td&gt;       &lt;td&gt;Five&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt; &lt;/table&gt;  table td  {    border: 1px solid black; }   I want the TD containing the text "Five" to not have a border but again, I do not want to use a class.
31923
I'm using the following list:  &lt;ol id="footnotes"&gt;     &lt;a name="footnote1"&gt;&lt;li&gt;&lt;/a&gt;This is the first footnote...&lt;/li&gt;     &lt;a name="footnote2"&gt;&lt;li&gt;&lt;/a&gt;This is the second footnote...&lt;/li&gt; &lt;/ol&gt;   With the following .css:  #footnotes {list-style-type: decimal;             list-style-color: #f90;             }  #footnotes li            {color: #000;             }  #footnotes a li, #footnotes li a            {color: #f90;             }   The aim is to have the li/footer text itself black (#000), and the number styled to orange (#f90).  I've tried using the list-style-color property but this does nothing except upset the Web developer toolbar (in FF3.0.8/Ubuntu 8.04), Midori similarly doesn't display the number in orange (I thought I'd try it in the Webkit engine, just in case...).  Any ideas?  Edited the HTML (since I remembered that the  tag doesn't necessarily need to enclose anything to function as an anchor):  &lt;ol id="footnotes"&gt;     &lt;li&gt;&lt;a name="footnote1"&gt;&lt;/a&gt;This is the first footnote...&lt;/li&gt;     &lt;li&gt;&lt;a name="footnote2"&gt;&lt;/a&gt;This is the second footnote...&lt;/li&gt; &lt;/ol&gt;   In response to those that suggest using a &lt;span&gt; inside the &lt;li&gt;...yeah. That occurred, though I thank you for the suggestions and the time taken, but I was looking (li'l standardista that I am... ;) ) for a more...semantic option.  As it is, I think I'll probably use that approach. Though I accepted a different, Pete Michaud's, answer due to its sheer informative nature. Thanks!
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
56974
I want to create a toggle button in html using css. I want it so that when you click on it  , it stays pushed in and than when you click it on it again it pops out.   If theres no way of doing it just using css. Is there a way to do it using jQuery?
117043
Does anyone know how I can prevent the text in a table cell from wrapping?  This is for the header of a table, and the heading is a lot longer than the data under it, but I need it to display on only one line.  It is okay if the column is very wide.  The HTML of my (simplified) table looks like this:  &lt;table&gt;   &lt;thead&gt;     &lt;tr&gt;       &lt;th&gt;         &lt;div&gt;Really long column heading&lt;/div&gt;       &lt;/th&gt;       &lt;th&gt;         &lt;div&gt;Really long column heading&lt;/div&gt;       &lt;/th&gt;       &lt;th&gt;         &lt;div&gt;Really long column heading&lt;/div&gt;       &lt;/th&gt;       &lt;th&gt;         &lt;div&gt;Really long column heading&lt;/div&gt;       &lt;/th&gt;       &lt;th&gt;         &lt;div&gt;Really long column heading&lt;/div&gt;       &lt;/th&gt;       &lt;th&gt;         &lt;div&gt;Really long column heading&lt;/div&gt;       &lt;/th&gt;       &lt;th&gt;         &lt;div&gt;Really long column heading&lt;/div&gt;       &lt;/th&gt;     &lt;/tr&gt;   &lt;/thead&gt;   &lt;tbody&gt;     &lt;tr&gt;       &lt;td&gt;         &lt;div&gt;data&lt;/div&gt;       &lt;/td&gt;       &lt;td&gt;         &lt;div&gt;data&lt;/div&gt;       &lt;/td&gt;       &lt;td&gt;         &lt;div&gt;data&lt;/div&gt;       &lt;/td&gt;       &lt;td&gt;         &lt;div&gt;data&lt;/div&gt;       &lt;/td&gt;       &lt;td&gt;         &lt;div&gt;data&lt;/div&gt;       &lt;/td&gt;       &lt;td&gt;         &lt;div&gt;data&lt;/div&gt;       &lt;/td&gt;       &lt;td&gt;         &lt;div&gt;data&lt;/div&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt; &lt;/table&gt;   The heading itself is wrapped in a div inside the th tag for reasons pertaining to the javascript on the page.    The table is coming out with the headings wrapping onto multiple lines.  This seems to only happen when the table is sufficiently wide, as the browser is trying to avoid horizontal scrolling.  In my case, though, I want horizontal scrolling.  Any ideas?
3791
Why are login forms always centered on the screen? Most horizontally, some vertically also. Sites like Apple/Amazon/Adobe/Microsoft/Google/PayPal/Instagram/Twitter etc. are all centered! Is this an undocumented best practice everyone unanimously decided to use?         &ndash; Wireframes created with   Obviously it's most aesthetically pleasing, but is there any other reasons why?  Edit: Many of these sites do not support mobile either, so it wasn't done specifically for that.
19983
I would like to know how to theme Drupal 7  elements? I want to change the HTML structure of every element, not just wrap form with div or something like that. And I want to leave theme's elements as they were.  EDIT: I would like to add class to label and input type radio button.
39221
So, I can create an input button with an image using &lt;INPUT type=&quot;image&quot; src=&quot;/images/Btn.PNG&quot; value=&quot;&quot;&gt;  But, I can't get the same behavior using CSS. For instance, I've tried &lt;INPUT type=&quot;image&quot; class=&quot;myButton&quot; value=&quot;&quot;&gt;  where &quot;myButton&quot; is defined in the CSS file as .myButton {     background:url(/images/Btn.PNG) no-repeat;     cursor:pointer;     width: 200px;     height: 100px;     border: none; }  If that's all I wanted to do, I could use the original style, but I want to change the button's appearance on hover (using a myButton:hover class). I know the links are good, because I've been able to load them for a background image for other parts of the page (just as a check). I found examples on the web of how to do it using JavaScript, but I'm looking for a CSS solution. I'm using Firefox 3.0.3 if that makes a difference.
587
I’ve found a small, yet annoying, CSS-error in the mobile view of Stack Exchange. It seems like long titles breaks the style, which causes the up-vote arrow and the answer button to break the row and fall beneath the intended spot. From the looks of it, the title cell, or the tags, increase too much and causes this minor CSS-error.    Is it possible to fix this?