Lynds
Lynds

Reputation: 3

Use ul li twice in html5

I am using ul li in my nav but also to make a notice board. But I want to separate the ul li elements. Is there an easy method like nav ul li {} and notice board ul li{}

Upvotes: 0

Views: 620

Answers (2)

Nux
Nux

Reputation: 10012

You could use nav tag with just links instead of a list for nav. Keep in mind that you might need to add some extra code if you care about IE8. I tend not to care that much in new projects.

Upvotes: 0

pajaja
pajaja

Reputation: 2202

You can define CSS class for both of them. For example:

.nav {
  /*some css*/
}


.notice_board {
  /*some css*/
}

and then link them to desired HTML elements

<ul class="nav">
 <li>...</li>
 ...
 <li>...</li>
</ul>

for navigation and

<ul class="notice_board">
 <li>...</li>
 ...
 <li>...</li>
</ul>

for notice board.

Upvotes: 1

Related Questions