My text won't align to the right

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hgeithus
    New Member
    • Oct 2008
    • 20

    My text won't align to the right

    Hi.

    Description of problem: I'm using this CSS-template to build a website: http://www.glish.com/css/7.asp (scroll down at the site to see the full code of the template).

    What I did was to create a new CSS element like this:
    Code:
    	.langbar {
    		font-size:12px;
    		text-align:right;
    		}
    I have a language bar like this: "ENG | DE | NO" , and I want it to go in the upper right of the site (in the banner). So I placed the following code inside the banner like this:
    Code:
    <div id="banner">
        <span class="langbar"><a href="?locale=en_US">ENG</a> |
        <a href="?locale=de_DE">DE</a> |
        <a href="?locale=nb_NO">NO</a></span>
        </div>
    The browser respects the "font-size", but it ignores the "text-align", and I think it's because it's all inside a div tag. But how can I align the text the way I want?
    I don't want to go back to using tables for layout, because I like the "floatyness " of the CSS layout.

    Any advice is very much appreciated :)
  • eWish
    Recognized Expert Contributor
    • Jul 2007
    • 973

    #2
    Give this a shot.

    Code:
    <div id='banner'>
    	<div class='langbar'>
    		   <a href="?locale=en_US">ENG</a> |
       		<a href="?locale=de_DE">DE</a> |
       		<a href="?locale=nb_NO">NO</a>
        </div>
    </div>

    --Kevin

    Comment

    • JamieHowarth0
      Recognized Expert Contributor
      • May 2007
      • 537

      #3
      Once you've edited your code as per Kevin's suggestion, add this too:

      Code:
      .langbar {
                  font-size:12px;
                  text-align:right;
                  float:right;
                  }
      Hope it helps!

      codegecko

      Comment

      • David Laakso
        Recognized Expert Contributor
        • Aug 2008
        • 397

        #4
        I doubt the float is needed but it will not hurt. The validator is gonna love Glish's doctype. And the gentlepeople who still use the world's most popular browsers are gonna love glish's outdated hacks; and, jumping through hoops to scale his frozen mousetye.

        Comment

        • hgeithus
          New Member
          • Oct 2008
          • 20

          #5
          Thank you. :)
          Worked out nicely.

          Comment

          Working...