Skip to content

Instantly share code, notes, and snippets.

View carlosrojaso's full-sized avatar
🎯
Focusing

Carlos Rojas carlosrojaso

🎯
Focusing
View GitHub Profile
<!DOCTYPE html>
<html>
<body>
<div id="result"></div>
<script>
// Check browser support
if (typeof(Storage) != "undefined")
{
@carlosrojaso
carlosrojaso / app cache
Last active August 29, 2015 14:01
app cache
<!DOCTYPE html>
<html manifest="demo_html.appcache">
<body>
<script src="demo_time.js">
</script>
<p id="timePara"><button onclick="getDateTime()">Get Date and Time</button></p>
<p><img src="http://carlosrojasblog.com/wp-content/uploads/2013/09/logotipo_w4.png" width="336" height="69"></p>
<p>Try opening <a href="tryhtml5_html_manifest.htm" target="_blank">this page</a>, then go offline, and reload the page. The script and the image should still work.</p>
</body>
</html>
@carlosrojaso
carlosrojaso / Server-Sent Events
Created May 12, 2014 07:33
Server-Sent Events
<!DOCTYPE html>
<html>
<body>
<h1>Getting server updates</h1>
<div id="result"></div>
<script>
if(typeof(EventSource)!=="undefined")
{
var source=new EventSource("demo_sse.php");
@carlosrojaso
carlosrojaso / CSS3 The border-radius
Created May 12, 2014 07:37
CSS3 The border-radius
<!DOCTYPE html>
<html>
<head>
<style>
div
{
border:2px solid #a1a1a1;
padding:10px 40px;
background:#dddddd;
width:300px;
@carlosrojaso
carlosrojaso / CSS3 The box-shadow
Created May 12, 2014 07:41
CSS3 The box-shadow
<!DOCTYPE html>
<html>
<head>
<style>
div
{
width:300px;
height:100px;
background-color:yellow;
box-shadow: 10px 10px 5px #888888;
@carlosrojaso
carlosrojaso / CSS3 The border-image
Created May 12, 2014 07:47
CSS3 The border-image
<!DOCTYPE html>
<html>
<head>
<style>
div
{
border:15px solid transparent;
width:250px;
padding:10px 20px;
}
@carlosrojaso
carlosrojaso / CSS3 The background-size
Created May 12, 2014 18:56
CSS3 The background-size
<!DOCTYPE html>
<html>
<head>
<style>
body
{
background:url(img_flwr.gif);
background-size:80px 60px;
background-repeat:no-repeat;
padding-top:40px;
@carlosrojaso
carlosrojaso / CSS3 The background-origin
Created May 12, 2014 19:02
CSS3 The background-origin
<!DOCTYPE html>
<html>
<head>
<style>
div
{
border:1px solid black;
padding:35px;
background-image:url('smiley.gif');
background-repeat:no-repeat;
@carlosrojaso
carlosrojaso / CSS3 Multiple Background Images
Created May 12, 2014 19:05
CSS3 Multiple Background Images
<!DOCTYPE html>
<html>
<head>
<style>
body
{
background:url(img_tree.gif),url(img_flwr.gif);
background-size:100% 100%;
background-repeat:no-repeat;
}
@carlosrojaso
carlosrojaso / CSS3 Linear Gradients
Created May 12, 2014 19:12
CSS3 Linear Gradients
<!DOCTYPE html>
<html>
<head>
<style>
#grad1
{
height:200px;
background: -webkit-linear-gradient(red, blue); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(red, blue); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(red, blue); /* For Firefox 3.6 to 15 */