当浮动对象元素位于内部时的填充

发布于 2024-09-29 08:14:02 字数 1324 浏览 0 评论 0原文

我有以下 html:

<div class="wrapper">
    <div id="header">
        <img alt="Giannis Simeonidis" src="logo2.png" width="300" height="220"/> 
        <object width="550" height="200" id="banner">
            <param name="movie" value="banner.swf" />
            <embed src="banner.swf" width="550" height="200"  
                    wmode="transparent" 
                    type="application/x-shockwave-flash">
            </embed>
        </object>
        <div id="menu">
          <object width="600" height="20">
             <param name="movie" value="menu.swf" />
             <embed src="menu.swf" width="600" height="20"  
                    wmode="transparent" 
                    type="application/x-shockwave-flash">
              </embed>
         </object> 
        </div>
    </div><!--End of header-->
</div>

和 css 是:

#wrapper{
 /*background: url(header_bg.jpg) repeat-x;*/
 background: url(container_bg2.png) repeat-y;
 margin: 0 auto;
 margin-top: 20px;
 width: 900px;
}


#header{
 width: 900px;
 padding: 0 10px;
}

#banner{
 float: right;
}

#menu{
 clear: right;
 padding-left: 13px;
}

由于某种原因,应用于 #header 的正确填充不起作用;有什么想法吗?

i have the below html:

<div class="wrapper">
    <div id="header">
        <img alt="Giannis Simeonidis" src="logo2.png" width="300" height="220"/> 
        <object width="550" height="200" id="banner">
            <param name="movie" value="banner.swf" />
            <embed src="banner.swf" width="550" height="200"  
                    wmode="transparent" 
                    type="application/x-shockwave-flash">
            </embed>
        </object>
        <div id="menu">
          <object width="600" height="20">
             <param name="movie" value="menu.swf" />
             <embed src="menu.swf" width="600" height="20"  
                    wmode="transparent" 
                    type="application/x-shockwave-flash">
              </embed>
         </object> 
        </div>
    </div><!--End of header-->
</div>

and the css is:

#wrapper{
 /*background: url(header_bg.jpg) repeat-x;*/
 background: url(container_bg2.png) repeat-y;
 margin: 0 auto;
 margin-top: 20px;
 width: 900px;
}


#header{
 width: 900px;
 padding: 0 10px;
}

#banner{
 float: right;
}

#menu{
 clear: right;
 padding-left: 13px;
}

For some reason the right padding applied to the #header is not working; Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

韵柒 2024-10-06 08:14:02

包装器的宽度为 900px。
标题的宽度为 900px + 10px 左内边距 + 10px 右内边距
= 920 像素。

您正在尝试将 920px div 放入 900px div 中。将包装器加宽至 920 像素,或将标题缩短至 880 像素。

The width of the wrapper is 900px.
The width of the header is 900px + 10px Left Padding + 10px Right Padding
= 920px.

You are trying to fit a 920px div inside a 900px div. Either make the wrapper wider to 920px or the header shorter to 880px.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文