Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 对齐下拉菜单-左侧_Html_Css_Menu - Fatal编程技术网

Html 对齐下拉菜单-左侧

Html 对齐下拉菜单-左侧,html,css,menu,Html,Css,Menu,当我将鼠标悬停在水平导航菜单上的页面名称上时,相关子页面会在下方浮动 当这些显示居中时,如何对齐它们以使其向左对齐(与导航菜单标题名称一致) 你可以通过访问 http://79.170.44.145/sweetfe2.co.uk/ 将鼠标悬停在“业务服务”上,看到下拉菜单了吗?我希望它能向左对齐,这样像“Practice Studios Oxford”这样的页面链接的两句话都会在“Business Services”的正下方向左浮动 非常感谢, Sam为什么不添加到您的CSS中: .sub-m

当我将鼠标悬停在水平导航菜单上的页面名称上时,相关子页面会在下方浮动

当这些显示居中时,如何对齐它们以使其向左对齐(与导航菜单标题名称一致)

你可以通过访问

http://79.170.44.145/sweetfe2.co.uk/
将鼠标悬停在“业务服务”上,看到下拉菜单了吗?我希望它能向左对齐,这样像“Practice Studios Oxford”这样的页面链接的两句话都会在“Business Services”的正下方向左浮动

非常感谢,


Sam

为什么不添加到您的CSS中:

.sub-menu{
  text-align:left;
}
您可能还需要添加左填充:12px以使子菜单项“更好”对齐。

您的意思是:

文本对齐:左

在/wp content/themes/designfolio pro/style.css中?版本=3.8.1

nav ul ul {
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
    display: none;
    float: left;
    left: -1px;
    list-style: none outside none;
    margin: 0;
    position: absolute;
    text-align: left;
    top: 30px;
    width: 150px;
    z-index: 89;
}

使用“文本对齐:左<代码>至。子菜单”将文本向左对齐

.sub-menu{
  text-align:left;
  width: 176px;
}
添加左边距,使子菜单与主菜单项对齐

.menu > li > ul{
  margin-left:12px;
}

我同意它已经在那里,但没有工作-修复上面的工作!