Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to add full width background parts inside a div wrapper

Featured Replies

Hi,


I recently finished this layout image:

http://50.87.144.149/~caio/clientes/cg%20consultoria%20layout%20v3.jpg

 

I want to code it, but I'm in front of a situation I dont know how to deal.

 

I always use a wrapper div to make the content of the site centralized.

 

I want to make the blue strips at the background to appear on 100% width, not being stuck

to the wrapper width.

 

At the same time, I would like the blue strips to follow the site position, because of this

it can't have a "position: absolute", which would be a simple solution.

 

Is there a solution for this kind of thing?

 

Thanks in advance for any help.

I would have send have an inner container which would mean adding extra elements

 

you could also try using minus margins and padding

<div id="cont">
    <header>
        <nav>
            your navigation items
        </nav>
        <h1>sute title</h1>
           <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
    </header>
</div>
body{overflow-x:hidden;}/*stops bottom scroll bar showing*/
#cont{width:50%;margin:10px auto;} /*container to centre content*/
header{background:#9c9c9c;margin:0 -2999px;padding:0 2999px} /*uses minus margin and padding to extend background out of container*/

Edited by mteam

If I understand what you mean correctly I would tackle it like this, then just repeat the code for all the appropriate sections.

 

<section class="fullWidth">
     <div class="pageWidth">
          <!--content that needs to be inside the wrapper here -->        
     </div>	
</section>
.fullWidth	{
     background: #000000;
}

.pageWidth	{
     margin: 0 auto;
     width: 960px;
}

Edited by StephenOC

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.