What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 134 Stack Exchange communities.

Recently, there was an HTML problem asked by user. I suggest him the way to resolve the issue.

My solution was worthy for him, and he also accepted my answer. Although I got some negative votes on my accepted answer. Someone commented that DIVs are by default treated as blocked element. If I am explicitly specifying that div as block in CSS. And it also solved the problem. Then what was the issue that I get 2 negative votes?

share|improve this question
    
@Kindly help respected downvoters, What I asked wrong in this question? I really want to improve my explanation skills. Thanks. :) –  Arun Jain Aug 23 '12 at 7:41
    
It doesn't necessarily mean you asked something wrong, just that people disagree with you. I didn't downvote, though. –  whirlwin Aug 23 '12 at 11:06

2 Answers 2

up vote 6 down vote accepted

Your answer is technically correct, although a weird way of doing it. It appears the OP's image is floated to the left (or maybe the right, we don't know). That is why the image would display "outside the division" since floated elements do not take up space. Your solution was to also float the parent division, which also removes it from the flow and causes it to expand to the size of it's inner floated element (I don't know if that's supposed to happen, but apparently it does). If that wasn't the issue, then this question really ought to be deleted as the problem cannot be clearly identified.

I have no idea why they're obsessing over display: block. Yes, it's true that divisions default to that and yes, it's true that line doesn't need to be there and serves no purpose. I'll also note that any element that's floated automatically becomes display: block implicitly no matter what the display property is actually set as for that element. However, it does no harm being there and the comments about it are just useless noise.

The main reason I see a downvote occurring is that it's an odd and, might I say, inappropriate way of fixing the problem. Floating more content to account for floated content isn't a great solution, as it opens more potential for messing up the rest of the layout for the page. All in all, just because the solution worked in this specific case for the OP doesn't mean it's the best solution. The only thing the check-mark means is it helped the OP. There are better solutions out there, and the community is voting in that regard so that future visitors won't go through the headaches of "ok, now I'm having this problem."

share|improve this answer
3  
It's also worth pointing out that Arun didn't do a very good job of explaining what the code was doing. Arun, you had to defend your position in the comments, whereas describing the situation, or even saying "this is a hack and will only work in situation X" may have helped steer away the downvotes. My advice is always provide an explanation in addition to code. You'll find you oftentimes get a better response, especially if you can meet potential naysayers at the door, before they get a chance to attack. :) Good luck! :) –  jmort253 Aug 23 '12 at 7:04
1  
Absolutely, I agree with @jmort253. I had to give him more explanation. But I tried to give a solution to the user. I get such kind of help from my collegue designers. And I am developer. I just posted, what It helped me to resolve such cases. However, I might had to give some explanation. I'll remember this thing in future. Thanks. –  Arun Jain Aug 23 '12 at 7:10
    
@ArunJain - One thing you could do is edit your answer, incorporate some of the information in the comments, and try to alleviate some of the concerns. You may find that either the downvotes are removed, or you'll get future visitors who stumble upon your newly-minted answer and upvote it. Remember, you can always edit and improve your answer, even after downvotes, which take away much less than what a single upvote will give back to you. Hope this helps! –  jmort253 Aug 23 '12 at 7:17
2  
Thanks @jmort253. I'll do the same. :) –  Arun Jain Aug 23 '12 at 7:22

I'm not very clear about your answer's code, but if you have solved the asker's problem I think there maybe several reasons:

  1. Maybe you fail to provide enough details.
  2. Maybe someone misunderstand your answer and think it not work
  3. In the comments, I see the doubts about how you find the div wasn't a block. Maybe the user who voted you down has the same doubt.

That's all I can imagine.

I think you can edit your answer to improve it,such as providing more details.

share|improve this answer
    
No need to contact the moderator. Posting here on meta is sufficient. Aside from that, the rest of your assessment is solid. +1 –  jmort253 Aug 23 '12 at 7:27
    
oh ,I see ,thanks for the remind –  Winnie Aug 23 '12 at 7:30
1  
Moderators cannot do anything about down-votes, except in the case of vote frauds, but that is for suspending the user who voted for voting irregularities. A single down-vote doesn't qualify for voting irregularities. –  kiamlaluno Aug 23 '12 at 7:31
    
@jmort253 thanks for the modification. –  Winnie Aug 23 '12 at 7:35
1  
@kiamlaluno you are right.I should change my answer –  Winnie Aug 23 '12 at 7:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .