Padding a table row

The trick is to give padding on the td elements, but make an exception for the first (yes, it’s hacky, but sometimes you have to play by the browser’s rules): First-child is relatively well supported: https://developer.mozilla.org/en-US/docs/CSS/:first-child You can use the same reasoning for the horizontal padding by using tr:first-child td. Alternatively, exclude the first column … Read more

Crop the image using JavaScript

In my Angular 6 application I am making a file upload option and in preview the uploaded file needs to be displayed with auto cropping and auto resizing. I have tried the following, HTML: File select functtion: In the above I have tried the following with the reference of link https://jsfiddle.net/8jwq3cs7/ Before using the canvas … Read more

What’s the difference between align-content and align-items?

The align-items property of flex-box aligns the items inside a flex container along the cross axis just like justify-content does along the main axis. (For the default flex-direction: row the cross axis corresponds to vertical and the main axis corresponds to horizontal. With flex-direction: column those two are interchanged respectively). Here’s an example of how align-items:center looks: But align-content is for multi line flexible boxes. It has … Read more

Why Css text-transform capitalize not working?

CSS text-transform: capitalize will only affect the first character. According to the specs: capitalize Puts the first character of each word in uppercase; other characters are unaffected. I strongly suggest to just have the content edited. Remember that at the end of the day, technologies such as css is just 1 way to solve the problem. The better solution, again, would … Read more