Note that there are some explanatory texts on larger screens.

plurals
  1. POalign CSS elements in relation to underlying element
    primarykey
    data
    text
    <p>This is my HTML:</p> <pre><code>&lt;nav id="menu"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=""&gt;Produkte&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=""&gt;Angebote&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=""&gt;Referenzen&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=""&gt;Anfahrt&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=""&gt;&amp;Uuml;ber uns&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=""&gt;Jobs&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=""&gt;Partner&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=""&gt;Kontakt&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; </code></pre> <p>And this is my CSS:</p> <pre><code>#menu { position:relative; width:100%; height:35px; margin-bottom:10px; background-image: url("../img/menuBackground.png"); background-repeat: no-repeat; } #menu ul { display: block; list-style-type: none; position: relative; top:5px; margin-left:20px; margin-right:20px; } #menu ul li { display: block; position: relative; float: left; margin-right: 16px; } </code></pre> <p>As you might see there is a white stripe in the "menuBackground.png". (So the white stripe is part of the "menuBackground.png" image.) The problem is, that the menu gets generated automatically by a CMS. <strong>And the text in the A elements should never ever overlap the underlying white stripe,</strong> as it is happening with the Kontakt Element.</p> <p><strong>How can i ensure, that there will be some additional spacing, when the element overlaps the white stripe?</strong></p> <p>Thanks in advance for any reply on this</p> <p><img src="https://i.stack.imgur.com/eUAEy.png" alt="Screenshot browser"></p> <p><img src="https://i.stack.imgur.com/WSJSV.png" alt="Original Image"></p> <p>HERE IS A <a href="http://jsfiddle.net/NwPKk/" rel="nofollow noreferrer">JS FIDDLE EXAMPLE</a> ...</p>
    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