Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

It is possible to give list-style-type for some elements of <li> and for others dont?

Tags:

html

css

I have a list of answers. And I have inside each list item <li> the number of the answer, a paragraph ("test..."), and two links.

And I want to have a list-style-type: circle; in my links. But my links aren´t <li> elements, they are inside a <li> element.

Do you know if it is possible do something like this?

I have my code here: http://jsfiddle.net/x9ww2qpd/1/

enter image description here

like image 613
UserX Avatar asked Aug 31 '14 23:08

UserX


People also ask

Can we use Li without UL?

If you just use <li></li> without <ul> or <ol> the rendered result will be a un ordered list with bullet icons preceding each list item, and when you see the DOM there won't be any <ul> or <li> tag added.

Why LI tag is used in ordered list and unordered list?

The <li> tag defines a list item. The <li> tag is used inside ordered lists(<ol>), unordered lists (<ul>), and in menu lists (<menu>). In <ul> and <menu>, the list items will usually be displayed with bullet points. In <ol>, the list items will usually be displayed with numbers or letters.

How many types of list styles supports in HTML?

There are three different types of HTML lists: Ordered List or Numbered List (ol) Unordered List or Bulleted List (ul) Description List or Definition List (dl)


1 Answers

So just make them <li> elements. For example:

<h4>Answer 1</h4>
<p> test  test test test test test test test test test test test test testtest  testtest test  test test</p>
<span>Saber mais:</span><br/>
<ul>
    <li><a href="#">Who are we?</a></li>
    <li><a href="#">Who are we?</a></li>
</ul>

You can nest ordered/unordered lists to whatever depth you want. Then apply the CSS style as desired to the list.

like image 160
Leo Bedrosian Avatar answered Sep 20 '22 18:09

Leo Bedrosian