SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Mar 2014
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Menu with arrow pointing up dilemma

    Hello, I am attempting to construct an element from a psd mockup. I am not a css expert but have made an honest attempt. A screenshot of the element can be seen from the drop-box link and my attempt can be viewed by selecting the codePen link. As you can see the green line below the arrow is not flush with the left side of the circle link because of the way I added padding to give space between the circles. If anyone knows of a better way to do this I would appreciate your input. My code is also below. Thanks.

    Drop-box link:
    https://www.dropbox.com/s/75j10n77ss...26.40%20PM.png

    CodePen result:
    http://codepen.io/aaronbalthaser/full/BciIv

    HTML:

    <div id="navigation-footer">
    <nav>
    <ul>
    <li>
    <div class="wrap">
    <a href="#">Home</a>
    <span class="active"></span>
    </div>
    </li>
    <li>
    <div class="wrap">
    <a href="#">About</a>
    </div>
    </li>
    <li>
    <div class="wrap">
    <a href="#">Support</a>
    </div>
    </li>
    <li>
    <div class="wrap">
    <a href="#">Install</a>
    </div>
    </li>
    <li>
    <div class="wrap">
    <a href="#">Contact</a>
    </div>
    </li>
    </ul>
    </nav>
    </div>

    CSS:

    div.wrap {
    padding: 12px;
    }

    ul {
    width: 100%;
    float: left;
    margin: 0;
    padding: 0;
    list-style: none;
    }

    li {
    float: left;
    position: relative;
    }

    li:after {
    content: "";
    position: absolute;
    z-index: -1;
    left: 0;
    right: 0;
    bottom: -20px;
    border: 1px solid #70d056;
    }

    a {
    display: table-cell;
    width: 80px;
    height: 80px;
    -webkit-border-radius: 180px;
    -moz-border-radius: 180px;
    border-radius: 180px;
    border: solid 5px rgba(255, 255, 255, 0.1);
    background: #70d056;
    text-align: center;
    vertical-align: middle;

    }

    .active {
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;

    border-bottom: 10px solid #70d056;
    position: absolute;
    bottom: -20px;
    margin-left: -10px;
    left:50%;
    }

  2. #2
    SitePoint Addict bronze trophy AllanP's Avatar
    Join Date
    Sep 2010
    Location
    Australia
    Posts
    298
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The problem is caused by the padding of 12px in div.wrap. If you remove it and add margin-right:12px; your baseline will start at the edge of the first circle.

    div.wrap { margin-right:12px; }

    To center the up arrow you need to change .active { left: 50% } to
    .active { left: 45px; }

  3. #3
    SitePoint Member
    Join Date
    Mar 2014
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you AllanP,

    I really appreciate the input.


Tags for this Thread

Bookmarks

Posting Permissions

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