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.

HTML Forum


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



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Span and Style simple question
Old 04-20-2010, 04:56 PM Span and Style simple question
Average Talker

Posts: 21
Trades: 0
I want the word "WEST" to the the left side of the window and word "EAST" on the right side, with both words on the same line. Seems like the code should be...
Code:
<html>

	<head>
		<title></title>
	</head>
	<body>
<span style="text-align:left;">WEST</span><span style="text-align:right;">EAST</span>

	</body>
</html>
But they appear as "WESTEAST" on the left side.
Obviously I have not learned much about css.
jimandy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-20-2010, 05:27 PM Re: Span and Style simple question
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
A <span> is an inline element and as such only takes up the space of it's contents, so even though it may well be aligning the text as styled you will not be able to tell.

Put the two spans in a container.

"east" need to first in the container and floated right and "west" will occupy it's natural position on the left.
__________________
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 04-20-2010, 06:18 PM Re: Span and Style simple question
Average Talker

Posts: 21
Trades: 0
Do you mean like this?
<p><span style="text-align:right;">EAST</span>WEST</p>

That doesn't seem to work. Could you give me an example?
jimandy is offline
Reply With Quote
View Public Profile
 
Old 04-20-2010, 06:55 PM Re: Span and Style simple question
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
FLOAT not text-align.

HTML Code:
<div>
<span style="float:right;>East</span>
<span>West</span>
</div>
__________________
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 04-21-2010, 10:22 AM Re: Span and Style simple question
Average Talker

Posts: 21
Trades: 0
Thanks Chris. Your example worked fine. I did need to add a closing quote after the semicolon for it to work in Safari (Mac OS). i.e. "float:right;". FireFox was more forgiving.
jimandy is offline
Reply With Quote
View Public Profile
 
Old 04-21-2010, 10:29 AM Re: Span and Style simple question
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
I did need to add a closing quote
I'll blame the battery in my keyboard for missing the odd keypress
__________________
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 04-23-2010, 06:51 PM Re: Span and Style simple question
Bompa's Avatar
Extreme Talker

Posts: 225
Location: The Philippine Islands
Trades: 0
wow, I had almost exact same problem last week, now I know how to fix it. I should
come in this forum more often and get my head out of code and seo.

thanks chris,
Bompa
__________________

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


Please login or register to view this content. Registration is FREE
Bompa is offline
Reply With Quote
View Public Profile Visit Bompa's homepage!
 
Reply     « Reply to Span and Style simple question
 

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.52578 seconds with 12 queries