and
) will have the above style properties. Try it by typing the above in your mywebpage.html within the head tags. Save it and refresh your browser and see effect in your web page.
Let's see another example:
< style type="text/css"> p {
margin: 20px;
color: #cff;
background: #ccc;
text-align: right;
}
All of your content that you have placed within < p> and
will have the above style properties. Now, type the above to your mywebpage.html within the head tags, save and refresh your browser and see the results.
Now, let's make our own selectors. As explained in creating CSS boxes, we can make an id and a class selectors and implement as follows:
< style type="text/css"> #ownidselector {
margin: 0px;
text-decoration: underline;
background: cff;
}
.ownclassselector {
margin: 10px;
font-size: 16px;
font-style: italic;
color: #f00;
}
.ownclassselector2 {
font-weight: bold;
font-family: courier;
border: 1px dashed #cff;
}
< body>
< div id="ownidselector">This is an example of using the id selector < div class="ownclassselector">This is an example of using the class selector < div id="ownidselector" class="ownclassselector">This is an example of using both the id and class selectors < span id="ownidselector">This is an example of using span with id selector and class selector This is an example of using both the id and class selectors This is an example of using the two class selectors at the same time
0 comments:
Post a Comment