Learn how to write CSS syntax, different type of selectors, property name and value, creating css class and applying on different control.
A CSS contains a set of rules that are interpreted by the browser and then applied to the corresponding elements in HTML document. So in different browser any html element with same CSS class may appear differently.
Any CSS style property rule has three parts
<table> or <div>
There are different type of selectors
You can define CSS property for any particular type in your common CSS file, then appearance of that type of element will remain same in your application, after setting this type of CSS property you don’t need to set any css class separately, here is an example of H1 type.
h1 { font-size:24px; color:#808080; }
.spHeader { font-size: 24px; color: #808080; background-color:#e4e4e4; padding:10px; }
<div class="spHeader"> </div>
Defining Id is conceptually same as class, only difference is that you define id with # hashtag.
Here is how you can write an Id in CSS.#spHeader { font-size: 24px; color: #808080; background-color:#e4e4e4; padding:10px; }
While using id on any html element, make sure the Id value is unique on that page.
Now to call the id in a div element <div id="spHeader"> </div>
{ font-size:12px; font-family:Verdana; }