Commit 3e7d63cc authored by Thangaraj G's avatar Thangaraj G
Browse files

selectors.md

parent 44a0961f
Loading
Loading
Loading
Loading
+72 −0
Original line number Diff line number Diff line
#selectors
selectors is used to an style an individual unique styles is called a selectors
#types of selectors
1.universal selectors:In the selectors which is used to indicates the symbol * 
Eg:*{
    padding:10px
}
#class selectors
we used indicates the  class selectors is used in html we take as . and accessed
Eg:.p{
    margin:10px
}
#id selectors
we used to indicates the id selectors is used in the html we can take as # and accessed
Eg:#p{
    margin:10px
}
#descendant selectors(space)
In the selectors which can accessed as an space
Eg:div p{
    padding:5px
}
#child selectors(>)
In the selectors which can accessed as a greaterthan symbol(>)
In the selectors only style an child element only
eg:div > p{
    color:red
}
#adjacent silbling selectors(+)
In the selectors is used to style an outside an adjacent element (0nly one element) called div 
Eg:div + p{
    color:yellow
} 
#general silbling selectors(~)
In the selectors is used to style an outside of an entire element(over all element) 
Eg:div ~ p{
    color:orange
}
#pseudo classess
In the pseudo classes have an style an element there are 5types
#link
In the link attribute to style an link tag.
eg:a:link{
    color:red
}
# Visited
In the visited property which is used to an onces a user is visited the page is or not to find by an color of link.
eg:a:visited{
    color:yellow(visited)
}
#hover
In the hover property we used to change colors to the text to an particular property to been hovered
eg:div p:hover{
    color:orange
}
#focus 
In the property is used to focus the text what we want
eg:a:focus{
    color:orange
}#active
In the property is used to link is active or not to show an color
Eg:a:active{
    color:yellow
}


#pseudoelement:
To style an first word or first line is called as a pesudo element to use the property...
Eg:h1::first-letter{
    color:red
}p::first-line{
    color:yellow
}