WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Child Theme Troubleshooting (7 posts)

  1. TGTTGIT
    Member
    Posted 1 year ago #

    I'm creating a child theme for responsive, and everything was going fine until now.

    I want to change this bit of code so that the margin is -6px:

    #logo {
    	float:left;
    	margin:0px;
    }

    It works when I directly edit the parent theme, but not when I edit the child theme. Here's what my child theme looks like:

    @import url('../responsive/style.css');
    
    .featured-title {
         font-size: 40px;
    }
    
    #logo {
    	margin:-6px;
    }

    Any ideas what could be causing this?

  2. Emil Uzelac
    Theme Review Admin
    Posted 1 year ago #

    Right, you can't apply negative to all margins at the same time, what are you trying to do and is there a live site to take a look at?

    Emil

  3. TGTTGIT
    Member
    Posted 1 year ago #

    Mysteriously enough, its now working. Sorry to bother everyone; I tried it 3 or 4 times, and waited a bit to account for latency, I don't know why its working now. Must have something to do with the server.

  4. Emil Uzelac
    Theme Review Admin
    Posted 1 year ago #

    It could be :) Can you please click resolve if there's no more questions about this particular element?

    And as always thank you so much for using Responsive and if you need more help please head over our support forum :)

    Thanks,
    Emil

  5. TGTTGIT
    Member
    Posted 1 year ago #

    Sorry Emil, but its not live. Again, its working now, but what do you mean I can't apply negative to all margins at the same time? Isn't it only applying negative margins to the logo section?

  6. TGTTGIT
    Member
    Posted 1 year ago #

    Oh, you wrote it? Its awesome, thanks a bunch. WIll mark this as resolved.

  7. Emil Uzelac
    Theme Review Admin
    Posted 1 year ago #

    Thanks! They will work, however when using -6px (negative margins) they're actually being "pushed" two ways instead of all four.

    For example:

    #logo {
        margin:-6px 0 0 0;
    }

    will "push" the logo up, but when using

    #logo {
        margin:-6px;
    }

    that will "push" the logo up and left, while right and bottom will stay the same. Positive margins are very much needed to get negative ones working the way they should. Not sure if this makes any sense?

    if you use 0 that would still be considered positive :)

    When negative margins are involved, the size of the collapsed margin is the sum of the largest positive margin and the smallest (most negative) negative margin.

    Thanks,
    Emil

Topic Closed

This topic has been closed to new replies.

About this Topic