<ul> <li> make strings in a list
I have 15 names and I want them to divide the names in three lines (5 names on each line), currently Iam uses the <ul> and <li> tags
Is there any possible way to have three lines of 5 names in each line? using li and ul tags?
+7
Troj
source share4 answers
This worked for me:
CSS:
.test { padding:0; margin:0; list-style-type:none; width:500px; } .test li { width:100px; float:left; } HTML:
<ul class="test"> <li>1</li> <li>2</li> <li>3</li> <li>4</li> <li>5</li> <li>6</li> <li>7</li> <li>8</li> <li>9</li> <li>10</li> <li>11</li> <li>12</li> <li>13</li> <li>14</li> <li>15</li> </ul> +3
Richard Marskell - Drackir
source shareMake sure float: left and set li width to 20% your total width (maybe a little less).
+1
sworoc
source shareYou can use the nested list. CSS allows you to create lists using display: inline and list-style-type: none . If you specify each element li that will be displayed horizontally, you can list these properties side by side.
Hope this helps
James
+1
Bojangles
source share