Karolina Ticha Karolina Ticha - 7 months ago 23
HTML Question

Links and floating

How can I make floating link clickable at whole row?

<ul>
<li>
<a href="#">
<span>New York</span>
<span>$489</span>
</a>
</li>
<li>
<a href="#">
<span>New York</span>
<span>$489</span>
</a>
</li>
</ul>


css is here:

ul {
width: 40%;
border: 1px solid black;
list-style: none;
padding: 0;
}
span:last-of-type {
float: right;
}


Why can I click to space between spans?
And why price isnt undrelined?

codepen is here http://codepen.io/anon/pen/BKVMoY

Answer

I think you can just add display: block; to the anchor tags in order to make the entire row clickable. I'm not exactly sure why the floated element removes the underline.

Comments