diff --git a/dev/js/spec/alwaysMenuSpec.js b/dev/js/spec/alwaysMenuSpec.js
index 66fc980..1b1763e 100644
--- a/dev/js/spec/alwaysMenuSpec.js
+++ b/dev/js/spec/alwaysMenuSpec.js
@@ -200,8 +200,9 @@
         menu._firstActive = true;
         expect(menu.itemClass()).toEqual(OwnAlwaysMenuItem);
         expect(menu._notItemElements).toEqual(4);
-        expect(menu.element().getElementsByClassName("pref").length).toEqual(2); //TODO: new scss = new class
-        expect(menu.element().getElementsByClassName("pref")[1].innerHTML).toEqual("Speichern");
+        expect(menu.element().getElementsByClassName("entry").length).toEqual(1); 
+        expect(menu.element().getElementsByClassName("entry").length).toEqual(1);
+        expect(menu.element().getElementsByClassName("entry")[0].innerHTML).toEqual("Speichern");
         expect(menu.alwaysEntry().element().innerHTML).toEqual("Speichern");
         //expect(menu.element().childNodes[3].innerHTML).toEqual("Speichern"); //?
         // getElementsByClassName funktioniert bei allen Kindern.
@@ -1242,7 +1243,8 @@
     describe('KorAP.AlwaysMenu.Entry', function () {
       it('should be initializable', function () {
         var p = alwaysEntryClass.create();
-        expect(p.element().classList.contains('pref')).toBeTruthy();
+        expect(p.element().classList.contains('pref')).toBeFalsy();
+        expect(p.element().classList.contains('entry')).toBeTruthy();
         expect(p.isSet()).not.toBeTruthy();
         expect(p.element().innerHTML).toEqual("Speichern");
         expect(p.value()).toEqual("");
@@ -1255,7 +1257,8 @@
 
       it('should be initializable with a different name', function () {
         var p = alwaysEntryClass.create("Save");
-        expect(p.element().classList.contains('pref')).toBeTruthy();
+        expect(p.element().classList.contains('pref')).toBeFalsy();
+        expect(p.element().classList.contains('entry')).toBeTruthy();
         expect(p.isSet()).not.toBeTruthy();
         expect(p.element().innerHTML).toEqual("Save");
         expect(p.value()).toEqual("");
diff --git a/dev/js/spec/menuSpec.js b/dev/js/spec/menuSpec.js
index 8cb62fa..3310c88 100644
--- a/dev/js/spec/menuSpec.js
+++ b/dev/js/spec/menuSpec.js
@@ -3,9 +3,9 @@
   function (menuClass, menuItemClass, prefixClass, lengthFieldClass) {
  
     // The OwnMenu item
-    KorAP.OwnMenuItem = {
+    const OwnMenuItem = {
       create : function (params) {
-        return Object.create(menuItemClass).upgradeTo(KorAP.OwnMenuItem)._init(params);
+        return Object.create(menuItemClass).upgradeTo(this)._init(params);
       },
       content : function (content) {
         if (arguments.length === 1) {
@@ -25,20 +25,20 @@
     };
 
     // The OwnMenu
-    KorAP.OwnMenu = {
+    const OwnMenu = {
       create : function (list) {
         return Object.create(menuClass)
-	        .upgradeTo(KorAP.OwnMenu)
-	        ._init(list, { itemClass : KorAP.OwnMenuItem });
+	        .upgradeTo(this)
+	        ._init(list, { itemClass : OwnMenuItem });
       }
     };
 
 
     // HintMenuItem
-    KorAP.HintMenuItem = {
+    const HintMenuItem = {
       create : function (params) {
         return Object.create(menuItemClass)
-	        .upgradeTo(KorAP.HintMenuItem)
+	        .upgradeTo(this)
 	        ._init(params);
       },
       content : function (content) {
@@ -99,11 +99,11 @@
 
 
     // HintMenu
-    KorAP.HintMenu = {
+    const HintMenu = {
       create : function (context, list) {
         var obj = Object.create(menuClass)
-	          .upgradeTo(KorAP.HintMenu)
-	          ._init(list, {itemClass : KorAP.HintMenuItem});
+	          .upgradeTo(this)
+	          ._init(list, {itemClass : HintMenuItem});
         obj._context = context;
         return obj;
       }
@@ -111,10 +111,10 @@
 
 
     // The ComplexMenuItem
-    KorAP.ComplexMenuItem = {
+    const ComplexMenuItem = {
       create : function (params) {
         return Object.create(menuItemClass)
-	        .upgradeTo(KorAP.ComplexMenuItem)
+	        .upgradeTo(this)
 	        ._init(params);
       },
       content : function (content) {
@@ -149,21 +149,21 @@
         ).toThrow(new Error("Missing parameters"));
 
         expect(
-	        function() { KorAP.OwnMenuItem.create([]) }
+	        function() { OwnMenuItem.create([]) }
         ).toThrow(new Error("Missing parameters"));
 
-        var mi = KorAP.OwnMenuItem.create(["Baum"]);
+        var mi = OwnMenuItem.create(["Baum"]);
         expect(mi.element().firstChild.nodeValue).toEqual('Baum');
         expect(mi.lcField()).toEqual(' baum');
       });
 
       it('shouldn\'t have a reference to the menu', function () {
-        var menuItem = KorAP.OwnMenuItem.create(['Test']);
+        var menuItem = OwnMenuItem.create(['Test']);
         expect(menuItem.menu()).toBe(undefined);
       });
 
       it('should be activatable and deactivateable by class', function () {
-        var menuItem = KorAP.OwnMenuItem.create(['Test']);
+        var menuItem = OwnMenuItem.create(['Test']);
 
         expect(menuItem.active()).toBe(false);
         expect(menuItem.element().getAttribute("class")).toBe(null);
@@ -177,7 +177,7 @@
         expect(menuItem.active()).toBe(true);
         expect(menuItem.element().getAttribute("class")).toEqual("active");
 
-        menuItem = KorAP.OwnMenuItem.create(['Spiegel']);
+        menuItem = OwnMenuItem.create(['Spiegel']);
         expect(menuItem.active()).toBe(false);
         expect(menuItem.element().getAttribute("class")).toBe(null);
         menuItem.active(false); // Is not active
@@ -186,7 +186,7 @@
       });
 
       it('should be set to boundary', function () {
-        var menuItem = KorAP.OwnMenuItem.create(['CoreNLP']);
+        var menuItem = OwnMenuItem.create(['CoreNLP']);
         expect(menuItem.active()).toBe(false);
         expect(menuItem.element().getAttribute("class")).toBe(null);
 
@@ -225,7 +225,7 @@
 
       it('should be highlightable', function () {
         // Highlight in the middle
-        var menuItem = KorAP.OwnMenuItem.create(['CoreNLP']);
+        var menuItem = OwnMenuItem.create(['CoreNLP']);
         menuItem.highlight("ren");
         expect(menuItem.element().innerHTML).toEqual("Co<mark>reN</mark>LP");
 
@@ -235,7 +235,7 @@
         var plain = "<div><h1>CoreNLP</h1><h2>corenlp/</h2></div>";
 
         // Starting highlight
-        menuItem = KorAP.ComplexMenuItem.create(['CoreNLP', 'corenlp/']);
+        menuItem = ComplexMenuItem.create(['CoreNLP', 'corenlp/']);
         menuItem.highlight("cor");
         expect(menuItem.element().innerHTML).toEqual("<div><h1><mark>Cor</mark>eNLP</h1><h2><mark>cor</mark>enlp/</h2></div>");
 
@@ -243,7 +243,7 @@
         expect(menuItem.element().innerHTML).toEqual(plain);
 
         // Starting highlight - short
-        menuItem = KorAP.ComplexMenuItem.create(['CoreNLP', 'corenlp/']);
+        menuItem = ComplexMenuItem.create(['CoreNLP', 'corenlp/']);
         menuItem.highlight("c");
         expect(menuItem.element().innerHTML).toEqual("<div><h1><mark>C</mark>oreNLP</h1><h2><mark>c</mark>orenlp/</h2></div>");
 
@@ -251,7 +251,7 @@
         expect(menuItem.element().innerHTML).toEqual(plain);
 
         // Highlight at the end
-        menuItem = KorAP.ComplexMenuItem.create(['CoreNLP', 'corenlp/']);
+        menuItem = ComplexMenuItem.create(['CoreNLP', 'corenlp/']);
         menuItem.highlight("nlp");
         expect(menuItem.element().innerHTML).toEqual("<div><h1>Core<mark>NLP</mark></h1><h2>core<mark>nlp</mark>/</h2></div>");
 
@@ -259,7 +259,7 @@
         expect(menuItem.element().innerHTML).toEqual(plain);
 
         // Highlight at the end - short
-        menuItem = KorAP.ComplexMenuItem.create(['CoreNLP', 'corenlp/']);
+        menuItem = ComplexMenuItem.create(['CoreNLP', 'corenlp/']);
         menuItem.highlight("p");
         expect(menuItem.element().innerHTML).toEqual("<div><h1>CoreNL<mark>P</mark></h1><h2>corenl<mark>p</mark>/</h2></div>");
 
@@ -267,7 +267,7 @@
         expect(menuItem.element().innerHTML).toEqual(plain);
 
         // No highlight
-        menuItem = KorAP.ComplexMenuItem.create(['CoreNLP', 'corenlp/']);
+        menuItem = ComplexMenuItem.create(['CoreNLP', 'corenlp/']);
         menuItem.highlight("xp");
         expect(menuItem.element().innerHTML).toEqual(plain);
 
@@ -275,7 +275,7 @@
         expect(menuItem.element().innerHTML).toEqual(plain);
 
         // Highlight in the middle - first
-        menuItem = KorAP.ComplexMenuItem.create(['CoreNLP', 'corenlp/', 'This is my Example']);
+        menuItem = ComplexMenuItem.create(['CoreNLP', 'corenlp/', 'This is my Example']);
         menuItem.highlight("ren");
         expect(menuItem.element().innerHTML).toEqual("<div><h1>Co<mark>reN</mark>LP</h1><h2>co<mark>ren</mark>lp/</h2><h3>This is my Example</h3></div>");
 
@@ -285,7 +285,7 @@
         expect(menuItem.element().innerHTML).toEqual(plain);
 
         // Highlight in the middle - second
-        menuItem = KorAP.ComplexMenuItem.create(['CoreNLP', 'corenlp/', 'This is my Example']);
+        menuItem = ComplexMenuItem.create(['CoreNLP', 'corenlp/', 'This is my Example']);
         menuItem.highlight("ampl");
         expect(menuItem.element().innerHTML).toEqual("<div><h1>CoreNLP</h1><h2>corenlp/</h2><h3>This is my Ex<mark>ampl</mark>e</h3></div>");
 
@@ -293,7 +293,7 @@
         expect(menuItem.element().innerHTML).toEqual(plain);
 
         // Highlight in the middle - both
-        menuItem = KorAP.ComplexMenuItem.create(['CoreNLP', 'corenlp/', 'This is my Example']);
+        menuItem = ComplexMenuItem.create(['CoreNLP', 'corenlp/', 'This is my Example']);
         menuItem.highlight("e");
 
         expect(menuItem.element().innerHTML).toEqual("<div><h1>Cor<mark>e</mark>NLP</h1><h2>cor<mark>e</mark>nlp/</h2><h3>This is my <mark>E</mark>xampl<mark>e</mark></h3></div>");
@@ -302,7 +302,7 @@
         expect(menuItem.element().innerHTML).toEqual(plain);
 
         // Highlight in the end - second
-        menuItem = KorAP.ComplexMenuItem.create(['CoreNLP', 'corenlp/', 'This is my Example']);
+        menuItem = ComplexMenuItem.create(['CoreNLP', 'corenlp/', 'This is my Example']);
         menuItem.highlight("le");
         expect(menuItem.element().innerHTML).toEqual("<div><h1>CoreNLP</h1><h2>corenlp/</h2><h3>This is my Examp<mark>le</mark></h3></div>");
 
@@ -310,7 +310,7 @@
         expect(menuItem.element().innerHTML).toEqual(plain);
 
         // Highlight at the beginning - second
-        menuItem = KorAP.ComplexMenuItem.create(['CoreNLP', 'corenlp/', 'This is my Example']);
+        menuItem = ComplexMenuItem.create(['CoreNLP', 'corenlp/', 'This is my Example']);
         menuItem.highlight("this");
         expect(menuItem.element().innerHTML).toEqual("<div><h1>CoreNLP</h1><h2>corenlp/</h2><h3><mark>This</mark> is my Example</h3></div>");
 
@@ -373,10 +373,10 @@
 	        ["Syntax"]
         ];
 
-        var menu = KorAP.OwnMenu.create(list);
+        var menu = OwnMenu.create(list);
         expect(menu.dontHide).toBe(false);
         menu._firstActive = true;
-        expect(menu.itemClass()).toEqual(KorAP.OwnMenuItem);
+        expect(menu.itemClass()).toEqual(OwnMenuItem);
         expect(menu.element().nodeName).toEqual('UL');
         expect(menu.element().classList.contains('visible')).toBeFalsy();
         expect(menu.limit()).toEqual(8);
@@ -404,15 +404,15 @@
       });
 
       it('should have a reference to the menu', function () {
-        var menu = KorAP.HintMenu.create("cnx/", list);
+        var menu = HintMenu.create("cnx/", list);
         expect(menu.item(0).menu()).toEqual(menu);
 
-        menu = KorAP.HintMenu.create("cnx/", list);
+        menu = HintMenu.create("cnx/", list);
         expect(menu.element().menu).toEqual(menu);
       });
       
       it('should only remove direct descendants with removeItems', function () {
-        var menu = KorAP.HintMenu.create("cnx/", list);
+        var menu = HintMenu.create("cnx/", list);
         var newUL = document.createElement("ul");
         var newLI = document.createElement("li");
         newUL.appendChild(newLI);
@@ -428,7 +428,7 @@
 
 
       it('should be visible', function () {
-        var menu = KorAP.HintMenu.create("cnx/", list);
+        var menu = HintMenu.create("cnx/", list);
         expect(menu.removeItems()).toBe(undefined);
         menu.limit(3);
 
@@ -447,7 +447,7 @@
       });
 
       it('should be filterable', function () {
-        var menu = KorAP.HintMenu.create("cnx/", list);
+        var menu = HintMenu.create("cnx/", list);
         menu.limit(3);
         expect(menu.prefix("o").show()).toBe(true);
         expect(menu.element().getElementsByClassName("pref")[0].innerHTML).toEqual("o");
@@ -492,7 +492,7 @@
       });
 
       it('should be nextable', function () {
-        var menu = KorAP.HintMenu.create("cnx/", list);
+        var menu = HintMenu.create("cnx/", list);
         menu._firstActive = true;
 
         // Show only 3 items
@@ -569,7 +569,7 @@
       });
 
       it('should be nextable without active field', function () {
-        var menu = KorAP.HintMenu.create("cnx/", list);
+        var menu = HintMenu.create("cnx/", list);
         menu.limit(3);
         expect(menu.show()).toBe(true);
         menu.next();
@@ -578,7 +578,7 @@
 
 
       it('should be prevable', function () {
-        var menu = KorAP.HintMenu.create("cnx/", list);
+        var menu = HintMenu.create("cnx/", list);
         menu._firstActive = true;
         menu.limit(3);
         expect(menu.show()).toBe(true);
@@ -666,7 +666,7 @@
       });
 
       it('should be prevable without active field', function () {
-        var menu = KorAP.HintMenu.create("cnx/", list);
+        var menu = HintMenu.create("cnx/", list);
         menu.limit(3);
         expect(menu.show()).toBe(true);
         menu.prev();
@@ -675,7 +675,7 @@
       });
 
       it('should be navigatable and filterable (prefix = "o")', function () {
-        var menu = KorAP.HintMenu.create("cnx/", list);
+        var menu = HintMenu.create("cnx/", list);
         menu._firstActive = true;
         menu.limit(2);
 
@@ -730,7 +730,7 @@
 
 
       it('should be navigatable and filterable (prefix = "ex", "e")', function () {
-        var menu = KorAP.HintMenu.create("cnx/", list);
+        var menu = HintMenu.create("cnx/", list);
         menu._firstActive = true;
 
         menu.limit(2);
@@ -817,7 +817,7 @@
       });
 
       it('should be filterable (multiple prefix = "pro sin")', function () {
-        var menu = KorAP.HintMenu.create("drukola/p=", listMultiPrefix);
+        var menu = HintMenu.create("drukola/p=", listMultiPrefix);
         menu._firstActive = true;
 
         menu.limit(2);
@@ -836,7 +836,7 @@
       });
 
       it('should be filterable (trimming = " p")', function () {
-        var menu = KorAP.HintMenu.create("/p=", listMultiPrefix);
+        var menu = HintMenu.create("/p=", listMultiPrefix);
         // menu._firstActive = true;
 
         menu.limit(2);
@@ -854,7 +854,7 @@
 
       
       it('should choose prefix with failing prefix (1)', function () {
-        var menu = KorAP.HintMenu.create("cnx/", list);
+        var menu = HintMenu.create("cnx/", list);
         menu.limit(2);
         expect(menu.prefix("exit").show()).toBe(true);
         expect(menu.element().querySelector('li')).toBe(null);
@@ -864,7 +864,7 @@
 
 
       it('should choose prefix with failing prefix (2)', function () {
-        var menu = KorAP.HintMenu.create("cnx/", list);
+        var menu = HintMenu.create("cnx/", list);
         menu.limit(2);
         expect(menu.show()).toBe(true);
         expect(menu.prefix("exit").show()).toBe(true);
@@ -874,7 +874,7 @@
       });
 
       it('should ignore navigation with failing prefix', function () {
-        var menu = KorAP.HintMenu.create("cnx/", list);
+        var menu = HintMenu.create("cnx/", list);
         menu.limit(2);
         expect(menu.show()).toBe(true);
 
@@ -894,7 +894,7 @@
       });
 
       it('should be navigatable with prefix', function () {
-        var menu = KorAP.HintMenu.create("cnx/", demolist);
+        var menu = HintMenu.create("cnx/", demolist);
         menu._firstActive = true;
 
         menu.limit(3);
@@ -1031,7 +1031,7 @@
 
 
       it('should be navigatable with a prefix (1)', function () {
-        var menu = KorAP.HintMenu.create("cnx/", demolist);
+        var menu = HintMenu.create("cnx/", demolist);
         menu._firstActive = true;
 
         menu.limit(3);
@@ -1093,7 +1093,7 @@
 
 
       it('should be navigatable with a prefix (2)', function () {
-        var menu = KorAP.HintMenu.create("cnx/", demolist);
+        var menu = HintMenu.create("cnx/", demolist);
         menu._firstActive = true;
 
         menu.limit(3);
@@ -1138,7 +1138,7 @@
       });
 
       it('should be navigatable with a prefix (3)', function () {
-        var menu = KorAP.HintMenu.create("cnx/", demolist);
+        var menu = HintMenu.create("cnx/", demolist);
         menu._firstActive = true;
         menu.limit(3);
         expect(menu.show()).toBe(true);
@@ -1183,7 +1183,7 @@
       });
 
       it('should show screens by offset', function () {
-        var menu = KorAP.HintMenu.create('cnx/', demolist);
+        var menu = HintMenu.create('cnx/', demolist);
         menu.limit(3);
         expect(menu.show()).toBe(true);
 
@@ -1242,7 +1242,7 @@
       });
 
       it('should show screens by offset when prefixed', function () {
-        var menu = KorAP.HintMenu.create('cnx/', demolist);
+        var menu = HintMenu.create('cnx/', demolist);
         menu.limit(3);
         expect(menu.prefix("e").show()).toBe(true);
         expect(menu.shownItem(0).active()).toBe(false);
@@ -1256,7 +1256,7 @@
 
 
       it('should be page downable', function () {
-        var menu = KorAP.OwnMenu.create(demolonglist);
+        var menu = OwnMenu.create(demolonglist);
         menu.limit(3);
 
         expect(menu.show(0)).toBe(true);
@@ -1291,7 +1291,7 @@
       });
 
       it('should be page downable with prefix', function () {
-        var menu = KorAP.OwnMenu.create(demolonglist);
+        var menu = OwnMenu.create(demolonglist);
         menu.limit(3);
 
         expect(menu.prefix('e').show(0)).toBe(true);
@@ -1326,7 +1326,7 @@
 
 
       it('should be page upable', function () {
-        var menu = KorAP.OwnMenu.create(demolonglist);
+        var menu = OwnMenu.create(demolonglist);
         menu.limit(3);
 
         // Choose the final value
@@ -1362,7 +1362,7 @@
       });
 
       it('should be page upable with prefix', function () {
-        var menu = KorAP.OwnMenu.create(demolonglist);
+        var menu = OwnMenu.create(demolonglist);
         menu.limit(3);
 
         // Choose the final value
@@ -1397,7 +1397,7 @@
       });
 
       it('should be view upable and downable (1)', function () {
-        var menu = KorAP.OwnMenu.create(demolonglist);
+        var menu = OwnMenu.create(demolonglist);
         menu.limit(7);
 
         // Choose the final value
@@ -1441,7 +1441,7 @@
       it('should be view upable and downable (2)', function () {
 
         // List is longer than limit
-        var menu = KorAP.OwnMenu.create(demolist);
+        var menu = OwnMenu.create(demolist);
         menu.limit(7);
 
         // Choose the final value
@@ -1471,7 +1471,7 @@
 
       
       it('should scroll to a chosen value (1)', function () {
-        var menu = KorAP.OwnMenu.create(demolist);
+        var menu = OwnMenu.create(demolist);
         menu.limit(3);
 
         // Choose value 1
@@ -1494,7 +1494,7 @@
       });
 
       it('should scroll to a chosen value (2)', function () {
-        var menu = KorAP.OwnMenu.create(demolonglist);
+        var menu = OwnMenu.create(demolonglist);
 
         // Choose value 3
         expect(menu.limit(3).show(3)).toBe(true);
@@ -1645,7 +1645,7 @@
 	        ["Syntax"]
         ];
 
-        var menu = KorAP.OwnMenu.create(list);
+        var menu = OwnMenu.create(list);
 
         expect(menu.lengthField().element().children.length).toEqual(5);
       });
@@ -1674,7 +1674,7 @@
 	        ["Syntax"]
         ];
 
-        var menu = KorAP.OwnMenu.create(list);
+        var menu = OwnMenu.create(list);
 
         menu._firstActive = true;
         menu.limit(3);
@@ -1697,7 +1697,7 @@
 	        ["Syntax"]
         ];
 
-        var menu = KorAP.OwnMenu.create(list);
+        var menu = OwnMenu.create(list);
 
         menu._firstActive = true;
         menu.limit(3);
@@ -1743,7 +1743,7 @@
       });
 
       it('should correctly resize on prefixing', function () {
-        var menu = KorAP.OwnMenu.create(demolonglist);
+        var menu = OwnMenu.create(demolonglist);
         menu._firstActive = true;
         menu.limit(3);
 
@@ -1774,7 +1774,7 @@
 	        ["Syntax"]
         ];
 
-        var menu = KorAP.OwnMenu.create(list);
+        var menu = OwnMenu.create(list);
 
         menu._firstActive = true;
         menu.limit(3);
diff --git a/dev/js/src/alwaysentry.js b/dev/js/src/alwaysentry.js
index f3f7b42..ae99ae9 100644
--- a/dev/js/src/alwaysentry.js
+++ b/dev/js/src/alwaysentry.js
@@ -26,16 +26,20 @@
         .upgradeTo(this)
         ._init();
       obj._el.innerHTML = text || "Speichern";
+      obj._el.classList.remove("pref");
+      obj._el.classList.add("entry");
       //dont forget to adjust alwaysMenuSpec - alwaysEntry!
       return obj;
     },
 
     _update : function () {
+      /*
       if (this._string.length!==0){ // I assume that this is a sufficient criterium for infering that the prefix is active
         this._el.style.bottom="-27px";
       } else if (this._string.length===0) {
         this._el.style.bottom="0px";
       }
+      */
       return this._string; // No need to change the text (=innerHTML)
     },
 
diff --git a/dev/js/src/hint/foundries.js b/dev/js/src/hint/foundries.js
index ce6ef43..80d7332 100644
--- a/dev/js/src/hint/foundries.js
+++ b/dev/js/src/hint/foundries.js
@@ -1,3 +1,5 @@
+window.KorAP = window.KorAP || {};
+
 KorAP.annotationHelper = KorAP.annotationHelper || { '-' : [] };
 
 "use strict";
diff --git a/dev/scss/base/menu.scss b/dev/scss/base/menu.scss
index 0008b8b..b743362 100644
--- a/dev/scss/base/menu.scss
+++ b/dev/scss/base/menu.scss
@@ -187,6 +187,22 @@
     margin-bottom: -2.1em;
     padding:       2px 6px;
   }
+  /**
+   * Default entry view
+   */
+  span.entry:not(:empty) {
+    position:      absolute;
+    min-width:     5px;
+    font-size:     80%;
+    left:          0;
+    bottom:        0;
+    display:       block;
+    margin-bottom: -2.1em;
+    padding:       2px 6px;
+  }
+  span.pref:not(:empty) ~ span.entry:not(:empty){
+    bottom:        -27px;
+  }
 }
 
 
