سؤال

I have bootstrap navbar and i want the links in the top of the list item

        <li>
          <a class="menuLinks" href="http://news.bootswatch.com">Blog</a>
        </li>

CSS:

  .menuLinks {
        vertical-align:top;
  }

I tried this too:

  .menuLinks {
        position:absolute;
        top:0;
  }

and it didn't work too.

How can I do that?

هل كانت مفيدة؟

المحلول

Try to add this properties:

display:table-cell;
height:40px;
vertical-align: top;

نصائح أخرى

Need more information to know what you want to do. If its positioning the element, you can change that in your css with margins etc. Or if you want it above other elements then you need to move the html code above those elements. If you display more of the code it might make it easier to help you.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top