开发者

Best way to markup an HTML banner

开发者 https://www.devze.com 2023-02-22 10:59 出处:网络
The general html structure of my pages is <div id=\"wrapper\"> <div id=\"header\"> </div>

The general html structure of my pages is

<div id="wrapper">
      <div id="header">
      </div>
      <div id="content">
      </div>
      <div id="f开发者_如何学Pythonooter">
      </div>
</div>

I have a 1000px layout with the content centering.

However, for a couple of the pages I have a banner in the content that should expand 100% to the sides of the browser (i.e., beyond the 1000px wrapper).

Should I delete the wrapper div for this page and apply width: 1000px; margin: 0 auto; separately? Or should I take the banner outside of the standard wrapper layout? What is a more standard way to do this?

Thank you.


Using style="overflow:show" for that content banners parent should allow it to show. Instead of width=100% you might need to use some javascript to get the screens width and make it that width.


I would take the banner outside of the wrapper.


I had same problem and done something like this:

.center
{
  margin: auto;
  width: 1000px;
}

<div id="wrapper">
  <div id="header">
  </div>
  <div id="content">
    <div class="center">
    </div>
    <div id="banner">
    </div>
    <div class="center">
    </div>
  </div>
  <div id="footer">
  </div>
</div>
0

精彩评论

暂无评论...
验证码 换一张
取 消