html - Expand <li> so it fits the width of <ul> -


before post duplicate, isn't - other threads provide instructions on how make horizontal <li> fit width of <ul> - question how make vertical <li> fit width of <ul>.

below code:

css

.ul {     background: #fff;     padding: 12px !important;     font-size: 0;     width: 125px; }  .li {     margin-bottom: 16px !important; }  .li {     font-weight: 300 !important;     font-size: 22px !important; } 

html

<ul> <li> <a href="#">hats</a> </li> 

currently, can click li end of text, want option select throughout complete width of ul.

to expand comment...

you wanted find way <li> element fit width of it's <ul> element. <li> element already is full widht of it's parent element (except default padding, can overriden).

this due fact <li> default block element. , block elements take full width of parent. problem <a> element, default inline element, doesn't take full width of parent.

and modifying <a> display: inline display: block, solves problem.


Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -