CSS Advanced topics
Transforms
There are many types of transforms, we will see some of them and their examples and use in the following paragraph.
- ROTATE
- SCALE
- SKEW
Let us now go in-depth about each of them:
- rotate(30deg) transform the angular orientation of thr elent to a different which is given as parameter to the function
- scaleX(3.5) will make the element double or as many times you want along the X-axis using the vaue you give to the function
- scaleY(2) will make the element double or as many times you want along the Y-axis using the vaue you give to the function
- scale(6,7) will make the element double or as many times you want along the X-axis and Y-axis using the vaue you give to the function
div {
transform: rotate(30deg);
}
Transitions
For example, if the transition time for a particular html element is 5s then the transition will take 5 seconds to go from its initial position to its final position.
There are 5 ways in which a html element can transit from one position to another. Here are the following five ways:
- linear => All the transition happens ata linear same pace
- ease => The transition changes very slowly both at the start,end and the middle part of the transition
- ease-in => In this the transition starts slowly but it gains speed ie it accelerates quickly to the destination position
- ease-out => In this the gtransition starts out very slowly and itgains space after the half time of the total duration of the transition
- ease-in-out => In This, the transition starts slowly for the first quarter, linear in the half time and again slow in the end
calc() function:
What this will be do is takes the MRP of the item as 100 ruppees deduct 6 rupees and then add a service changes of 36 to make the profit 30
Pseudo Selectors
The pseudo selectors are prefixed by the : or :: symbol
Examples:
- :nth-child(int or even or odd) - example => select 9th child element or all even or all odd child elements
- :nth-of-type(int or even or odd) - example => select 3rd <p> child or all even numbered <p> children or all odd numbered <p> child
- :hover - example => change the color of a hyperlink when you hover over it
- :visited - example => chnage the color of the hyperlink when you have visited the destination web page after clicking on that link
- :active - example => change the color of the hyperlink when the user has just pressed the hyperlink
Comments
Post a Comment