The starting point for the height and width transition

Is it possible to specify the starting location of a transition?

For example, if I have the following transition set for height and width -

transition: width 2s, height 2s, transform 2s

Here is an example on jsFiddle.

Currently, the rectangle starts growing from its upper left corner. How can I change it to start growing from the center of its upper side, like in the image below?

Any suggestions on how to achieve this desired effect?

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips on detecting a collision between a cube mesh and the boundaries of a browser using ThreeJS

I'm a beginner in 3D games and ThreeJS. In the image above, my Mesh is located at the left boundary of the browser with a position of -1035 instead of 0. This leads me to question what exactly is the relationship between mesh.position.x in ThreeJS and ...

Hero images of the highest quality can become unclear as they are reduced in size

I've been investigating an issue with the full-width hero images on my Wordpress site that appear blurry on certain mobile devices, particularly at smaller sizes. The images in question are 1920 x 1080 pixels. When viewing the images between a width ...

Display a floating label above the text input when it is focused or when it holds text

I am trying to create an animated search bar where the label moves from being over the text input to above it. I came across a helpful example in a fireship.io video, which includes the CSS and HTML code available here The example I found demonstrates the ...

Bony Scaffold - halting the motion of specific components

Currently, I am utilizing skeleton to create a fluid layout, which is functioning effectively for the most part. However, I have encountered an issue specifically with the 2 column layout on Magento at this URL: In this setup, the navigation on the left s ...

Animate the background image with a float effect using jQuery's timeout feature to create an up

I'm having an issue with a set of elements that have background images applied to them. Specifically, I want the planets in the images (all except the first one) to move slightly up and then back down to create a floating effect. In my jQuery code, I ...

Unable to engage with any items on the display when the Material UI (MUI) Select Menu is active

In my web application, I am utilizing Material UI's Select component. Upon using it, I encountered a restriction where the user is unable to interact with anything else on the screen while the Select menu is open. This includes the inability to click ...

Firefox causing issues with the positioning of 2 div elements

I am experiencing an issue with my website. I have a content container where I display photos on the left and product descriptions on the right side. The layout appears correctly in Chrome but not in Mozilla Firefox. I'm unsure of what may be causing ...

Update the appearance based on the dimensions of the parent container with Bootstrap

Here's the situation I'm facing on my webpage: <div id="myDiv"> <p>A</p> <p>B</p> </div> If 'myDiv' is narrower than width X, display A & B vertically. Otherwise, display A and B horizo ...

Issues with displaying Bootstrap 5 second toast notifications

Hey there, I'm facing an issue with getting the second toast to display properly. Here is the HTML: <div class="toast-container position-fixed bottom-0 end-0 p-3"> <!-- FIRST --> <div class="toast" role="aler ...

The issue of JQuery and document ready being triggered multiple times while loading data into a control

Ever since implementing the load function to load content into a DIV upon document ready, I've noticed that all associated functions are firing multiple times (often twice, and sometimes endlessly). The scripts included in the head tag of all pages a ...

What is the best way to ensure that the background of my sticky table th stays in place and does not scroll away

I have a dynamic table where the table body rows are loaded dynamically. The wrapper uses Bootstrap5's overflow-scroll feature to keep the table at a fixed height and scroll if there are too many rows. I managed to make the table head sticky, but had ...

What could be the reason for my application not utilizing its bootstrap classes effectively?

Just starting out with Bootstrap and have made some progress. However, the bootstrap classes I'm using are not rendering properly. What could be the issue? <div class="position-absolute bottom-0 end-0 border border-dark"> https://i.ss ...

Determine total using PHP object

Can anyone assist me with adjusting this code? $aBlockVideos = (array) Advancedvideo_Service_Video::instance()->query("","v.total_comment DESC",1,5); I'm trying to figure out how to display the total number of comments for the current week. Any s ...

Refreshed the page following a setAttribute function call in Javascript

I have successfully implemented a function to switch between light and dark mode on my webpage using VueJS. However, I am facing an issue with the code: <a @click="toggleTheme" class="switch-mode" href> <div class=&q ...

Creating a Three-Row Table with Material-UI and React

I am looking to achieve a layout similar to the one shown in the image below: I want to construct a table with three rows, where the third row is positioned below the first and second rows, and the width of the third row is equal to the combined width of t ...

"Troubleshooting the issue of ng-init not functioning properly in conjunction

I need help with displaying a list of numbers inside a div element. I am attempting to achieve this using the following code snippet: <div ng-init="range=[1,10,3,4,5]" ng-repeat="n in range" > {{n}} </div> Unfortunately, the numbers withi ...

A problem encountered in specific JavaScript code

As a newcomer to JavaScript, I have encountered an issue while trying to run this script: <html> <head> <title>Exploring javascript functionalities</title> </head> <body> <p id="demo">I ...

Utilizing ASCII art in React: A guide to incorporating textual designs into your

I'm having trouble displaying ASCII images correctly on my React app. I've tried various methods, but nothing seems to maintain the form when rendered in the browser. <Grid container id="terminal_banner"> <Grid item ...

The styles are not being rendered on the Angular application

I have successfully implemented a Modal service with working HTML/CSS (Check it out on StackBlitz) div.cover { align-items: center; background-color: rgba(0, 0, 0, 0.4); bottom: 0; display: flex; justify-content: center; left: 0; ...

Looking to switch up the display of Ionic Infinite Scroll from vertical to horizontal orientation

Recently delving into Ionic Scroll and encountering a challenge. Finding it difficult to arrange content in a horizontal row. To illustrate my issue, I've created a [pen](http://codepen.io/shaikmaqsood/full/zBbREr/ This is the PEN) for better unders ...