piano0011 Posted July 20, 2018 Share Posted July 20, 2018 (edited) Hey guys! I am trying to add some horizontal rules to the following code and there should be one right before my second h2 tag (which is located at the end of the code) but it is showing a bit lower instead as shown below;... do I have to use position relative to move it, is this a common practice for this element? while ($row = mysqli_fetch_assoc($result)) { echo '<div class="update_heading">'; echo '<b><h2>Below are your premium membership information for Level 1</b></h2>'; echo '</div>'; echo '<br></br>'; echo '<div class="update_text">'; echo '<h3>'; echo 'Your premium membership subscription plan A is: <div class="information">'.$row['subscriptionplan'].'</div>'; echo '<br></br>'; echo 'Your premium membership date of subscription for subscription plan A is: <div class="information"> '.$row['subscriptionplandate'].'</div>'; echo '<br></br>'; if ($row['feesmonthly'] === null) { echo 'Your premium membership fee for subscription plan A is: <div class="information"> $'.$row['feesyearly'].'</div>'; } else { echo 'Your premium membership fee for subscription plan A is: <div class="information"> $'.$row['feesmonthly'].'</div>'; } echo '<br></br>'; if ($row['paid'] == 0) { echo 'Your premium membership payment status for subscription plan A is: <div class="information"> Not paid </div>'; } else { echo 'Your premium membership payment status for subscription plan A is: <div class="information">Paid</div>'; } echo '<br></br>'; echo 'Your premium membership expiry date for subscription plan A is: <div class="information">'.$row['expirydate'].'</div>'; echo '<br></br>'; echo 'Your premium membership paid by date for subscription plan A is: <div class="information">'.$row['paidbydate'].'</div>'; echo '<br></br>'; if ($row['emailreminder'] == 0) { echo 'You have <div class="information">no overdue fees </div> for subscription plan A'; } else { echo 'You have <div class="information"> overdue fees </div> for subscription plan A'; } echo '<br></br>'; if ($row['activate'] == 0) { echo 'You <div class="information">need to activate</div> your premium membership for subscription plan A'; } else { echo 'You <div class="information">have already activated</div> your premium membership for subscription plan A'; } echo '<br></br>'; echo '<br></br>'; echo '</h3>'; echo '</div>'; echo '<hr>'; echo '<div class="update_heading2">'; echo '<b><h2>Below are your premium membership information for Level 2</b></h2>'; echo '</div>'; Edited July 20, 2018 by piano0011 Quote Link to comment https://forums.phpfreaks.com/topic/307532-horizontal-line-not-showing-at-the-right-place/ Share on other sites More sharing options...
Barand Posted July 20, 2018 Share Posted July 20, 2018 Have you tried putting it where you want - right before the h2 tag? You also need to learn about nesting tags correctly - yours overlap as shown below. As header tags result, usually, in bold text, why are you even adding <b> tags? echo '<b><hr><h2>Below are your premium membership information for Level 2</b></h2>'; | | | | +-------|------------------------------------------------------------+ | | | +-----------------------------------------------------------------+ Quote Link to comment https://forums.phpfreaks.com/topic/307532-horizontal-line-not-showing-at-the-right-place/#findComment-1559878 Share on other sites More sharing options...
piano0011 Posted July 20, 2018 Author Share Posted July 20, 2018 I just tried it above the h2 tag as follows, without the position property but it looks like this: Quote Link to comment https://forums.phpfreaks.com/topic/307532-horizontal-line-not-showing-at-the-right-place/#findComment-1559880 Share on other sites More sharing options...
Barand Posted July 20, 2018 Share Posted July 20, 2018 Having seen some of your previous css code I am going to guess that you have so many items with relative positioning that things can crop up anywhere. Comment out all of your css styling and see where things land. Quote Link to comment https://forums.phpfreaks.com/topic/307532-horizontal-line-not-showing-at-the-right-place/#findComment-1559889 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.