<UL> Menu Right Aligned


Blog categories: 

Today, I found a website, which discussed the feature to make a <ul> (unordered list) based menu right aligned. To me, it was a bit confusing and I was not sure, what style items are necessary to get the work done. Now I can tell: Use the following two style declarations in the ul-section of your cascading style sheet.

  • display: table;
  • text-align: right;

And that’s it :) Of course, you need to make sure, that your surrounding <div> etc. is big enough to be able to right align anything (per default, containers are as small, as their content and therefore would not right align it, as you might expect). And maybe, you can use display: inline in your <li> section… But thats up to you.