Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Questions About Text Formatting
Old 09-27-2008, 12:07 PM Questions About Text Formatting
Skilled Talker

Posts: 66
Trades: 0
Okay I have a new question for the experts.

Let's say that in my text, I want to put in something like a price list that looks like (without the dots):

Now is the time for all good men to come to the aid of their country. Now is the time for all good men to come to the aid of their country. Now is the time for all good men to come to the aid of their country. Now is the time for all good men to come to the aid of their country.

Item #1 . . . . . . . . . . . . . . $4.99

Item #2 . . . . . . . . . . . . . . $5.99

Item #3 . . . . . . . . . . . . . . $6.99



I've done some searching and can't really find anything on how to do this. Is it possible to do this without using a "list"?

With my limited knowledge, I tried something along the lines of:

.new2 {
color: rgb(254,251,154);
font-weight: bold;
}
.new3 {
padding-left: 20.0em;
color: rgb(254,251,154);
font-weight: bold;
}


<span class="new2">Item #1</span> <span class="new3"> $4.99</span>

<span class="new2">Item #2</span> <span class="new3"> $5.99</span>

<span class="new2">Item #3</span> <span class="new3"> $6.99</span>



While this does somewhat work, it does not line up the dollar amount to the right like I would have hoped. Do I need a seperate "class" for each line with the margin adjusted as needed for proper alignment?

Am I close to having this right or is there a better way of doing it?

Thanks for any help,
JustAGuy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-27-2008, 12:15 PM Re: Questions About Text Formatting
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
<div class="container">
ItemRef
<div class="price">£2.50</div>
</div>

clear:both on container
text-align:left;float:right on price

size them to suit
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-27-2008, 12:31 PM Re: Questions About Text Formatting
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Try using a definition list for something like that. You could have something like this:

Quote:
<dl>
<dt>T-Shirts</dt>
<dd class="item">Mens</dd>
<dd class="price">$7.99</dd>
<dd class="item">Womens</dd>
<dd class="price">$8.99</dd>
<dd class="item">Kids</dd>
<dd class="price">$4.99</dd>

CSS:
dl{
margin: 10px 5px 10px 30px;
width: 200px;
overflow: auto;
}

dt{
margin: 5px 0px;
clear: both;
}

dd.price{
float: right;
margin: 0;
padding: 0;

}

dd.item{
clear: both;
float: left;
margin-left: 10px;

}

__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Questions About Text Formatting
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21352 seconds with 12 queries