Gyancode

A free library of HTML, CSS, JS

Search This Blog

Wednesday 8 March 2017

Vertical align elements of different heights

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Vertical align elements of different heights</title>
</head>
<style type="text/css">
* {margin:0;padding:0}
.outer {position:relative;display:table;height: 200px;width: 200px;    vertical-align: middle; text-align: center;    border: 1px solid #CCCCCC;    background:#ddd;    float:left}
.inner {width:100%;    display:table-cell;    vertical-align:bottom;    position:relative;}
p{background:#f6f6f6;border:1px solid #000; font-family: verdana; font-size: 13px;}
    </style>

<body>
<div class="outer">
  <div class="inner">
    <p>This is some random text : </p>
  </div>
</div>
<div class="outer">
  <div class="inner">
    <p>This is some random text : This is some random text : This is some random
      text : </p>
  </div>
</div>
<div class="outer">
  <div class="inner">
    <p>This is some random text : This is some random text : This is some random
      text : This is some random text : This is some random text :</p>
  </div>
</div>
<div class="outer">
  <div class="inner">
    <p>This is some random text : This is some random text : This is some random
      text : This is some random text :</p>
  </div>
</div>

</body>
</html>

Monday 6 March 2017

Page Redirect another Url in 3 Seconds

You can past this code at the top of your page in the <head> section:
content="3" means second

<META http-equiv="refresh" content="3;URL=step2.htm">

Friday 3 March 2017

Table Css with Border and Background

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Border and Background</title>
</head>
<style type="text/css">
        table{}
        table tr{ border: 1px #eee solid;}
        table tr th{ border-bottom: 1px #ccc solid;border-top: 1px #ccc solid; margin: 0px; padding: 5px; border-right: 1px #ccc solid; background: #eee;}
        table tr th:first-child{ border-left:1px #ccc solid;}
        table tr td{ border-bottom: 1px #ccc solid; padding: 5px; margin: 1px; /* border-left: 1px #ccc solid; */ border-right: 1px #ccc solid;}
        table tr td:first-child{ border-left:1px #ccc solid;}
    </style>

<body>
<table width="700" cellpadding="10" cellspacing="0">
            <tr>
                <th>Demo</th>
                <th>Demo</th>
                <th>Demo</th>
                <th>Demo</th>
            </tr>
            <tr>
                <td>Test Text</td>
                <td>Test Text</td>
                <td>Test Text</td>
                <td>Test Text</td>
            </tr>
            <tr>
                <td>Test Text</td>
                <td>Test Text</td>
                <td>Test Text</td>
                <td>Test Text</td>
            </tr>
        </table>

</body>
</html>

Width and Spacing Table Create


<html>
    <head>
        <title>Width and Spacing</title>
        <style type="text/css">
            th, td {background-color: #eee;}
        </style>
    </head>
    <body>
        <table width="700" cellpadding="10" cellspacing="5">
            <tr>
                <th width="150"></th>
                <th>Withdrawn</th>
                <th>Credit</th>
                <th width="150">Balance</th>
            </tr>
            <tr>
                <th>January</th>
                <td>250.00</td>
                <td>660.50</td>
                <td>410.50</td>
            </tr>
            <tr>
                <th>February</th>
                <td>135.55</td>
                <td>895.20</td>
                <td>1170.15</td>
            </tr>
        </table>
    </body>
</html>