Web Analytics Made Easy -
StatCounter Unable to align text right - CodingForum

Announcement

Collapse
No announcement yet.

Unable to align text right

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to align text right

    My text in this nav bar will not align to the right
    From .css style sheet:

    #navblock {
    text-align: right;
    background-color:#FFF;
    position: inherit;
    width:130px;
    text-align:right;
    float: left;
    height: 951px;
    padding-top: 0.9em;

    }

    From spry menu bar.css:

    ul.MenuBarVertical a
    {
    display: block;
    cursor: pointer;
    background-color: #FFF;
    padding:.80em 1.25em;
    font-family: Verdana, Geneva, sans-serif;
    color: #3d3d3d;
    font-size: 130%;
    text-align: right;
    color: #3d3d3d;
    text-decoration: none;

    ENTIRE Java.css

    /* SpryMenuBarVertical.css - version 0.6 - Spry Pre-Release 1.6.1 */

    /* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */




    ul.MenuBarVertical
    {
    margin: 0;
    padding: 0;
    list-style-type: none;
    font-family: Verdana, Geneva, sans-serif;
    color: #3d3d3d;
    text-align: right;
    font-size: 80%;
    cursor: default;
    width:130px;
    }
    /* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
    ul.MenuBarActive
    {
    z-index: 1000;
    }
    /* Menu item containers, position children relative to this container and are same fixed width as parent */
    ul.MenuBarVertical li
    {
    font-family: Verdana, Geneva, sans-serif;
    color: #3d3d3d;
    font-size: 80%;
    text-align: right;
    cursor: pointer;

    }
    /* Submenus should appear slightly overlapping to the right (95%) and up (-5%) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
    ul.MenuBarVertical ul
    {
    margin: 5% 0 0 95%;
    padding: 0;
    list-style-type: none;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 85%;
    position: absolute;
    z-index: 1020;
    cursor: default;


    }
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
    ul.MenuBarVertical ul.MenuBarSubmenuVisible
    {
    left: auto;
    }
    /* Menu item containers are same fixed width as parent */
    ul.MenuBarVertical ul li
    {
    width:130px;
    }

    /*******************************************************************************

    DESIGN INFORMATION: describes color scheme, borders, fonts

    *******************************************************************************/


    /* Menu items are a light gray block with padding and no text decoration 0.5em 0.75em */
    ul.MenuBarVertical a
    {
    display: block;
    cursor: pointer;
    background-color: #FFF;
    padding:.80em 1.25em;
    font-family: Verdana, Geneva, sans-serif;
    color: #3d3d3d;
    font-size: 130%;
    text-align: right;
    color: #3d3d3d;
    text-decoration: none;
    }
    /* Menu items that have mouse over or focus have a blue background and white text */
    ul.MenuBarVertical a:hover, ul.MenuBarVertical a:focus
    {
    background-color: #76b955;/*yellow green*/
    color: #FFF;
    }
    /* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
    ul.MenuBarVertical a.MenuBarItemHover, ul.MenuBarVertical a.MenuBarItemSubmenuHover, ul.MenuBarVertical a.MenuBarSubmenuVisible
    {
    background-color: #76b955;/*yellow green*/
    color: #FFF;
    }

    /*******************************************************************************

    SUBMENU INDICATION: styles if there is a submenu under a given menu item

    *******************************************************************************/

    /* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarVertical a.MenuBarItemSubmenu
    {
    background-image: url(SpryMenuBarRight.gif);
    background-repeat: no-repeat;
    background-position: 100% 50%;
    }

    /* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarVertical a.MenuBarItemSubmenuHover
    {
    background-image: url(SpryMenuBarRightHover.gif);
    background-repeat: no-repeat;
    background-position: 100% 50%;
    }
    ul.MenuBarVerical ul {
    width:130px;
    }

    /*******************************************************************************

    BROWSER HACKS: the hacks below should not be changed unless you are an expert

    *******************************************************************************/

    /* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
    ul.MenuBarVertical iframe
    {
    position: absolute;
    z-index: 1010;
    filter:alpha(opacity:0.1);
    }
    /* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
    @media screen, projection
    {
    ul.MenuBarVertical li.MenuBarItemIE
    {
    display: inline;
    f\loat: left;
    background: #FFF;
    }
    }
    Last edited by jennyreb; Aug 23, 2011, 03:25 PM. Reason: Complete code

  • #2
    share complete code including html and css. its better if u ll share working link

    Comment


    • #3
      Aside from what Vikram1vicky says (it's better to see the full picture than what you want us to see), just looking at the code, the culprit looks like it could be this section:

      Code:
      ul.MenuBarVertical a
      {
      display: block;
      cursor: pointer;
      background-color: #FFF;
      padding:.80em 1.25em;
      font-family: Verdana, Geneva, sans-serif;
      color: #3d3d3d;
      font-size: 130%;
      text-align: right;
      color: #3d3d3d;
      text-decoration: none;
      }
      More specifically the padding. You are giving it a padding of 1.25em on the left and right side. Depending on the size of the navigation, it could just be wide enough to hold the text, but giving it a padding on the left and right will not make it look right aligned...it will make it look centered. Try removing the padding on this element and see if the text is right aligned. Also, try enlarging the width of the menu, to make sure the alignment is being applied. If that doesn't solve it, please post all code and (if possible) a link to the site so we can look and diagnose.
      WordPress Designer and theme developer. KlongDesigns - helping bloggers and non-technical folks claim their space on the internet.

      Comment


      • #4
        You can try align the text by giving it individually style and alignment.
        That is what a new and learning programmer like me do

        Comment

        Working...
        X