/    Sign up×
Community /Pin to ProfileBookmark

div ignoring top positioning

hello all,
i have a container div (content) with a nested container(content_content).

i’ve set the nested div with a top:35px but it’s acting like the top is set 200px and the more content you add to the nested div will push it’s self upwards instead of setting itself at the correct top position and push downwards as more content is added….

the css is rather basic so i don’t know why this is happening.

[CODE]#content {
position: relative;
top: 0px;
left: 50%;
margin-left: -325px;
padding: 0px;
border-top: 0px;
border-left: 0px;
border-right: 2px solid #FFF;
border-left: 2px solid #FFF;
border-bottom: 2px solid #FFF;
width: 650px;
height: 97%;
min-height: 900px;
background-image: URL(‘../images/red_content.jpg’);
}

#content_content { /* main content */
position: relative;
top: 35px;
left: 0px;
margin: 0px; padding: 5px;
border-top: 0px;
border-left: 0px;
border-right: 0px;
border-bottom: 0px;
width: 425px;
/*height: 600px;*/
text-align: left;
background-color:#00FF33;
}[/CODE]

here’s the url incase it helps – [url]www.saveusalllmusic.com[/url]

thanks!

to post a comment
CSS

6 Comments(s)

Copy linkTweet thisAlerts:
@KDLADec 12.2006 — Hi --

I couldn't get your link to work....

KDLA
Copy linkTweet thisAlerts:
@kreddauthorDec 12.2006 — sorry, i can't spell!!


www.saveusallmusic.com
Copy linkTweet thisAlerts:
@KDLADec 12.2006 — Try adding display: block to both your content and content_content divs.
Copy linkTweet thisAlerts:
@kreddauthorDec 12.2006 — thanks KDLA but it didn't help...and excuse my ignorance in asking, but what does the display have to do with the positioning?

i ended up removing the height from the content divto get it to work.

thanks again.
Copy linkTweet thisAlerts:
@KDLADec 12.2006 — Sometimes, the browser will interpret an element as inline, rather than block. That can mess with the positioning, especially in IE. Since the browser was ignoring the valign=top setting, I thought it possible that your div may have been interpreted as inline, rather than as a block element.

As a general practice, I always specify the display style. Saves on positioning heartaches later.

Reference: http://www.quirksmode.org/css/display.html
Copy linkTweet thisAlerts:
@kreddauthorDec 12.2006 — ok gotcha...that makes tonsss of sense. thanks!
×

Success!

Help @kredd spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...