Sunday, January 1, 2012

CSS: Universal Selector

Universal selector is "*". The CSS rule in universal selector will be applied to all elements in the document.

Example:
<html>
<head>
<title>Mobile-Web-App</title>
<style>

#marketplace{
background-image: url("marketplace.png");
}
#live{
background-image: url("live.png");
}
#bugzilla{
background-image: url("bugzilla.png");
}
#forums{
background-image: url("forums.png");
}
#planet{
background-image: url("planet.png");
}
#wiki{
background-image: url("wiki.png");
}
#portal{
background-image: url("portal.png");
}

*{
height:50px;
background-repeat: no-repeat;
background-position: bottom right;
}
</style>
</head>
<body>

<h1>Mobile-Web-App: Universal Selector</h1>
<div id="marketplace">marketplace</div>
<div id="live">live</div>
<div id="bugzilla">bugzilla</div>
<div id="forums">forums</div>
<div id="planet">planet</div>
<div id="wiki">wiki</div>
<div id="portal">portal</div>

</body>
</html>

CSS: Universal Selector

No comments:

Post a Comment