The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
How to set margin f...
 
Share:
Notifications
Clear all

[Solved] How to set margin for "Leave a Reply" header?

5 Posts
2 Users
0 Reactions
1,123 Views
Posts: 31
Topic starter
(@supertrooper)
Trusted Member
Joined: 4 years ago

In order to insert the "Leave a Reply" header the following code has been inserted in the functions.php file:

add_action('wpdiscuz_comment_form_before', function() {
echo '<h2 style="max-width: 750px;margin: 0px auto;">' . __('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Leave a Reply', 'wpdiscuz') . '</h2>';
});

The problem is that the left margin varies depending on the device type and the screen width. e.g. desktop, tablet or mobile phone.

Is there a way to "replace &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" by a percentage of the screen width in order to have a proportional margin?

 

4 Replies
Asti
Posts: 7661
 Asti
Support
(@asti)
Illustrious Member
Joined: 7 years ago

@supertrooper,

Could you please leave some example URL? 

Posts: 31
1 Reply
Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7661

@supertrooper,

Please remove those "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" and configure the margin using the CSS code below: 

div#respond h3 {
       margin-left: 7% !important;
}

Just change the red marked value as you like. 

Posts: 31
Topic starter
(@supertrooper)
Trusted Member
Joined: 4 years ago

@asti

Your fix works perfectly.

Thanks for the great support.

Share: