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.

layout help needed

Featured Replies

I am trying to build a web site.

 

I use the following:

 

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-CA" xml:lang="EN-CA">

<head>
<title>Some title</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

</head>

<body>

<div id="branding"> ... </div>

<div id="container">
<div id="side"> ... </div>
<div id="main"> ... </div>
</div>


</body>
</html>

 

On my home page I have cutenews in "main". The "main" div expands with the contents but the "container" div doesn't, so the "main" div goes outside the "container" div.

Can I make it so the container div expands with the main div or do I have to set a height for the container div?

  • Author

thanks that has worked.

 

my style for the div is:

 

#container {

position:relative;

width:881px;

height:1100px;

left: 11px;

top: 21px;

background-color: #FFFFFF;

overflow: auto

}

 

Once the contents has gotten to the height of the container div a scroll bar appears. How do I make it so the div expands down the page and no scroll bar appears? I've tried removing the height but then everything disappears.

 

Also I have the page background as black but it doesn't show up on the live site - here

 

I played around with the tryit editor on W3school and when I removed the height the scrollbar vanised and the content stayed. Could it be something to do with my code?

Also I have the page background as black but it doesn't show up on the live site

The problem is you have an extra dash "-" in your background declaration:

 

background-: #000000;

should be:

background: #000000;

in the css just add this:

 

body{
 background-color: #00000;
}

i didn't look at the code so im not sure if thats already what you have but have made a mistake as brandon said.

in the css just add this:

 

body{
 background-color: #00000;
}

i didn't look at the code so im not sure if thats already what you have but have made a mistake as brandon said.

 

background-color --> this is right.. i think you need use float: for #main like float:right.. and #side .use float:left.. try this

  • Author

thank you the background is now the right colour.

 

I am still having problems with the container div. Once the main div gets to the height of the container div a scroll bar appears. Is this always the case or can I have it so they just continue to extend?

  • Jo 90 locked this topic
Guest
This topic is now closed to further replies.

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.