/    Sign up×
Community /Pin to ProfileBookmark

learning css but now totally conufsed.

I’ve just went and learned CSS2.

Now it taught me about left: 20%

left: 20px;

etc for positioning.

But I’ve just went and checked hundreds of websites and not one have I seen using these values.

Am I getting the wrong end of the stick with the CSS2 course I bought?

It seems that no-one is using left: right: bottom: top: to position their sites?

It also seems that I can’t get positioing right without using those values, as per say having a navigation unit over the top of a header image.

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@aj_nscJun 25.2009 — I don't often use left right bottom and top, but from time to time they come in handy. You can only use left right bottom and top, as I'm sure you know on elements, with explicitly stated positions (e.g. relative, absolute). If they don't have a position declaration, then left right bottom and top do nothing, regardless of the values you put in there.

For the most part, I don't declare the position property on many elements (none if I can get away with it) and instead I use margins to position my elements.

Advice to anyone beginner to intermediate with CSS, stay away, if you at all can, from declaring the position property on any elements.

Generally speaking, to usually only need to declare position: relative on an element if you have a child element which is absolutely positioned. If you remove all your position: relative properties in your stylesheet, chances are you'll find that everything is where it should be anyway...provided you also replace your left right bottom and top properties with the respective margin declarations.
×

Success!

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