Results 1 to 7 of 7

Thread: Extra spacing for php conditioned link?

Threaded View

  1. #1
    Join Date
    Apr 2010

    Question Extra spacing for php conditioned link?

    At first it was just a simple href link with a background image, and they all stacked next to each other nicely.

    Now I added a little php if condition where if user is logged in show "Logout" link, otherwise show "Login" link and what it does now is add a weird extra spacing on both sides of the button, which it turn makes other buttons slide next line.

    The button has the same class and styling, and identical to the other link buttons except for that php if statement.

    The illustration:


    PHP condition:
    <?php if (!$signed) { ?>
          <a class="button" href="<?php echo str_replace('&', '&amp;', $signed); ?>">Login</a>
          <?php } else { ?>
          <a class="button" href="<?php echo str_replace('&', '&amp;', $signout); ?>">Logout</a>
    <?php } ?>
    CSS for button:
    #menu .button {
    margin-left: 1px;
    margin-right: 0px;
    margin-top: 0px;
    width: 101px;
    height: 40px;
    background: url(button.gif) no-repeat;
    display: inline-block;
    border: 0px;
    What is causing that kind of behavior?
    Its cross browser issue by the way, and no I don't use ie6.
    Last edited by user438; 04-28-2010 at 10:36 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center