Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9137403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:05:57+00:00 2026-06-17T09:05:57+00:00

Suppose I have a <div> which I would like to expand from a small

  • 0

Suppose I have a <div> which I would like to expand from a small size to a bigger size (See this).

By default, a width and height CSS3 transition on a <div> will start from the top left and progress to the bottom right. However, I want the <div> to expand from the top right corner to the bottom left.

Here is my question: Is there any way I could make the <div> undergo a width and height transition from the top right corner to the bottom left?

Here’s an image to clarify my question. Basically, I would like my <div> to expand like the box on the right, not like the default way, shown by the box on the left.
Description of Problem: I would like my <code><div></code> to expand from the top right to the bottom left, as shown below, rather than from the top left to the bottom right.

Here’s another image:
enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:05:58+00:00Added an answer on June 17, 2026 at 9:05 am

    Because you want to have things "shift", then you don’t really see the fact that it is growing from the right to the left, but I think this achieves what you are desiring (it tweaks some other margins, and adds a relative shift):

    div {
        width:100px; 
        height:100px; 
        float:left;
        margin:5px;
        position: relative;
        right: 0;
        box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
        background-color:rgba(25,25,25,0.7);
        transition: all 0.5s ease;
    }
    div:hover {
        width:200px;
        height:200px;
        margin:10px 115px 0px -105px;
        right: -110px;
    }
    <div></div>

    Note, simply because of the nature of floats and having the items shift, you will get some bizarre behavior with many elements. Play around with this fiddle when it is downsized so there are at least two rows of divs.

    Explanation of Margins

    The 115px right margin pushes the following element over (the "shift" you wanted) making space for the element to expand. It is the width of the element, plus the 5px margins on the elements, plus the fact that the larger size element is increasing its margin to 10px. It is into this space that the right shift occurs. The direction of the expansion itself happens through the -105px, which is what causes the element to expand left (as you originally wanted).

    UPDATE to your newer pictures: Take a look at this fiddle. There are still some small bugs, but functions nicely based on a set of three div’s (there is an extra non-semantic span to make my functionality work).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this jquery script which suppose to hide/show div element base on the
A newbie question,really. Suppose I have a html table like this: <div id=div1> <table
I have a div, which contains an image and a span. I would like
suppose I have a simple container which have three element: <div> <span>hello world</span> <input
Suppose I have an div. Inside this div, I have two divs floating left,
Suppose I have this html markup: <div id=wrapper> <pre class=highlight> $(function(){ // hide all
Suppose i have this structure of elements: <div class=parent> <div class=something1> <div class=something2> <div
Suppose I have the following html: This a test of <code>some code</code>. <div class='highlight'>
I have this conditional select, which does what it's supposed to. See fiddle here
I have a db model for which I would like to edit with multiple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.