I am learning Web Design From Couple of months. #call_us { float: right; margin-top: -30px; font-style: italic; } Now, my question is can i use margin-top in negative value on my stylesheet? The design remains ok if i give it, Other hand it is became zigzag.
Many properties accept negative values, among them, margin. As always, I recommend you make yourself well acquainted with the specs. Ian Hickson, editor of the WHATWG html standard, from which html5 is derivative, has this to say on how to read the specs: cheers, gary
Yes you can use negative value on your stylesheet. But i suggest you to avoid negative value, because some time some browser create problems.
Commonly, negative values are used to compensate for some error by the author, so their use simply compounds the error. When used for explicit design/presentation purposes, there are seldom any issues among browsers. Old versions of IE had some quirks you had to work around, but seem to cause no problems as of v.9 The key is to learn the rules of the game; read the specs. To repeat myself: cheers, gary
Can't say I agree with that statement -- it happens by people who don't know what they are doing, but negative margins are an essential part of most content first multi-column and responsive layouts given what zero flow-width elements do -- much less well coded/reliable 100% min-height layouts can't be done without them either. (given what a unreliable wreck APo or FPo is in that regard) That said, the mention of something 'zig-zagging' by the OP makes me wonder if you are correct and he's compensating for some other mistake. It's hard to weigh in as to what the best answer would be without actually seeing the code/layout that's attempting to be accomplished. Like a great many posts, without seeing the code we can't really give a proper answer.
@ ds: You cherry picked the quote. The next sentence reads (emph added) I Think that encompasses your exception. cheers, gary