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.

Border Overflow on a Fixed width Div tag

Featured Replies

Copy and paste code below - you should see that the container_footer border overflows onto container_all. Why does it do this?

 

Also, read the post on 'How to center content using CSS' and have not been able to replicate its effect - any reasons why it doesnt work in this code either??

 

<html>

<head>

<style type="text/css" media="screen" title="">

body

{

text-align:center;

}

div.container_all

{

text-align:left;

border: solid black 0.24em;

width: 1024px;

padding: 0.24em;

}

div.container_banner, div.menu_navigation

{

margin-bottom: 0.24em;

}

div.container_banner, div.menu_navigation, div.menu_accessibility, div.intro, div.container_content, div.container_footer

{

padding:0.24em;

width: 98%;

}

div.container_footer

{

margin-top: 0.24em;

border: solid red 2.36em;

}

</style>

</head>

<body

>

<div class="container_all">

<div class="container_banner">

banner here

</div><!-- end of div class container_banner -->

<div class="menu_navigation">

menu navigation here

</div><!-- end of div class menu_navigation -->

<div class="menu_accessibility">

accessibility here

</div><!-- end of div class menu_accessibility -->

 

<div class="intro">

intro here

</div><!-- end of div class intro -->

 

<div class="container_content">

content here

</div><!-- end of div class container_content -->

 

<div class="container_footer">

footer here

</div><!-- end of div class container_footer -->

</div><!-- end of div class container_all -->

</body>

</html>

I posted a reply on this post. dont know why it got deleted.

For the footer. remove the width of footer div it will automatically adjust itself and to make the container div center align. here is the style

 

div.container_all {

margin: 0 auto;

}

Copy and paste code below - you should see that the container_footer border overflows onto container_all. Why does it do this?

 

Also, read the post on 'How to center content using CSS' and have not been able to replicate its effect - any reasons why it doesnt work in this code either??

 

<html>

<head>

<style type="text/css" media="screen" title="">

body

{

text-align:center;

}

div.container_all

{

text-align:left;

border: solid black 0.24em;

width: 1024px;

padding: 0.24em;

}

div.container_banner, div.menu_navigation

{

margin-bottom: 0.24em;

}

div.container_banner, div.menu_navigation, div.menu_accessibility, div.intro, div.container_content, div.container_footer

{

padding:0.24em;

width: 98%;

}

div.container_footer

{

margin-top: 0.24em;

border: solid red 2.36em;

}

</style>

</head>

<body

>

<div class="container_all">

<div class="container_banner">

banner here

</div><!-- end of div class container_banner -->

<div class="menu_navigation">

menu navigation here

</div><!-- end of div class menu_navigation -->

<div class="menu_accessibility">

accessibility here

</div><!-- end of div class menu_accessibility -->

 

<div class="intro">

intro here

</div><!-- end of div class intro -->

 

<div class="container_content">

content here

</div><!-- end of div class container_content -->

 

<div class="container_footer">

footer here

</div><!-- end of div class container_footer -->

</div><!-- end of div class container_all -->

</body>

</html>

Hi,

 

Use below code, this will solve all your problems

 

<html>

<head>

<style type="text/css" media="screen" title="">

body

{

text-align:center;

}

div.container_all

{

text-align:left;

border: solid black 0.24em;

width: 1024px;

padding: 0.24em;

margin:0px auto;

}

div.container_banner, div.menu_navigation

{

margin-bottom: 0.24em;

}

div.container_banner, div.menu_navigation, div.menu_accessibility, div.intro, div.container_content, div.container_footer

{

padding:0.24em;

width: 98%;

}

div.container_footer

{

margin-top: 0.24em;

border: solid red 2.36em;

width:942px;

}

</style>

</head>

<body

>

<div class="container_all">

<div class="container_banner">

banner here

</div><!-- end of div class container_banner -->

<div class="menu_navigation">

menu navigation here

</div><!-- end of div class menu_navigation -->

<div class="menu_accessibility">

accessibility here

</div><!-- end of div class menu_accessibility -->

 

<div class="intro">

intro here

</div><!-- end of div class intro -->

 

<div class="container_content">

content here

</div><!-- end of div class container_content -->

 

<div class="container_footer">

footer here

</div><!-- end of div class container_footer -->

</div><!-- end of div class container_all -->

</body>

</html>

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.