/    Sign up×
Community /Pin to ProfileBookmark

Navigation Positioning Problems -Cross browser

I’ve been putting this site together that uses a lot of transparency and stacking of elements on the page to achieve its look. I’ve been trying everything to get this to display properly and running into issues.

I have it almost worked out at this point, but I’m getting this odd space in between “services” and “gallery” and I can’t seem to figure it out. I think the same thing might be related to the drop-down menus being moved to the right also.

The image below the navigation is also being pushed down too far, but I’m thinking I can correct that with negative margin once I get the navigation worked out.

Any ideas on how to fix this? I have been messing around with it for hours trying to get it working.

Here’s the site;
test7.triple7studio.com

The CSS;

[CODE].container {
width:960px;
height:auto;
margin: 0 auto 0 auto;
}
#social-btn{
margin:-3px 5px 0px 5px;
border:none;
}

#contact-btn{
font: 16px Tahoma, Geneva, sans-serif;
font-weight:600;
letter-spacing:2px;
text-align:right;
position:relative;
top:-10px;
}
.logo {
clear:both;
}
.main-copy{
font: 14px Tahoma, Geneva, sans-serif;
letter-spacing:1px;
line-height:150%;
}
#rule{
margin: 5px 0px 5px 0px;
clear:both;
}

.contact-header{
text-align:right;
margin-top:-5px;
}
.contact-header a {
text-decoration:none;
list-style:none;
color:#fff;
}
.contact-header a:hover {
color:#090;
}

#nav-bg{
position:relative;
top: -19px;
z-index:1;
}

.nav{
position:relative;
top:-83px;
left: 19px;
z-index:5;
}

/* Navigation Style */

#jsddm
{ margin: 0;
padding: 0}

#jsddm li
{ float: left;
list-style: none;
font: 12px Tahoma, Arial;
line-height:37px;
text-align:center;
margin: 0;
padding: 0
}

#jsddm li a
{ display: block;
height: 37px;
width: 186px;
background-image: url(/images/trans-bar.png);
background-repeat:repeat-x;
text-decoration: none;
color: #EAFFED;
white-space: normal;
}

#jsddm li a:hover
{
background:#999;

}

#jsddm li ul
{

visibility: hidden
}

#jsddm li ul li
{ float: none;
display: inline}

#jsddm li ul li a
{ width: auto;
background-image: url(/images/trans-bar.png);
background-repeat:repeat-x;}

#jsddm li ul li a:hover
{ background-image: url(/images/trans-bar.png);
background-repeat:repeat-x;}

.nav-cat
{
font-size:16px;
line-height:37px;
text-align:center;
}
.cover{
clear:both;
margin-top:-20px;
margin-left:23px;
}

#cover-img{
clear:both;
}

.content-container{
width:850px;
background:#FFF;
margin-top:-200px;
margin-left:63px;
}

.content-area-bg{
margin-top:0px;
}
#content-header-img
{
position:relative;
top:-183px;
}
.footer{
margin-top:0px;
margin-left:26px;
}[/CODE]

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@holyhttpFeb 23.2012 — Use an absolute positioning for #jsddm to avoid pushing other elements below the navigation whenever you reveal the submenu items.

Use:

#jsddm li{

position:relative;

}

#jsddm li ul {

display:none; /* hides the submenu */

position:absolute;

top:36px;

left:0;

}

#jsddm li:hover ul{

display:block; /*reveals the submenu */

}

You can simplify the markup of the navigation area by taking out the div tags with the class nav-bg nav and navigation.

Just use:

.container {

width: 960px;

height: auto;

margin: 0 auto 0 auto;

position:relative;

overflow:hidden;

}

#jsddm{

position:absolute;

z-index:1000;

top: 133px;

left: 0;

background:url(/images/navbar.png') no-repeat 0 0;

}

.cover {

clear: both;

margin:120px 0 0;

}
Copy linkTweet thisAlerts:
@RedBeardauthorFeb 24.2012 — Use an absolute positioning for #jsddm to avoid pushing other elements below the navigation whenever you reveal the submenu items.

Use:

#jsddm li{

position:relative;

}

#jsddm li ul {

display:none; /* hides the submenu */

position:absolute;

top:36px;

left:0;

}

#jsddm li:hover ul{

display:block; /*reveals the submenu */

}

You can simplify the markup of the navigation area by taking out the div tags with the class nav-bg nav and navigation.

Just use:

.container {

width: 960px;

height: auto;

margin: 0 auto 0 auto;

position:relative;

overflow:hidden;

}

#jsddm{

position:absolute;

z-index:1000;

top: 133px;

left: 0;

background:url(/images/navbar.png') no-repeat 0 0;

}

.cover {

clear: both;

margin:120px 0 0;

}[/QUOTE]


Thanks for the insight! Absolute positioning indeed fixed the problem.

Now I have another that has popped up! I feel like I'm constantly chasing this thing. Anyway, in firefox the main .cover image is being pushed outside the container. Chrome it looks fine. What is wrong here?

CSS
[CODE]@charset "utf-8";
/* CSS Document */
.container {
width:960px;
height:auto;
margin: 0 auto 0 auto;
}
.social-btn{
margin:-3px 5px 0px 5px;
border:none;
}

#contact-btn{
font: 16px Tahoma, Geneva, sans-serif;
font-weight:600;
letter-spacing:2px;
text-align:right;
position:relative;
top:-10px;
}
.logo {
clear:both;
}
.main-copy{
font: 14px Tahoma, Geneva, sans-serif;
letter-spacing:1px;
line-height:150%;
}

.contact-header{
text-align:right;
margin-top:-5px;
}
.contact-header a {
text-decoration:none;
list-style:none;
color:#fff;
}
.contact-header a:hover {
color:#090;
}

#nav-bg{
position:relative;
top: -19px;
z-index:1;
}

.nav{
position:relative;
top:-83px;
left: 19px;
z-index:5;
}

/* Navigation Style */

#jsddm
{ margin: 0;
padding: 0;
}


#jsddm li
{ float: left;
list-style: none;
font: 12px Tahoma, Arial;
line-height:37px;
text-align:center;
margin: 0;
padding: 0;
width:190px;
position:relative;
}

#jsddm li a
{ display: block;
height: 37px;
width: 190px;
background-image: url(/images/trans-bar.png);
background-repeat:repeat-x;
text-decoration: none;
color: #EAFFED;
white-space: normal;

}

#jsddm li a:hover
{
background:#999;
position:relative;

}

#jsddm li ul
{
position:absolute;
top:36px;
left:0px;
display:none;
margin-left:-40px;
}

#jsddm li ul li
{ float: none;
display: inline}

#jsddm li ul li a
{

background-image: url(/images/trans-bar.png);
background-repeat:repeat-x;}

#jsddm li ul li a:hover
{

background-repeat:repeat-x;

}

#jsddm li:hover ul{
display:block;
}

.nav-cat
{
font-size:16px;
line-height:37px;
text-align:center;
}
.cover{

margin-left:23px;
margin-right:auto;
margin-top:-25px;
}

.rule{
margin: 5px 0px 5px 0px;
}

.content-container{
width:850px;
background:#FFF;
margin-top:-200px;
margin-left:63px;
}

.content-area-bg{
margin-top:0px;
}
#content-header-img
{
position:relative;
top:-183px;
}
.footer{
margin-top:0px;
margin-left:26px;
}[/CODE]
×

Success!

Help @RedBeard 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,
)...