Thursday, January 23, 2014

align text vertical center in div with css

Basic:
#box { height: 90px; line-height: 90px; }

A more versatile approach:
div { width: 250px; height: 100px; line-height: 100px; text-align: center; }
 span { display: inline-block; vertical-align: middle; line-height: normal; }

Display Table: 

div { display: table; width: 250px; height: 100px; text-align: center; }
span { display: table-cell; vertical-align: middle; }

Friday, January 17, 2014

Body image background

img#background {
 height: 100%; width: 100%; z-index: -1; position:absolute; color: white; 
 min-height: 100%;
 min-width: 1024px;
 width: 100%;
 height: auto;
 position: fixed;
 top: 0;
 left: 0;
}
 
<img id="background" src="image-location" alt="Background-image"> 

Thursday, January 09, 2014

Unblod text in safari

-webkit-font-smoothing: antialiased;

Friday, May 04, 2012

sup css to adjust font

sup{ font-size:11px; font-weight:normal ; height: 0; line-height: 1; vertical-align:top; _vertical-align: bottom; position: relative; }

Tuesday, February 07, 2012

Google Web Fonts

https://developers.google.com/webfonts/docs/getting_started#Subsets

Saturday, October 08, 2011

Create XML in PHP

<?php

// THIS IS ABSOLUTELY ESSENTIAL - DO NOT FORGET TO SET THIS
@date_default_timezone_set("GMT");

$writer = new XMLWriter();
// Output directly to the user

$writer->openURI('php://output');
$writer->startDocument('1.0');

$writer->setIndent(4);

// declare it as an rss document
$writer->startElement('rss');
$writer->writeAttribute('version', '2.0');
$writer->writeAttribute('xmlns:atom', 'http://www.w3.org/2005/Atom');


$writer->startElement("channel");
//----------------------------------------------------
//$writer->writeElement('ttl', '0');
$writer->writeElement('title', 'Latest Products');
$writer->writeElement('description', 'This is the latest products from our website.');
$writer->writeElement('link', 'http://www.domain.com/link.htm');
$writer->writeElement('pubDate', date("D, d M Y H:i:s e"));
$writer->startElement('image');
$writer->writeElement('title', 'Latest Products');
$writer->writeElement('link', 'http://www.domain.com/link.htm');
$writer->writeElement('url', 'http://www.iab.net/media/image/120x60.gif');
$writer->writeElement('width', '120');
$writer->writeElement('height', '60');
$writer->endElement();
//----------------------------------------------------



//----------------------------------------------------
$writer->startElement("item");
$writer->writeElement('title', 'New Product 8');
$writer->writeElement('link', 'http://www.domain.com/link.htm');
$writer->writeElement('description', 'Description 8 Yeah!');
$writer->writeElement('guid', 'http://www.domain.com/link.htm?tiem=1234');

$writer->writeElement('pubDate', date("D, d M Y H:i:s e"));

$writer->startElement('category');
$writer->writeAttribute('domain', 'http://www.domain.com/link.htm');
$writer->text('May 2008');
$writer->endElement(); // Category

// End Item
$writer->endElement();
//----------------------------------------------------


// End channel
$writer->endElement();

// End rss
$writer->endElement();

$writer->endDocument();

$writer->flush();
?>

Friday, September 09, 2011

play youtube video with mute sound

<script src="http://www.google.com/jsapi"></script>
<script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script>
<div id="ytapiplayer">You need Flash player 8+ and JavaScript enabled to view this video.</div>
<script type="text/javascript">
google.load("swfobject", "2.1");
function onYouTubePlayerReady(playerId) {
ytplayer = document.getElementById("myytplayer");
ytplayer.playVideo();
ytplayer.mute();
}
var params = { allowScriptAccess: "always" };
var atts = { id: "myytplayer" };
swfobject.embedSWF("http://www.youtube.com/v/YOUR-CODE-HERE?enablejsapi=1&playerapiid=ytplayer&allowFullScreen=true&version=3",
"ytapiplayer", "290", "160", "8", null, null, params, atts)
</script>