Skip to main content

Forums

Home Forums CSS Styling Div Inside Div

This topic contains 4 replies, has 3 voices, and was last updated by  Xiija 1 year, 4 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #267582

    mustajab
    Participant

    Hello everyone. I am stuck in problem.
    I want to apply CSS transition and transformation property on DIV tag only separately. I got a logic and use one div to apply CSS transformation property and then applied div inside div(two div’s) for CSS transition property.

    But first div is affecting child div’s. Please help me out to solve this problem. I want separate property for each div. Below are screenshots for my problem explanation

    Code

    #267598

    Xiija
    Participant

    try adding an ID the div ?
    div id=”one”>div #1 apply CSS Tranformation
    div id=”two”>div #2 apply CSS Transition

    #267601

    mustajab
    Participant

    xiija thanks for replying. Just to confirm can the above problem be solved without using id or class

    #267606

    Paulie_D
    Moderator

    It’s not clear what it is you are trying to do.

    Do you want to combine the transform / transition on a single div?

    So you want the parent’s transform to not affect the child?

    Please clarify…in detail.

    #267669

    Xiija
    Participant

    Without an ID, you could do this in the css…?
    div
    { background-color: khaki;
    border:1px solid #222;
    }
    div:nth-child(1):hover
    { transform: translate(15px,15px) rotate(25deg) scale(1,1) skew(15deg,15deg);
    color: blue;
    }
    div:nth-child(2):hover
    { font-size: 50px;
    transition: font-size 3s;
    }

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

icon-link icon-logo-star icon-search icon-star