/    Sign up×
Community /Pin to ProfileBookmark

help positioning an object

I want the navigation for my site to be fixed to the top of the page, but move horizontally with the content in the page (and not scroll). The content is centered. I’ve tried all the permutations I can think of. Any ideas?
thanks

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@handcraftedwebSep 29.2012 — Not exactly sure what you want, but maybe
[CODE].head-wrapper {
position:fixed;
top:0;

width:100%;
}

header {
width:50%;
margin:0 auto;
background-color:#ccc;
}[/CODE]

[code=html] <div class="head-wrapper">
<header>
this is the header
</header>
</div>
[/code]

see example here: http://codepen.io/anon/pen/dhpoj
×

Success!

Help @dtrachtman 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.26,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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