1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Remove the up and down line behavior

Discussion in 'HTML & Website Design' started by dabidovic123, Jul 30, 2022.

  1. #1
    Hi,

    I inserted this CSS code to reduce the top margin:

    .form-row.form-row-wide.create-account {
        margin-top: -25px;
    }
    Code (CSS):
    But, every time I refresh the page, the space that was reduced goes down and up.

    It looks like it goes to its previous place and comes back to the rectified place.

    How to remove this behavior?

    ---
    Also, in the cPanel editor, I got a warning message that says: "Don't use adjoining classes."
    Should I ignore it? Because when we don't adjoin them, the code doesn't work!

    Thank you very much,
     
    Last edited: Jul 30, 2022
    dabidovic123, Jul 30, 2022 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #2
    can you create something at codepen.io (or similar) that shows what you're talking about?

    goes up means it applies the CSS?
    goes down means something overwrites it?

    it must be very slow if you can see it.

    and where does cpanel come into it?
     
    sarahk, Jul 30, 2022 IP
  3. dabidovic123

    dabidovic123 Greenhorn

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    I share with you the screen record showing this behavior:
    https://www.screencast.com/t/5HwFdkhcBE
     
    dabidovic123, Jul 30, 2022 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #4
    So what I picked up on was that there's a long-form that loads with placeholders etc and then some javascript runs? and loads more CSS too.

    I'm guessing you're using a library like bootstrap and then you have a styles.css file with your styles that overwrite bootstrap - or maybe even inline styles. You've reached the point where your expectations exceed the library you are using. Would you consider copying the styling of those elements that jump about into a new class, removing the bootstrap styling from your HTML and replacing with your new styles? That way there's not bootstrap to overwrite and no jumping.
     
    sarahk, Jul 30, 2022 IP
  5. dabidovic123

    dabidovic123 Greenhorn

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #5
    I created and added a notice that is just above the "Create an account?".
    And, I did some CSS tweaks to adjust the margins.
    I tried to use transition:

    .form-row.form-row-wide.create-account {
    margin-top: -25px;
    transition: none;
    }
    
    Code (CSS):
    But, it doesn't work.
     
    dabidovic123, Jul 31, 2022 IP
  6. qwikad.com

    qwikad.com Illustrious Member Affiliate Manager

    Messages:
    7,151
    Likes Received:
    1,656
    Best Answers:
    29
    Trophy Points:
    475
    #6
    Since it's bootstrap or some other css mess, I'd just try different workarounds. Try adding display: inline; or display:inline-block; and/or vertical-align:top;

    Try this:

    .form-row.form-row-wide.create-account {
    margin-top: -25px;
    display: inline-block;
    vertical-align: top;
    }
    Code (CSS):
     
    qwikad.com, Jul 31, 2022 IP
  7. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #7
    Have you used the Replay browser to step through the loading process?
     
    sarahk, Jul 31, 2022 IP
  8. dabidovic123

    dabidovic123 Greenhorn

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #8
    Thanks @qwikad.com & @sarahk for your replies,
    I tried the suggested code in different combinations, but it doesn't seem to work.
     
    dabidovic123, Jul 31, 2022 IP
  9. qwikad.com

    qwikad.com Illustrious Member Affiliate Manager

    Messages:
    7,151
    Likes Received:
    1,656
    Best Answers:
    29
    Trophy Points:
    475
    #9
    I have a question. In that video I see two fields ("First name" "Last name") appearing and disappearing above "Order notes (optional)". Are you trying to hide those two fields completely or what?
     
    qwikad.com, Aug 1, 2022 IP
  10. dabidovic123

    dabidovic123 Greenhorn

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #10
    The two fields ("First Name" "Last Name") that appear and disappear are the shipping address fields.
    When the shipping information is different from the billing information, the user must check the radio button to display the list of fields to enter the information.
    By default, this radio button is not checked.
    This "appearing and disappearing" behavior is caused by a notice I added just above, "Create an account? This also causes "Create an account?" line to move up and down!
     
    dabidovic123, Aug 1, 2022 IP
  11. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #11
    First thing I'd think of is why are you using a negative margin instead of reducing the bottom padding or margin of the element before it?

    Though the use of pixel metrics on text content likely means the entire thing is an accessibility shit-show where if you came to me as a paying client, I'd tell you to throw it all away. As @sarahk said, your expectations are exceeding the capabilities of whatever front-end stack you're using.

    I really couldn't tell you more without seeing the actual code, but I suspect you've probably got two to ten times the markup needed and five to sixteen times the CSS needed, possibly with "blocking scripting" involved where scripting shouldn't even be present.

    You'll notice most of the other responders keep asking to see the actual code. There's a reason for that. Your goofy little video NOT helping you get an answer.

    It's like asking a brain surgeon to supervise the removal of a tumor across a time phone to an 1880's old west dentist.
     
    deathshadow, Aug 1, 2022 IP
  12. dabidovic123

    dabidovic123 Greenhorn

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #12
    Hi @deathshadow , @qwikad.com & @sarahk

    Indeed, I added a notice with this code :

    add_action('woocommerce_after_checkout_billing_form', 'my_custom_message');
    function my_custom_message() {
      if ( ! is_user_logged_in() ) {
      wc_print_notice( __('Do not have an account yet? Then simply select the checkbox below.'), 'notice' );
       }
    }
    PHP:
    and adjusted margins:

    .woocommerce-billing-fields__field-wrapper {
        margin-bottom: 50px;
      
    }
    
    .form-row.form-row-wide.create-account.woocommerce-validated {
        margin-top: -25px;
      
    }
    Code (CSS):
     
    Last edited: Aug 3, 2022
    dabidovic123, Aug 3, 2022 IP