CSS and line feed help....

D

Domestos

I know quite a bit of HTML and CSS but have got stuck on one paticular
problem...

I need to use CSS to put text links across the screen i.e. HOME, PLAYERS,
REGISTER etc...

now if I am on the home page I want the background colour to change from
white to say red behind the HOME text.

I can get it to do this by sticking in <DIV> tags but that then makes
PLAYERS and REGISTER appear lower down the page rather than next to HOME

Is there anyway I can use CSS to create the text on one line i.e. not throw
a line feed?

Thanks
Andy Mak
 
A

Animesh Kumar

Domestos said:
I know quite a bit of HTML and CSS but have got stuck on one paticular
problem...

I need to use CSS to put text links across the screen i.e. HOME, PLAYERS,
REGISTER etc...

now if I am on the home page I want the background colour to change from
white to say red behind the HOME text.

I can get it to do this by sticking in <DIV> tags but that then makes
PLAYERS and REGISTER appear lower down the page rather than next to HOME

Is there anyway I can use CSS to create the text on one line i.e. not throw
a line feed?

Thanks
Andy Mak

It seems you want "inline" list of hyperlinks. If that is the case, you
may want to look here:

http://www.alistapart.com/articles/slidingdoors/

Best
A

PS: They have links to other good articles as well. You don't have to
implement that stuff in gory detail unless you want something very
sophisticated in looks.
 
S

Stuart J. Shillinglaw

Domestos said:
Is there anyway I can use CSS to create the text on one line i.e. not
throw a line feed?


I remember reading a post one time about using a series of span tags and
using css to increase the space of each span, although I cannot remember
the details.
 
J

Jonathan N. Little

Domestos said:
I know quite a bit of HTML and CSS but have got stuck on one paticular
problem...

I need to use CSS to put text links across the screen i.e. HOME, PLAYERS,
REGISTER etc...

now if I am on the home page I want the background colour to change from
white to say red behind the HOME text.

I can get it to do this by sticking in <DIV> tags but that then makes
PLAYERS and REGISTER appear lower down the page rather than next to HOME

Is there anyway I can use CSS to create the text on one line i.e. not throw
a line feed?

Thanks
Andy Mak
<DIV> are 'block' elements by default, e.g., they break the line at
their termination. The native inline tag is <SPAN>.
 
M

Mitja

I need to use CSS to put text links across the screen i.e. HOME, PLAYERS,
REGISTER etc...

Have a look at alistapart.com as Animesh suggested, especially the "taming
lists" and the beginning of "sliding doors of css" article.

Taking a more low-level, do-it-yourself approach, have a look at the
"float" css property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top