Different text formats on same line
Can anyone tell me how to place text of different formats on the same line without making a separate DIV for each element? I am using CSS2; specifically, I am trying to put several hyperlinks and some additional text on the same line but am having problems. Thanks.
Abhishek Reddy posted this at 05:46 — 19th March 2004.
He has: 3,348 posts
Joined: Jul 2001
Do you have an example I could look at?
Try using clear: none, but I'm not sure of the exact nature of the problem.
webspinner posted this at 06:27 — 19th March 2004.
They have: 7 posts
Joined: Mar 2004
An example would be, say you had some information to present to the user in three different forms: text, audio and video. Say you want to show a hyperlink for each media form followed by a title all on the same line. The HTML might look something like:
TEXT
AUDIO
VIDEO
Information
which I have tried; the hyperlinks all show up fine all on the same line; however, the last test item is on the next line. Any ideas? Thanks.
Abhishek Reddy posted this at 06:56 — 19th March 2004.
He has: 3,348 posts
Joined: Jul 2001
Ah, try setting the clear: none property as well as display: inline on the h5. I can't recall straight away if you need to use floats or not... but try the above first.
Suzanne posted this at 16:44 — 19th March 2004.
She has: 5,507 posts
Joined: Feb 2000
Okay, why on earth are you doing it that way?
is a Heading. If you want your headings inline, that's fine, but don't use a heading element to make things small.
Hyperlinks are inline elements, so they need to be inside a block level element.
Assuming you're using
correctly, you should have this:
<h5>
<span class="options">
<a href="info.pdf">TEXT</a>
<a href="info.mp3">AUDIO</a>
<a href="info.avi">VIDEO</a>
</span>
Information
</h5>
Even that's not quite semantic, however it's closer and will do what you want.
webspinner posted this at 18:02 — 19th March 2004.
They have: 7 posts
Joined: Mar 2004
Thanks for all the suggestions; I did get everything laid out the way I wanted.
andy206uk posted this at 13:20 — 22nd March 2004.
He has: 1,758 posts
Joined: Jul 2002
I thought putting hyperlinks inside tags was against the w3 guidelines? I swear I read that somewhere...
webspinner posted this at 14:38 — 22nd March 2004.
They have: 7 posts
Joined: Mar 2004
Using in my example was a bad choice on my part; I'm actually using . Thanks.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.