Haradzieniec
Haradzieniec

Reputation: 9340

html5: css styling: <ul> <li> vs <p> for column of links

There are 4 columns of links in the footer each of 25% of width. The css style of each column is the same (they belong to the same class). The first column looks like:

Title of Column 1

link11

link12

link13

I think it is possible to use <ul><li> tags or <p> tags to reach the goal. Which way is better, using <ul>, <li> or <p>?

Added to the question: P.S.I've just checked the link http://www.w3schools.com/html5/tag_nav.asp , they use <!DOCTYPE html> (as I understand, html5), but if you check how they wrap the column of linke (my question), they just use <br/> instead of <p> or <li> (see the view source of the left column). Is using <br/> even better than <ul><li> or <p>?

Upvotes: 1

Views: 4267

Answers (3)

user1093284
user1093284

Reputation:

If you want to do it semantically correct, you would write the html according to your content. As you are displaying "a list of links", an "ul" is the way to go.

And (as a bonus) if you want to make it HTML5 compliant while you're at it, wrap the list in a "nav" tag.

<nav>
<ul>
<li><a href="#">link 1</a></li>
<li><a href="#">link 2</a></li>
<li><a href="#">link 3</a></li>
</ul>
</nav>

Upvotes: 4

RvD
RvD

Reputation: 362

You should use both nav and ul tags to achieve this.

<nav>
    <h1>Title of Column 1</h1>
    <ul>
        <li>link11</li>
        <li>link12</li>
        <li>link13</li>
    </ul>
</nav>

Upvotes: 3

I believe that it is better to use a list and make via css the list-style-type of the ul none.

Upvotes: 2

Related Questions