473,405 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

My text won't align to the right

hgeithus
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:
Expand|Select|Wrap|Line Numbers
  1.     .langbar {
  2.         font-size:12px;
  3.         text-align:right;
  4.         }
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:
Expand|Select|Wrap|Line Numbers
  1. <div id="banner">
  2.     <span class="langbar"><a href="?locale=en_US">ENG</a> |
  3.     <a href="?locale=de_DE">DE</a> |
  4.     <a href="?locale=nb_NO">NO</a></span>
  5.     </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 :)
Nov 3 '08 #1
4 8180
eWish
971 Expert 512MB
Give this a shot.

Expand|Select|Wrap|Line Numbers
  1. <div id='banner'>
  2.     <div class='langbar'>
  3.            <a href="?locale=en_US">ENG</a> |
  4.            <a href="?locale=de_DE">DE</a> |
  5.            <a href="?locale=nb_NO">NO</a>
  6.     </div>
  7. </div>

--Kevin
Nov 3 '08 #2
JamieHowarth0
533 Expert 512MB
Once you've edited your code as per Kevin's suggestion, add this too:

Expand|Select|Wrap|Line Numbers
  1. .langbar {
  2.             font-size:12px;
  3.             text-align:right;
  4.             float:right;
  5.             }
  6.  
Hope it helps!

codegecko
Nov 3 '08 #3
David Laakso
397 Expert 256MB
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.
Nov 3 '08 #4
Thank you. :)
Worked out nicely.
Nov 29 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Phil Powell | last post by:
Code: <!-- script src="/js/val_header.js"></script --> <style> <!-- BODY { scrollbar-3d-light-color:#eeeedd; scrollbar-arrow-color:#000000; scrollbar-base-color:#000000;...
12
by: Ted Mencini | last post by:
When I replaced older <IMG ALIGN=RIGHT ...> tags with a CSS definition <IMG class=right ...> xxx.css: IMG.right { BORDER: 0; align: right } I notice that the effect is NOT the same....
8
by: André Hänsel | last post by:
Hi! When I put a table into a table and try to align it right, it works in IE but not in Firefox. Simplest code to reproduce: <html> <body> <table style="width: 100%"> <tr>
1
by: Astra | last post by:
Hi All This has been bugging me for months and I just can't my finger on why it won't work in Safari/FireFox (IE lets me off cos it's nice liek that). In essence, the offending code is as...
6
by: tshad | last post by:
I have a cell with 2 items in it: a textbox and a link. The link is actually a button (image), but for the example I am using a link, which is doing the same thing. Here is the stripped down...
3
by: Sjef Janssen | last post by:
Is it possible to have a box (div) which sets a background-color and which contains (on the same line) text which is left aligned and text which is right aligned. (as in a table: two td's left one...
4
by: Jason | last post by:
Is that possible? How? <td > <asp:Label ID="StartDateLabel" runat="server" Text="Start Date:"> <asp:imagebutton ID="Imagebutton1" width=18 Height=18 CommandName=SetDate imageUrl="../cal.jpg"...
4
by: Bjorn Sagbakken | last post by:
With .NET 2.0: Is there a way to right align the text in a textbox? The task is to edit numbers in a table-column, and it looks kind of silly with the numbers left-aligned. A label respond to...
9
miche002
by: miche002 | last post by:
Heya I am trying to design a simple site. I would do it in css but don't have the time to learn and have spent too much time already trying to learn. The link is my site control U to get the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.