Solved

Putting small gap between elements in this <ul><li>

Posted on 2016-08-17
8
36 Views
Last Modified: 2016-08-17
Hello;

Please see this link below and its codes,i need that put 1px gap between the list items./thanks

http://www.w3schools.com/html/tryit.asp?filename=tryhtml_lists_menu
0
Comment
Question by:MOSTAGHASSI
  • 4
  • 3
8 Comments
 
LVL 17

Expert Comment

by:xtermie
ID: 41759013
You need a Ul LI block in the style section, with padding set to what you want, something like this added to your code
ul li {
  display: inline-block;
  border: 1px solid red;
  color: grey;
  text-align: center;
  width: 10rem;
  height: 8rem;
  margin: 0;
  padding: 0;
  position:relative;
}
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41759014
Your comment / question doesn't make any sense.  You need to show us your code and tell us what you need.
0
 
LVL 17

Expert Comment

by:xtermie
ID: 41759016
or something like this will look closer to what you want
ul li {
  display: inline-block;
  border: 0px solid black;
  color: white;
  text-align: center;
  width: 10rem;
  height: 3rem;
  margin: 0;
  padding: 1;
  position:relative;
}
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:MOSTAGHASSI
ID: 41759021
@xtermie,have you test your codes in that panel?It doesn't work.
0
 
LVL 17

Expert Comment

by:xtermie
ID: 41759033
yes I have tried it, just placed it above </style>
If the example produces more or less space than what you want you can tweak the numbers
see my example

Unless I did not understand what you actually needed; please explain furhter
UL-LI-example.png
0
 

Author Comment

by:MOSTAGHASSI
ID: 41759140
Thanks,yes but just 1px gap as a vertical line(white) between each item.
0
 

Author Comment

by:MOSTAGHASSI
ID: 41759153
Hi Dave,please visit the link ,there are codes in that link,i need 1px gap as a vertical line(white) between each item in that example in the link.
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_lists_menu
0
 
LVL 17

Accepted Solution

by:
xtermie earned 500 total points
ID: 41759243
Try this
ul li {
   display: inline-block;
   border: 1px solid white;
   color: white;
   text-align: center;
   margin: 0;
   padding: 1;
   position:relative;
 }
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jQuery Animation faster 5 48
Why won't this text float to the left 8 32
css help with menu spacing 10 45
css issues with IE 11 8 33
Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now