AmitDiwan has Published 10744 Articles

What is a clearfix?

AmitDiwan

AmitDiwan

Updated on 18-Oct-2022 07:15:40

374 Views

The clearfix, as the name suggests, is used to clear floats. It is generally used in float layouts. The clearfix is considered a hack to clear floats. Overflow Issue Example Let us see the problem first before moving towards the solution. We have an image here, floated to the right. ... Read More

How can I center text (horizontally and vertically) inside a div block?

AmitDiwan

AmitDiwan

Updated on 17-Oct-2022 14:06:54

8K+ Views

We can easily center text inside a div both horizontally and vertically. Let us see them one by one. Center Text in Div Horizontally using the text-align property To center text in div horizontally, use the text-align property. The text-align property determines the way in which line boxes are aligned ... Read More

How to remove extra space below the image inside div?

AmitDiwan

AmitDiwan

Updated on 17-Oct-2022 14:00:51

5K+ Views

To remove extra space below the image inside div, we can use CSS. The following CSS properties can be used to get rid of the space − The vertical-align property The line-height property The display property Before moving further, let us see how the extra space below an ... Read More

How can I vertically align elements in a div?

AmitDiwan

AmitDiwan

Updated on 17-Oct-2022 10:04:50

6K+ Views

We can easily vertically align elements in a div using any of the following ways − The position property The line-height property The padding property Let us see the examples one by one − Vertically align elements in a div using the position property The position property is ... Read More

How to remove the space between inline-block elements?

AmitDiwan

AmitDiwan

Updated on 17-Oct-2022 09:46:24

731 Views

We can easily remove the space between inline-block elements. Before moving further, let us first create an HTML document and add inline-block elements with space −Example DOCTYPE html> Inline block elements li { ... Read More

Kotlin Program to Find the Area of a parallelogram

AmitDiwan

AmitDiwan

Updated on 17-Oct-2022 08:57:02

294 Views

In this article, we will understand how to find the area of a parallelogram. The area of a parallelogram is calculated using the formula by − base * height Below is a demonstration of the same − Suppose our input is − Base: 6 Height: 8 The desired output ... Read More

Kotlin Program to Find the Perimeter of a Circle

AmitDiwan

AmitDiwan

Updated on 17-Oct-2022 08:53:40

492 Views

In this article, we will understand how to find the perimeter of a circle. The perimeter of a circle is calculated using the formula. (2*22*radius)/7 You can also write the above as − 2ℼr The value of ℼ is 22/7 or 3.14. Suppose our input is − Radius ... Read More

Kotlin Program To Find The Area of a Trapezium

AmitDiwan

AmitDiwan

Updated on 17-Oct-2022 08:47:26

244 Views

In this article, we will understand how to find the area of a trapezium. The area of a trapezium is calculated using the formula. (height/2 * (side1 + side2)) Below is a demonstration of the same − Suppose our input is − side1 = 5 side2 = 6 height ... Read More

Kotlin Program to Find Area of Square

AmitDiwan

AmitDiwan

Updated on 17-Oct-2022 08:36:25

760 Views

In this article, we will understand how to find the Area of a Square. The area of a square is calculated using the formula. side*side Below is a demonstration of the same − Suppose our input is − Length of the side : 4 The desired output would ... Read More

Kotlin Program to Calculate the Power of a Number

AmitDiwan

AmitDiwan

Updated on 17-Oct-2022 08:29:27

636 Views

In this article, we will understand how to calculate the power of a number. The calculate the power of a number is calculated using a loop and multiplying it by itself multiple times. Below is a demonstration of the same − Suppose our input is − Number : 4 Exponent ... Read More

Advertisements