/    Sign up×
Community /Pin to ProfileBookmark

width or min-width

Hi guys. I’m just wondering when I should use width and when I should use min-width. I thought there wasn’t really a difference but after a day messing around with a site layout trying to get stuff to fit together… I gueass I was wrong.

to post a comment
CSS

6 Comments(s)

Copy linkTweet thisAlerts:
@timdentyMay 29.2007 — Well, the main difference is that older browsers (IE6 and earlier I think) don't recognize the min-width feature. Try looking at this article too - http://www.mezzoblue.com/archives/2004/02/25/sidestepping - it describes how to overcome this.

Also min-width is fluid when the window size is larger than your set value, whereas width is simply fixed.
Copy linkTweet thisAlerts:
@DoppleauthorMay 29.2007 — Cheers. I have a site that's needing a complete redesign. I laid it out with absolutely positioned divs, and now I'm being asked to center it all. I guess that's what I get for cutting corners eh?

Lesson learned!
Copy linkTweet thisAlerts:
@timdentyMay 29.2007 — Just a thought - You could still use absolute positioning & have it center aligned. You would just have to have all your elements within a container which was relatively positioned with correct margins like this...

margin: 0 auto;

position: relative;

The child elements then take their position from the parent element (container), not the body.
Copy linkTweet thisAlerts:
@DoppleauthorMay 29.2007 — Cheers Tim. That sure does beat the hell out of a complete re-coding.

Much appreciated!?
Copy linkTweet thisAlerts:
@felgallMay 29.2007 — using absolute positioning unless elements are to overlap is unnecessary and just makes the coding much more complex. You can't centre absolutely positioned elements because they are positioned relative to a single location, not multiple locations..
Copy linkTweet thisAlerts:
@DoppleauthorJun 04.2007 — Really the layout I'm after can be put into 3 columns. It's not as tidy to code as I would have preferred but I've just gone with 3 floating columns and I just need to work out the positioning of things.
×

Success!

Help @Dopple 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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