I haven't written any code yet (for this project), but have noticed in previous coding ventures that when I try to make a dropdown menu with an unordered list, there is unwanted padding between the top of the containing div and the list, which is displayed in inline format. How can I get rid of this?
Asked
Active
Viewed 53 times
-2
-
1Please, bring some code with your issue so we can work on it. – Maarti Oct 26 '18 at 15:41
-
3Please read [ask] and create a [mcve] – Alon Eitan Oct 26 '18 at 15:41
-
1Without reading further, `I haven't written any code yet ` is usually a big no-no on SO. – ggdx Oct 26 '18 at 15:43
1 Answers
-2
That is default browser styling. A handful of different HTML elements come with them. Ordered and unordered lists being two of them. Also header tags. Here is another SO question that addresses your concerns.
You just have to overwrite the styles. One thing to mention is that the default browser styles could be different in different browsers so have a look at your app in a few browsers.
This worked on Firefox ```
ul {
padding: 0 0 0 0;
margin: 0 0 0 0;
}
```

Max Baldwin
- 3,404
- 3
- 26
- 40
-
I've tried overwriting the margins and padding. Also tried "list-style:none". – nameless Oct 26 '18 at 15:43
-
2I have downvoted because answering such a question will encourage further very low quality questions. – ggdx Oct 26 '18 at 15:44
-
-
@nameless, check to make sure your css rule is the same as the rule being applied in that specific browser – Max Baldwin Oct 26 '18 at 15:45
-
-
-
-
@ggdx Is that necessary ? The OP has just joined. How can you expect a high quality question from him .Just guide him to right path. – melvin Oct 26 '18 at 15:47
-
2@MaxBaldwin I afforded you the courtesy of explaining the downvote. I didn't have to but feel it is a cancer on this site to downvote without explanation. The question provides no example, no research not understood, anything whatsoever referring to the effort of the OP. This question is simply not suitable for a forum of CODE based questions. Now if the OP amended the question to meet any of these criteria, I will change my position. If he/she doesn't, then neither will I. – ggdx Oct 26 '18 at 15:56
-