如何更改 cfmenu 在页面中的放置位置?
我有一个在网络应用程序上创建的 cfmenu。问题是它会自动将自己放置在页面的最左上角,即使我已将其包含在代码中的某个位置。
有没有办法定位 cfmenu?我该怎么做才能将其放置在我想要的位置?
I have a cfmenu that I created on my web application. The problem is that it automatically places itself at the very top-left of the page, even though I have included it at a certain place within the code.
Is there a way to position a cfmenu? What can I do to place it where I want it to go?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为您可以使用
标签的menuStyle
和childStyle
属性 (docs) 将 CSS 样式添加到生成的 HTML,然后在网页上使用 CSS根据您的意愿放置/设置菜单样式。I think you can use the
menuStyle
andchildStyle
attributes of the<cfmenu>
tag (docs) to add CSS styles to the generated HTML and then use CSS on your webpage to position/style the menu as you wish.您的 cfmenu 需要位于某种容器中才能定位它。例如,这会将菜单放置在浏览器中的 100x100 位置:
我还将 cfmenus 放置在表格单元格和其他容器中。您只需要确保菜单的容器放置在它应该放置的位置即可。如果没有进一步的代码来显示如何将菜单放置在代码中,就无法确定为什么它没有到达您想要的位置。
Your cfmenu needs to be in a container of some sort to position it. For example, this would put the menu at the 100x100 position in the browser:
I've also placed cfmenus in table cells and other containers. You just need to make sure the menu's container is placed where it's supposed to be. Without further code to show how you're placing the menu in your code, there's no way to know for certain why it's not landing where you want it.
我今天早上肯定还没醒。问题是我想要它在这个表中,但忽略了包含必要的“tr”和“td”标签。现在它就在我想要的地方。
I must have not been awake this morning. The problem was that I wanted it inside this table, but neglected to include the necessary "tr" and "td" tags. It is now where I want it.