HighDots Forums  

inline text-align right in css?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss inline text-align right in css? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ivowel
 
Posts: n/a

Default inline text-align right in css? - 12-12-2007 , 12:58 PM







dear css experts:

is it possible to define css so that it looks as if it is a table of
contents?

text . . . . . . . . . . . Page 49

from something like

<div class="tocline"> <span class="header">text</span> <span
class="page">Page 49</span> </div>

I would love the leading dots, but I would be happy just to find out
how to position all page numbers *on the right margin*. help
appreciated.

PS: one could perhaps use a table to always align the page right, but
because I have different partitions on the left-side, this would be
rather ugly rather fast.

sincerely,

/iaw

Reply With Quote
  #2  
Old   
Gus Richter
 
Posts: n/a

Default Re: inline text-align right in css? - 12-12-2007 , 03:44 PM






Jonathan N. Little wrote:
Quote:
Data could be a table, or maybe a list. Here is a list example.
Or it could be simply <span>
Your working example uses position:absolute
This one uses position:relative

<style type="text/css">
..menuitem {
border-bottom: dotted 1px black;
text-align: right;
}
..name {
background: white;
float: left;
margin-top: 3px;
}
..price {
background: white;
position: relative;
top: 3px;
}
</style>
</head>
<body>
<h1>Using Position Relative</h1>

<div class="menuitem">
<span class="name">Steak Diane</span>
<span class="price">15.00</span>
</div>
</body>

--
Gus


Reply With Quote
  #3  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: inline text-align right in css? - 12-12-2007 , 04:29 PM



Gus Richter wrote:
Quote:
Jonathan N. Little wrote:

Data could be a table, or maybe a list. Here is a list example.

Or it could be simply <span
Your working example uses position:absolute
This one uses position:relative

style type="text/css"
.menuitem {
border-bottom: dotted 1px black;
text-align: right;
}
.name {
background: white;
float: left;
margin-top: 3px;
}
.price {
background: white;
position: relative;
top: 3px;
}
/style
/head
body
h1>Using Position Relative</h1

div class="menuitem"
span class="name">Steak Diane</span
span class="price">15.00</span
/div
/body

You need to add "clear: left;" to ".menuitem" if you want more than on
item. I just though it made more semantic sense being a list than divs

ul.menu {
list-style: none; margin: 0; padding: 0;
}
ul.menu il {
border-bottom: dotted 1px black;
text-align: right;
clear: left;
}
..name {
background: white;
float: left;
margin-top: 3px;
}
..price {
background: white;
position: relative;
top: 3px;
}

<ul class="menu">
<li>
<span class="name">Steak Diane</span>
<span class="price">15.00</span>
</li>
<li>
<span class="name">Steak Diane</span>
<span class="price">15.00</span>
</li>
</ul>


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
  #4  
Old   
Gus Richter
 
Posts: n/a

Default Re: inline text-align right in css? - 12-12-2007 , 07:55 PM



Jonathan N. Little wrote:
Quote:
Gus Richter wrote:
Jonathan N. Little wrote:

Data could be a table, or maybe a list. Here is a list example.

Or it could be simply <span
Your working example uses position:absolute
This one uses position:relative

You need to add "clear: left;" to ".menuitem" if you want more than on
item. I just though it made more semantic sense being a list than divs

Yes. Just another way to skin a cat. Whichever way works for you.
I believe that Rijk van Geijtenbeek submitted it some time back.

--
Gus


Reply With Quote
  #5  
Old   
ivowel
 
Posts: n/a

Default Re: inline text-align right in css? - 12-13-2007 , 01:35 PM




Beautiful. Thank you very much. css is an art!

regards,

/ivo

Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.