Search This Blog
Html tutorial, css tutorial, js tutorial, website creating tutorial, android app development tutorial, java tutorial, xml tutorial, programming tutorial
Featured
- Get link
- X
- Other Apps
Css Selector Tutorial with examples
CSS Selectors
css Selectors is the selection of html element you want to edit or style.
Css Element Selectors
here all <p> tags will be selected and codes inside css will be applied to all <p> tags.
Css Codes
p {
background-color:#fff000;
font-size:20px;
}
This code will create a background color and bigger font size of every content inside <p> tag.
CSS Id selector
Id is the unique id which can be given to any one element of html for that whole webpage. We will see it in the Example
you can add id like this
<p id="htmlid">
and then add css like this
Css code
#htmlid {
background-color:#fff000;
font-size:20px;
}
this code will create same thing as provided above about it
Css Class selector
Class is same as id but difference is that you can give same class to multiple element of html
you can add class in html like this.
<p class="htmlclass">
and can access and css like this
Css code
.htmlclass {
font-size:20px;
background-color:#000fff;
}
Css universal selector(*)
* as a selector is used to select html complete background.
Example
Css universal selector Example is here
Css Code
*{
background-color:#dd00dd;
font-color:blue;
}
Some Another Examples
div {
width: 320px;
padding: 10px;
border: 5px solid gray;
margin: 0;
}
ul.a {
list-style-type: circle;
}
ul.b {
list-style-type: square;
}
ol.c {
list-style-type: upper-roman;
}
ol.d {
list-style-type: lower-alpha;
}
ul {
list-style-image: url('sqpurple.gif');
}
- Get link
- X
- Other Apps
Popular Posts
Java tutorial. How to start with java. Tutorial
- Get link
- X
- Other Apps
Comments