CSS。在 ASP 页面中将页脚放置在网页底部(而不是屏幕底部)
我读过很多关于使用 CSS 在网页中放置页脚的方法。在其他人之间我也找到了解决方案。问题是(我认为)它们中的大多数不适用于 asp 页面。
那么问题是如何在Asp页面中放置纯CSS的页脚呢?
在发布答案之前,您必须记住以下几点。
- 我使用母版页(如果这有什么关系)
- 该网页包含表单元素,我认为它破坏了页脚在网页底部的放置。
因此,您可能会开始投反对票,但我认为存在不同的方法关于 Asp.Net 页面中 CSS 的页脚放置
I have read a lot of approaches regarding placement of the footer in a webpage with CSS. Between others i found solutions, within SO too. The problem is (i think) that most of them, do not apply in asp pages.
So the question is how can i place the footer with pure CSS in Asp pages?
Before you post your answer, you have to take in mind the following.
- I use a master page (If this one has anything to do)
- The webpage contains the form element, which i believe destroys the placing of the footer in the bottom of the webpage.
<form name="aspnetForm" method="post" action="Default.aspx" id="aspnetForm">
So, you may start down-voting, but i think a different approach exists regarding footer placement with CSS in Asp.Net pages
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
事实并非如此,ASP.NET 最终仍然呈现普通的旧式 HTML。将 CSS 模板添加到母版页中,就像在 HTML 站点中创建模板一样。
如果您在实现某个 CSS 设计时遇到困难,您可以通过代码发布这些详细信息,我相信有人可以提供帮助。
There is not, ASP.NET is still rendering plain old HTML in the end. Add a CSS template to your masterpage just like you would create a template in an HTML site.
If you are having trouble implementing a certain CSS design, you can post those details with code and I am sure someone can help.
呈现到浏览器上的任何内容都必须是 HTML(或 XHTML)。所以CSS不接管的问题并不成立。您已经在使用大师了。因此,请用所有 CSS 和您的心满意足地设计母版。页面将呈现良好。您可以检查呈现的 (X)HTML 并查看可能出现的问题(如果有)。
Anything that is rendered onto the browser necessarily need to be HTML (or XHTML). So the issue of CSS not taking over is not true. Already you are using a master. So design the master well with all CSS and your hearts content. The page will be rendered well. You can examin the rendered (X)HTML and see what might have gone wrong, if any.
使用母版页不会改变任何东西。您可以将页脚内容放在母版页中,并在其中链接相关的 CSS。或者,如果您想让它更加灵活,您可以创建一个用户控件(例如 FooterUC.ascx),并在母版页中使用它。在这两种情况下,页面都会呈现为 HTML,对最终用户没有任何影响。表单标签不会弄乱任何 UI 布局,因为它的唯一目的是在任何 ASP.NET 控件上启用到服务器的回发。
Using a masterpage doesn't change anything. You can have the footer content in the masterpage and link the related CSS in it. Or if you want to make it more flexible, you can create a user control say, FooterUC.ascx, and use that in the masterpage. In both the cases, the page will be rendered as HTML and doesn't make any difference to the end user. The form tag will not messup any UI layout, as the sole purpose of it is to enable the postbacks to the server on any asp.net controls.
尝试这个示例,它是纯 css:
Try this sample it's pure css: