-1

Here's what's happening : The result

code :(Html)

<ul class="menu"  style="
    margin-top: 0px;
    margin-bottom: 0px;">
    <li>Home</li>
    <li>News</li>
    <li>Contact</li>
    <li>About</li>
</ul>

code:(Css)

.menu {

list-style-type: none;

background-color: #B7FFED;

font-size: 70px;

display: inline-block;

font-family: 'Lilita One', cursive;

padding: 0px;

height: 1000px;

}



.menu li{  

padding-bottom: 100px;    
padding-top: 10px;
border: 2px solid;

}

I want this to be able to only border the words but to not have huge gaps. Here is a picture of what I want: The thing I want

2
  • change padding with margin Dec 27, 2017 at 20:20
  • ohh Yeah right it helps!
    – tah
    Dec 27, 2017 at 20:22

2 Answers 2

1

You need to use margin instead of padding and add overflow: hidden, so that your margins do not collapse:

.menu {
  list-style-type: none;
  background-color: #B7FFED;
  font-size: 70px;
  display: inline-block;
  font-family: 'Lilita One', cursive;
  padding: 0px;
  height: 1000px;
  overflow: hidden;
  margin: 0;
}

.menu li {
  margin-bottom: 100px;
  margin-top: 10px;
  border: 2px solid;
}
<ul class="menu">
  <li>Home</li>
  <li>News</li>
  <li>Contact</li>
  <li>About</li>
</ul>

3
  • What does collapse mean?
    – tah
    Dec 27, 2017 at 20:24
  • i was sure he will ask you the question :) btw i don't think we will have the issue in this case Dec 27, 2017 at 20:25
  • 1
    I figured out what collapse means now but the help is good thanks for the help. Although i was kinda dumb
    – tah
    Dec 27, 2017 at 20:30
0

I only had to change padding to margin to make it happen..

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.