+ -
当前位置:首页 → 问答吧 → 有CSS高手吗?来帮个忙可以吗?

有CSS高手吗?来帮个忙可以吗?

时间:2009-02-20

来源:互联网

情况是这样的
这是代码
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  5. <title>Jzeonn</title>

  6. <style type="text/css" media="screen">
  7. body {
  8. margin:0 auto;/*div center set*/
  9. text-align:center;
  10. padding: 0;
  11. font-family: Verdana;
  12. font-size: 12px;
  13. background: #C7C7C7 url(images/bg.gif) top repeat-x;
  14. }

  15. #Container {
  16. position: relative;
  17. width: 720px;
  18. height: 435px;
  19. margin: 0 auto;/*div center set*/
  20. top: 200px;
  21. padding: 0;
  22. background-color: #333333;
  23. overflow: hidden;
  24. text-align:left;
  25. color: #FFFFFF;
  26. }

  27. #Menu {
  28. position: relative;
  29. width: 720px;
  30. height: 35px;
  31. margin: 0;
  32. padding: 0;
  33. background-color: #666666;
  34. overflow: hidden;
  35. }

  36. #Main {
  37. position: relative;
  38. width: 720px;
  39. height: 400px;
  40. margin: 0;
  41. padding: 0;
  42. background-color: #999999;
  43. overflow: hidden;
  44. }

  45. #ShearP {
  46. position: absolute;
  47. margin: 0;
  48. left: 0;
  49. top: 0;
  50. width: 100%;
  51. height: 100%;

  52. }
  53. </style>

  54. </head>
  55. <body>

  56. <div id="Container">
  57. <div id="Menu">
  58. eonn
  59. </div>
  60. <div id="Main">
  61. <div id="ShearP">
  62. eonneonneonneonneonneonneonneonneonneonneonneonneonneonneonneonneonneonneonneonneonn
  63. </div>
  64. </div>
  65. </div>

  66. </body>
  67. </html>
复制代码

下载 (13.98 KB)
2009-2-20 23:54

上面是用FireFox打开后的画面
现在有个棘手的问题是
点击画面左上角的时候出现如下现象:
下载 (31.99 KB)
2009-2-20 23:54

ShearP层的内容被选中了
这现象好像有点不太好,我不喜欢,有没有什么办法的 可以让那个现象不出现呀?
求救CSS,JavaScript的高手吗!

作者: 亿年   发布时间: 2009-02-20

上面那样做只是为了Container层及其里面的层都居中显示
我现在知道把Container层的position: relative;属性改成position: absolute;上面的问题就没有了
但是这样Container层的居中就得靠别的方法了
我现在想能不能不要改变Container层的居中方法就能解决那问题呀?

作者: 亿年   发布时间: 2009-02-20

不懂
帮亿年兄顶一下。、
周末貌似没啥人

作者: 西门轩辕   发布时间: 2009-02-21

谢谢 西门兄!!!

作者: 亿年   发布时间: 2009-02-21

没有人帮忙看一下吗?

作者: 亿年   发布时间: 2009-02-22

有点晕了,没看懂LZ的意思。

作者: longxinhe   发布时间: 2009-02-22

呀 这个问题感觉蛮难说明的
可能你拿代码在FireFox中试试就知道了

作者: 亿年   发布时间: 2009-02-22