Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

デフォルト値のメニュー・アイテムは“ブロック”項目です。つまり、与えられたスペースの幅まで自動的に広げられ、(これを含むボックス内の)両端に他のコンテンツを受け入れません。これは、サイドバー内に縦方向に並ぶメニュー・アイテムの作成には理想的です。サイドバーのサイズを設定すれば、メニュー・アイテムは全て自動的にそのサイズに合わせられます。別の方法でメニュー・アイテムを使用したい場合は、表示モードとサイズのいずれか、または両方を変更します。例えば、以下のようなメニュー・アイテムの水平方向バーを作成する場合:

Image Added


“hMenu”というIDで<div>の中にメニュー・アイテムを配置して、次のようなCSSを定義します。

The default menu item is an HTML "block" item. This means that it automatically expands to the width of the space you give it and does not allow other content on either side of it (within the containing box). This is ideal for creating a vertical stack of menu items in a sidebar. You can set the size of the sidebar and the menu items will all automatically match the size. If you want to use the menu items in a different scenario, you may want to change their display mode and/or their size.  For example, to create a horizontal bar of menu items like this:

Image Removed

You might place them inside a <div> with the id "hMenu" and then define the following CSS:

#hMenu {
  background:#333;
}
a.std_menu, a.std_menu_selected {
  color:#fff;
  display:inline-block;
  padding:5px 10px;
  border-right:1px solid #fff;
  background-color:#c7dff4;
  font-weight:normal;
}