即使使用了此处列出的CSS,页脚也会浮动到顶部

如何解决即使使用了此处列出的CSS,页脚也会浮动到顶部

| 我已经尝试过该站点和其他站点上列出的所有CSS,但无法在页面底部显示页脚...现在,它浮在页面的上半部分。下面是我的CSS;它可能有很多多余的东西,因为我已经尝试了所有方法,这是我的第一个站点。 请参阅:www.medsocialgroup.com 谢谢! 的CSS
<!-- language: lang-css -->

body {
    text-align: center;
    background-color: #FFF;
    font-family: Verdana,Geneva,sans-serif;
    color: #333;
    background-image: url(dropshadow.jpg);
    background-repeat: repeat-y;
    background-position: center center;
    margin:0;
    padding:0;
    height:100%;
}

div.wrapper
{
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    margin-top:20px;
    width:790px;
    min-height:100%; 
    height:auto
    height: 100%
    background-color: #FFF;
    font-family: Verdana,sans-serif;
}
#medcommunity{
    font-size:36px;
    color: #999;
    }
#left_column{
    float:left;
    margin-left:0px;
    width:390px;
    height:420px;
    border-right-width: thin;
    border-right-style: double;
    border-right-color: #CCC;

}
#logo{
    float:left;
    clear:left;
    margin-top:100px;
    margin-left:0px;
}

#right_column{
    float:right;
    padding:0;
    width:385px;
    height:420px;
    font-family: Verdana,sans-serif;
    color: #333;
    font-size: 16px;
    text-align: left;


}
#webtext{
    margin-top:75px;
    font-size: 20px;
}

#menu{
    background-color:#CCC;
    width:100%;
    height:40px;
    margin-top:50px;
    padding-top: 20px;
    font-family: Verdana,sans-serif;
    font-size: 20px;
    font-weight: lighter;
    text-align: center;
    background-position: center center;
    color: #FFF;
}

#footer{
    background-color:#CCC;
    width: 100%;
    height:50px;
    color: #CCC;
    border-top-width: thin;
    border-top-style: double;
    border-top-color: #999;
    text-align: center;
}
    

解决方法

        如果在页脚div上使用
clear:both;
,将有助于将页脚推至底部,但由于某种原因它仍不会完全下降,我不知道为什么。 另外,如果您使用以下规则而不是我上面建议的ѭ1,
#footer {
    background-color: #CCCCCC;
    border-top: thin double #999999;
    color: #CCCCCC;
    height: 50px;

    /* Try these new ones */
    left: 0;
    bottom: 0;
    position: absolute;
    width: 100%;
}
页脚似乎下降到了底部。但这仅在Firefox 5中有效,我在Chrome中尝试了该功能,但在那儿不起作用。我尝试过像Chrome和Firefox 5中建议的@mu那样的
position: fixed;
,但它确实可行,但是您必须指定
width: 100%
。这样做的问题是页脚固定在浏览器视口的底部,因此,如果您调整浏览器的大小并使窗口变短,则页脚会随视口的底部边缘移动,我认为您不需要。     ,        使用Ryan Fait的Sticky Footer,我想到了这个: http://jfcoder.com/test/medsocial.html 这些是我添加或更改的样式:
/* Sticky Footer by Ryan Fait http://ryanfait.com/ */
* {
  margin: 0;
}
html,body {
  height: 100%;
}
.wrapper {
  min-height: 100%;
  height: auto !important;
  height: 100%;
  margin: 0 auto -39px; /* the bottom margin is the negative value of the footer\'s height */
}
#footer,.push {
  height: 39px; /* .push must be the same height as #footer */
  clear: both;
}
/* Other styles that help fix the top */
.wrapper {
  margin-top: 0 !important;
}
#menu {
  background-color:#fff;
  margin-top: 0;
  padding-top: 50px;
}
#menu div {
  background-color:#CCC;
  width:100%;
  height:40px;
  padding-top: 20px;
  font-family: Verdana,Geneva,sans-serif;
  font-size: 20px;
  font-weight: lighter;
  text-align: center;
  background-position: center center;
  color: #FFF;
}
#medcommunity {
  margin-top: 55px;
}
和标记(注意添加的“ 7”):
<body>
<div class=\"wrapper\">
 <div id=\"menu\"><div>HOME | HOW IT WORKS | SERVICES | CONTACT US</div></div>
 <div id=\"medcommunity\"><p>medical + community</p></div>
 <div id=\"left_column\"><img src=\"msgrouptransp.png\" id=\"logo\" width=\"325\" height=\"120\" alt=\"medsocial\" /></div>
 <div id=\"right_column\">
  <p id=\"webtext\">Social Media Solutions  for the Medical Community</p>
  <p>We help Hospitals,Medical Groups,Physicians,and more to connect with their communities via  Facebook,Twitter,and other social media sites.  </p>
  <p>Find out <u>How it Works</u>.</p>
 </div>
 <div class=\"push\"></div>
</div>
<div id=\"footer\"></div>
</body>
    

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-