Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Naviagtion CSS / Text ausrichten

Empfohlene Antworten

Veröffentlicht

Hallo,

ich bin gerade dabei mich mit css vertraut zu machen. Ich bastel gerade an einer horizontalen Navigation mit einer Unterbene die vertikal ausgerichtet ist. Nun habe ich eine Frage.

Das Bild im Anhang zeigt die Navigation, nun meine Frage, kann man es einrichten das die Links (Text z.B. "Allgemeines") in dem Rahmen weiter links positioniert werden?

Ich habe den text mit "left" angegeben, aber dennoch ist so ein großer Abstand links.

Hat jemand eine Idee? Was von dem Code benötigt ihr?

<style type="text/css">

  body, p a {

    font: normal 100.01% verdana, Arial, sans-serif;

    font-size:small;

    color: black; 

    background-color: white;

  }


* html body {

	font-size:x-small;

	f\ont-size:small;

}


  div#Rahmen {

    width: 70em; 

    padding: 0.8em;

    background-color: white;

  }

  * html div#Rahmen { 

    width: 65.7em;

    w\idth: 64.1em;

  }

  div#Rahmen div {

     clear: left;

  }

  ul#Navigation {

    margin: 0; padding:0; 

    text-align: left; 

  }


  ul#Navigation li {

    list-style: none;

    float: left;  

    position: relative;

    margin: 0; padding: 0;

  }

  * html ul#Navigation li {  

    margin-bottom: 0em;

  }


  ul#Navigation li ul {

    margin: 0; padding: 0;

    position: absolute;

    top: 1.9em; left: 0em; 

    display: none;

  }

  * html ul#Navigation li ul {  

    left: -1.5em;

    lef\t: 0em;

    top:1.9em;

    to\p:1.9em;


  }

  ul#Navigation li:hover ul {

    display: block;

  }

  ul#Navigation li ul li {

    float: none;

    display: block;

    margin-bottom: 0em;

  }


  ul#Navigation a, ul#Navigation span {

    display: block;

    width: 8em;  

    padding: 0.3em 1em;

    text-decoration: none; font-weight: bold;

    border: 1px solid black;

    border-left-color: white; border-top-color: white;

    color: white; background-color: blue;

  }

  * html ul#Navigation a, * html ul#Navigation span {

    width: 8.4em;   

    w\idth: 8.4em;  

  }

ul#Navigation a:hover, ul#Navigation span, li a#aktuell {

    border-color: white;

    border-left-color: black; border-top-color: black;

    color: black; background-color: white;

  }

  li a#aktuell {  

    color: maroon; background-color: white;

  }

  ul#Navigation li ul span {

    background-color: white;

  }


</style>

Schöne Grüße,

Nefertari

post-27528-14430447368003_thumb.gif

ul#Navigation a, ul#Navigation span {

display: block;

width: 8em;

padding: 0.3em 1em;

Hilft es wenn du das hier alles auf 0 setzt?

Hallo mhel,

danke!!! Ich dachte ich hätte das schon getestet aber ich habe folgenden Wert geändert:

ul#Navigation a, ul#Navigation span {

    display: block;

    width: 8em;  

    padding: 0.3em [COLOR="Red"]1em[/COLOR]; !!!AUF 0 GESETZT!!!

    text-decoration: none; font-weight: bold;

    border: 1px solid black;

    border-left-color: white; border-top-color: white;

    color: white; background-color: blue;

  }

Hab noch mal vielen Dank!

Schöne sonnige Grüße,

Nefertari

*g* nicht so ne überschwengliche Freude. Hab auch erst vor kurzem angefangen mich mit html zu beschäftigen und die css Probleme hatte ich auch schon.

Schau doch einfach mal hier im self html. Da sind erstmal die ganzen Abstände erklärt die es so gibt. Und sonst kannst auch einfach mal allgemein durch die Seite lesen. Dort findest immer was, was man einbauen kann und gut aussieht.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.