Alternate table row color using CSS?

$(document).ready(function() { $(“tr:odd”).css({ “background-color”:”#000″, “color”:”#fff”}); }); tbody td{ padding: 30px; } tbody tr:nth-child(odd){ background-color: #4C8BF5; color: #fff; } <script src=”https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js”></script> <table border=”1″> <tbody> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> </tr> <tr> <td>5</td> <td>6</td> <td>7</td> <td>8</td> </tr> <tr> <td>9</td> <td>10</td> <td>11</td> <td>13</td> </tr> </tbody> </table> There is a CSS selector, really a pseudo-selector, called nth-child. In pure … Read more

Using CSS for a fade-in effect on page load

Method 1: If you are looking for a self-invoking transition then you should use CSS 3 Animations. They aren’t supported either, but this is exactly the kind of thing they were made for. CSS #test p { margin-top: 25px; font-size: 21px; text-align: center; -webkit-animation: fadein 2s; /* Safari, Chrome and Opera > 12.1 */ -moz-animation: fadein … Read more

How do I keep two side-by-side div elements the same height?

Flexbox With flexbox it’s a single declaration: .row { display: flex; /* equal height of the children */ } .col { flex: 1; /* additionally, equal width */ padding: 1em; border: solid; } <div class=”row”> <div class=”col”>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</div> <div class=”col”>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad omnis … Read more

CSS Image size, how to fill, but not stretch?

You can use the css property object-fit. (“sets how the content of a replaced element, such as an <img> or <video>, should be resized to fit its container.”) .cover { object-fit: cover; width: 50px; height: 100px; } <img src=”http://i.stack.imgur.com/2OrtT.jpg” class=”cover” width=”242″ height=”363″ /> See example here There’s a polyfill for IE: https://github.com/anselmh/object-fit Related: object-position (specifies … Read more

How to add multiple font files for the same font?

The solution seems to be to add multiple @font-face rules, for example: @font-face { font-family: “DejaVu Sans”; src: url(“fonts/DejaVuSans.ttf”); } @font-face { font-family: “DejaVu Sans”; src: url(“fonts/DejaVuSans-Bold.ttf”); font-weight: bold; } @font-face { font-family: “DejaVu Sans”; src: url(“fonts/DejaVuSans-Oblique.ttf”); font-style: italic, oblique; } @font-face { font-family: “DejaVu Sans”; src: url(“fonts/DejaVuSans-BoldOblique.ttf”); font-weight: bold; font-style: italic, oblique; } By … Read more

Flex-box: Align last row to grid

Add a ::after which autofills the space. No need to pollute your HTML. Here is a codepen showing it: http://codepen.io/DanAndreasson/pen/ZQXLXj .grid { display: flex; flex-flow: row wrap; justify-content: space-between; } .grid::after { content: “”; flex: auto; }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)