2

https://dev.siterecruitment.co.uk/

Take a look here, the 'services' link is the following code:

<li class="expandable">
    <a>Services <span class="dropdown-arrow"></span></a>
    <div class="dropdown">
        <div class="inner">
        ...
        </div>
    </div>
</li>

.dropdown-arrow has the following, which should take it out of the flow and out of any dimension calculations:

.dropdown-arrow {
    width: 8px;
    height: 8px;
    position: absolute;
    right: 30px;
    top: 44%;
}

Its parent, nav a, has the following:

.nav a {
    display: inline-block;
    line-height: 0;
    padding: 50px;
    color: #12A19A;
    text-decoration: none;
    font-weight: 400;
    font-size: 16px;
}

Check the links height in comparison to the Services link. They are different seemingly because of the presence of .dropdown-arrow. When the span is removed the padding reverts to making the links the same height, which shouldn't be the case because the span is set to position: absolute and shouldn't be influencing the dimensions of its parent. Tested on Firefox v36. What am I missing?

styke
  • 2,116
  • 2
  • 23
  • 51
  • What is the problem? – Dr Upvote May 13 '15 at 14:22
  • Check the links height in comparison to the `services` link. They are different seemingly because of the presence of a span (`.dropdown-arrow`) inserted into the link. When the span is removed the padding reverts to making the links the same height, which shouldn't be the case because the span is set to position: absolute and shouldn't be influencing the dimensions of its parent. – styke May 13 '15 at 14:24
  • It's because of the browser default to span tag! – Dr Upvote May 13 '15 at 14:35

3 Answers3

1
nav a - line-height: 0;

to

nav a - line-height: normal;
Dmitriy
  • 4,475
  • 3
  • 29
  • 37
0

span is an inline-element so height should not work, you may try to add display:inline-block

Have a look here How to set height property for SPAN

Community
  • 1
  • 1
Matteo
  • 1,654
  • 17
  • 24
0

I don't really know what your problem is...

But maybe; wrap this area '<a>Services <span class="dropdown-arrow"></span></a>' in a div, right now you have a <span> which is sometimes tricky to get what you want as the other answer described. (spans are mostly used to for inline text formatting, not so much heights, nesting, and much more) Read More about <span> Click Here

And your also nesting the <span> within an <a> tag making that the outter element. Add a wrapper div here for more stability and flexibility in terms of selector styling.

<div class="dothis"><a>Services <span class="dropdown-arrow"></span></a></a>

_

.dothis { 
   display: // whatever the problem
   max-height: 20px; // set the max height if issue
   line-height: 1;
   vertical-align: text-top; // I don't know what your doing, but you get the idea
   /// all your styles
}
Dr Upvote
  • 8,023
  • 24
  • 91
  • 204