Use of +/~ sign in css

In css3 + or ~ sign is new attribute.
It is work to apply css attribute in just after upcoming HTML Elements.

For Example HTML file is:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>krButani</title>
<style>
/*
Here, Rad color apply last p tag.
you can also use ~ sign like, ul ~ p
*/
ul + p {
color:red;
}
ul ~ p {
color:red;
}
</style>
</head>

<body>
<p>Butani</p>
<ul>
<p>Butani</p>
<li>killer</li>
</ul>
<p>Working</p>

</body>
</html>
Output is :

Comments

Popular posts from this blog

N Queen Problem using c and c++

Greedy Prim Algorithm using c/c++

m Coloring Problem using c or c++