[CSS] text zentrieren?

Dieses Thema im Forum "Webdesign" wurde erstellt von Enforcer, 23. August 2011 .

Schlagworte:
  1. 23. August 2011
    Zuletzt von einem Moderator bearbeitet: 14. April 2017
    text zentrieren?

    Hey, ich bastle mir momentan ein eigenes Wordpress Theme zusammen, und dabei bin ich auf folgendes Problem gestoßen. Das ganze wird ein Aufklapp-Menü, der Text der aufklappenden Box soll mittig zentriert sein, ist er aber nicht.

    Code:
    
    #access {
     
     background: #ff9a88;
     /*background-image:url(images/leiste2.gif); background-repeat:repeat-y; background-position:center 31px; 
     display: block;
     position: absolute; */
     text-align: center;
     margin: 0 auto;
     width: 100%;
     height: 40px;
    }
    
    #access ul{display:inline-block;}
    
    
    #access ul {
     background-color: #ce371c;
     list-style: none;
     margin: 0;
     padding-left: 0;
    }
    #access li {
     float: left;
     position: relative;
    
    }
    
    
    #access a {
     color: white;
     font: 1.1em Tahoma;
     font-variant:small-caps;
     font-stretch:narrower;
     display: block;
     line-height: 40px;
     padding: 0 2.5em;
     text-decoration: none;
     background-image:url(images/pfeil.png); background-repeat:no-repeat; background-position:center 31px;
     background-attachment:scroll;
     border-right-width: 2px;
     border-color: black;
     border-right-style: solid;
    }
    
    #access .verein {
     border-left-width: 2px;
     border-color: black;
     border-left-style: solid;}
     
    #access .kontakt a {
     background-image:none !important;}
     
    #access ul ul {
     display: none;
     position: absolute;
     top: 2.5em;
     left: 0;
     z-index: 99999;
    }
    #access ul ul ul {
     left: 100%;
     top: 0;
    }
    
    #access ul ul a {
     text-align: center;
     font: 1em Tahoma;
     color: #b8b8b8;
     background: #262327;
     padding-top: 5px;
     padding-bottom: 5px;
     line-height: 1em;
    }
    
    #access .verein1 {
     width: 191px;
     }
    
    #access .finanzierung1 {
     width: 189px; }
    
    #access .projekte1 {
     width: 157px; }
    
    #access .kontakt1 {
     width: 132px; }
     
    #access .intern1 {
     width: 140px; }
    
    
    #access li:hover > a,
    #access ul ul :hover > a {
     background: #ff9a88;
     background-image:url(images/pfeil.png); background-repeat:no-repeat; background-position:center 31px;
     background-attachment:scroll;
    }
    #access ul ul a:hover {
     color: white;
     background: #000000;
    }
    #access ul li:hover > ul {
     display: block;
    }
    
    
    Sieht dann so aus:
    Bild

    Ich hoffe mir kann jemand weiterhelfen!

    Gruß,
    Enforcer
     
  2. 23. August 2011
    AW: text zentrieren?

    hm das is schwer, da dieser von wordpress generiert wird.
    den quelltext könnte ich angeben falls der was nützt
     
  3. 23. August 2011
    AW: text zentrieren?

    Schau doch mal mim Webdeveloper oder nem anderen Tool ob vllt irgendwo ein padding-left oder ein margin-left gesetzt ist. sieht fast so aus...

    normal sollte text-align:center; zum zentrieren funktionieren.

    Html code oder irgend ein anderer Code auf den sich das CSS bezieht wäre halt schon gut
     
  4. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.