代码之家  ›  专栏  ›  技术社区  ›  Meep3D

左对齐CSS下拉列表

  •  0
  • Meep3D  · 技术社区  · 16 年前

    <ul><li> 构造以创建菜单。

    问题是菜单在页面上是右对齐的,因此我需要将下拉列表推到左侧,如图所示,以使其保持在页面内:

    Dropdown http://piestar.net/share/sample-dropdown.png

    1 回复  |  直到 16 年前
        1
  •  4
  •   Tor Valamo    16 年前

    使用css属性

    right:0;
    top:20px; # or whatever height from the top of the parent
    position:absolute;
    

    position:relative;