Note that there are some explanatory texts on larger screens.

plurals
  1. POtrying to make <li> text apear in front of <li> containers' borders with HTML and CSS
    primarykey
    data
    text
    <p>I've made a horizontal menu using a list. I'm trying to get each <code>&lt;li&gt;</code> to appear as a horizontal rectangle with wedges snipped out of its sides - <code>snip&gt; &lt;snip</code> - and text centered horizontally and vertically.</p> <p>I thought I could accomplish this by giving the <code>&lt;li&gt;</code>'s a line-height of 0, making the borders thick, and making the right and left border transparent, but it behaves like there's still .4em of line height or something.</p> <p>A note about the attached code: I have nothing resembling a formal education, so I expect there to be some serious holes in my method and code. I am absolutely willing to take all input in the interest of making my code semantic, clean, and simple.</p> <p>Thanks for your help!</p> <pre><code>#CAPMenu li { float:left; width:95px; border-top: 20px solid #4672A3; border-bottom: 20px solid #4672A3; border-left: 20px solid transparent; border-right: 20px solid transparent; line-height:0em; } &lt;div id="CAPMenu"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Idea&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Concept&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Feasability&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Development&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Scale Up&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Launch&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Post Launch&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload