473,378 Members | 1,444 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,378 software developers and data experts.

Positioning text to the left and the right in one line

Hello list,

I'm trying to create a list of items with price tags.
The visual appearance I want to achieve is that the description should be
aligned to the left, wether the price should be aligned to the right.

This ist the HTML code I used:

<div id="test">
<ul>
<li>Item, with description <strong>0.99$</strong></li>
<li>Item, with deption <strong>1.20$</strong></li>
<li>Item, on <strong>1.99$</strong></li>
</ul>
</div>
These are the sytyle definitions I used:

#test { margin-bottom:1em; }
#test ul {
width:auto;
margin:0;
padding:0;
}
#test ul li {
width:auto;
list-style:none;
border:1px dashed #44f;
margin-bottom:0.5em;
}
#test ul li strong {
width:5em;
text-align:right;
float:right;
border:1px dashed #f44;
}
You can see an example page here:
http://www.sven-rudolph.de/test/test
I tested this page with Konqueror-3.4, FireFox-1.0.4 (Linux), Opera-8.0
(Linux), IE6.
Unfortunately this doesn't work the way I want it to in some of them.
Konqueror and Opera seem to share my opinion on how this page should look
like (see the Screenshots):
http://www.sven-rudolph.de/test/pt-konqueror-3.4.png (6kB)
http://www.sven-rudolph.de/test/pt-opera-8.0.png (5kB)

IE6 puts the price to the next line (see the Screenshot):
http://www.sven-rudolph.de/test/pt-ie6.png (8kB)

Firefox has a completely different opinion (see the Screenshot):
http://www.sven-rudolph.de/test/pt-firefox-1.0.4.png (6kB)
Firefox is the browser I trust the most, but in this case I'm absolutely not
sure which browser is right and which one is wrong. Konqueror and Opera
display the lines the way I want them to. IE6 and Firefox don't.
What I need is a solution that looks the same in all of them.

http://validator.w3.org/ and
http://jigsaw.w3.org/css-validator/validator-uri.html don't complain about
the code.
Sorry if this is a FAQ.
I'm quite certain that this has allready been solved by someone and that I'm
not far from the solution, but at this moment I'm out of ideas.
Can anybody help me with this?

Thanks in advance
Sven Rudolph

Jul 21 '05 #1
3 2040
Sven Rudolph <ne**@sven-rudolph.de> wrote:
I'm trying to create a list of items with price tags.
That's tabular data, not a list.
The visual appearance I want to achieve is that the description should be
aligned to the left, wether the price should be aligned to the right.


Easy when you use the appropriate markup.

--
Spartanicus
Jul 21 '05 #2
Spartanicus wrote:
Sven Rudolph <ne**@sven-rudolph.de> wrote:
I'm trying to create a list of items with price tags.


That's tabular data, not a list.


That's definitely a good point :-)
I was so focused on the style definitions, that i forgot to think about the
markup.

The visual appearance I want to achieve is that the description should be
aligned to the left, wether the price should be aligned to the right.


Easy when you use the appropriate markup.


ACK
But I'm still interested if and how it is possible to do it with my
approach.
Thanks a lot!
Sven Rudolph

Jul 21 '05 #3
Sven Rudolph <ne**@sven-rudolph.de> wrote:
The visual appearance I want to achieve is that the description should be
aligned to the left, wether the price should be aligned to the right.


Easy when you use the appropriate markup.


ACK
But I'm still interested if and how it is possible to do it with my
approach.


http://www.spartanicus.utvinternet.i..._using_css.htm

--
Spartanicus
Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Bryan R. Meyer | last post by:
Hello Everyone, The problem of browser resizing has become an issue for me. While redesigning my webpage, I set the left and right margins to be auto so that my content would be centered. ...
10
by: Cezary | last post by:
Hi Folks! I wrote this below code and I want to get this effect: 727px] ] but, there must be some errors. Please give me some advices. Regards,
1
by: Charles Harrison Caudill | last post by:
with tables there is a clean and algorithmic way to organize things, but with css which is, once you get it working, much cleaner, I have to tweak and patch and hope and pray and curse before...
2
by: nonsensitor | last post by:
I'm just learning xhtml & css, primarily from westciv's online tutorials and css guide. I've run into a couple of problems with a page I'm developing that I can't figure out. The first problem is...
5
by: Howard | last post by:
I have seen a lot of examples of 2 & 3 Collumn layout schemes. But I have not yet found any examples for positioning images and centering them by the browser. I notice that there are CSS...
8
by: Woodchuck | last post by:
Hi:) I've been trying to position some element's on my page and I can't come up with a way to equally position 4 DIV's in another DIV without explicitly setting the width of the "child" DIV's....
3
by: mikewse | last post by:
I have a strange problem where it seems IE is doing the correct layout but Firefox and Safari isn't. I think I'm probably wrong, and there is something in the standards that say behaviour should be...
2
by: Bouzy | last post by:
I have been trying to make some very basic forms. Everything I think should work once I get it on my server, but it looks like crap. I know you are supposed to use tables for an easy way to position....
2
by: Slick50 | last post by:
I am about ready to finally give up on CSS and fall back to tables. Positioning is becoming too frustrating for the novice with CSS alone... I have a simple form. Conceptually I divide up each...
14
by: Fistro | last post by:
I'm trying to find a design that would allow me to build web pages without having to worry about compatibility issues (not too much, in any case,,,) I've came across this CSS layout technique:...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.