AmitDiwan has Published 11365 Articles

How can I vertically center a div element for all browsers using CSS?

AmitDiwan

AmitDiwan

Updated on 21-Nov-2023 21:37:07

827 Views

To vertically center a div element for all browsers using CSS, use the Flexbox. CSS3 provides another layout mode Flexible Box, commonly called as Flexbox. Using this mode, you can easily create layouts for complex applications and web pages. Unlike floats, Flexbox layout gives complete control over the direction, alignment, ... Read More

How to create a file upload button with HTML?

AmitDiwan

AmitDiwan

Updated on 21-Nov-2023 21:12:19

1K+ Views

To create a file on upload button with HTML, the code is as follows −Example File upload button example Click on the "Choose File" button to upload a file: OutputThe above code will produce the following output −On clicking the “Choose file” button −

How to Clear the Canvas for Redrawing?

AmitDiwan

AmitDiwan

Updated on 21-Nov-2023 20:56:07

1K+ Views

To clear the canvas for redrawing, use the canvas.clearRect() method in HTML. It clears the specified pixels. The parameters of the method includes − x − The x-coordinate to clear y − The y-coordinate to clear width − The width of the rectangle to clear height − The height ... Read More

HTML DOM Form submit() method

AmitDiwan

AmitDiwan

Updated on 20-Nov-2023 12:33:44

1K+ Views

The HTML DOM Form submit() method is used for submitting the form data to the address specified by the action attribute. It acts as a submit button to submit form data and it doesn’t take any kind of parameters.SyntaxFollowing is the syntax for Form submit() method −formObject.submit()ExampleLet us look at ... Read More

Make container shrink-to-fit child elements as they wrap in HTML

AmitDiwan

AmitDiwan

Updated on 20-Nov-2023 12:05:55

965 Views

We can easily make container shrink-to-fit child elements as they wrap. First, we will set the flex container flexible − display: flex; We will set the flex items to wrap − flex-wrap: wrap; Set the text center aligned using the text-align property − text-align: center; ... Read More

HTML DOM Form reset() method

AmitDiwan

AmitDiwan

Updated on 18-Nov-2023 03:35:42

1K+ Views

The HTML DOM Form reset() method is used for resetting all the values of the form elements and displaying the default values that are specified using the value attribute of the form elements. It acts as a reset button to clear form data and it doesn’t take any kind of ... Read More

How to create a 2-column layout grid with CSS?

AmitDiwan

AmitDiwan

Updated on 17-Nov-2023 11:30:34

2K+ Views

To create a 2-column layout grid on a web page, we will create and position two divs, one on the left and the next on the right. Create the First div To begin with, we will create a div, beginning with the left div − Some random text on the ... Read More

How to create a "user rating" scorecard with CSS?

AmitDiwan

AmitDiwan

Updated on 17-Nov-2023 11:27:51

587 Views

To create a user rating scorecard, first set the exact icon for a star. That would be done using the Font Awesome icons. The individual ratings are displayed as progress bars. Set the Icon for Star Rating The icon for the star rating is set using Font Awesome Icons. We have added ... Read More

How to create a "to-do list" with CSS and JavaScript?

AmitDiwan

AmitDiwan

Updated on 17-Nov-2023 11:16:14

290 Views

A to-do list allows you to manage your task. It is like a note. When you type what needs to be done, for example, meeting at 4PM, you press Enter. On pressing Enter, the task gets added and a section for another task is visible wherein you can type the ... Read More

How to create a "scroll back to top" button with CSS?

AmitDiwan

AmitDiwan

Updated on 17-Nov-2023 11:08:36

470 Views

On a lot of websites, you must have seen a Top button while you scroll to the bottom. That is called the “scroll back to top” button. Create a Button First, create a button that will be clicked to reach the top − Top Style the top Button The display is set to none to ... Read More

Advertisements