Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

font-weight in list 2

Status
Not open for further replies.

ClulessChris

IS-IT--Management
Jan 27, 2003
890
GB
If using a DL with the rule:
dt{
font-weight: bold;
}

And the mark-up:
<dl>
<dt>1994 </dt> Attended World Championships
<dd>Gold Medal Men's Hevyweight Divison</dd>
<dd>Bronze Medal Team Divison</dd>
</dl>

I get the output:
1994 Attended World Championships
Gold Medal Men's Hevyweight Divison
Bronze Medal Team Divison

how can I get this to embolden only the year like this:
1994 Attended World Championships
Gold Medal Men's Hevyweight Divison
Bronze Medal Team Divison


Never knock on Death's door: ring the bell and run away! Death really hates that!
 
Your </dt> is probably at the end of the line, not after the year, because you should end up with;
1994
Attended World Championships
Gold Medal Men's Hevyweight Divison
Bronze Medal Team Divison

because <dt></dt> is a block element.

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Chris,
Thanks for your responce but the markup is as posted.

can you suggest a way to achive the output required, without formating tags in the markup?

Never knock on Death's door: ring the bell and run away! Death really hates that!
 
Your markup, if it is as posted, is invalid. This may cause what you see.

Code:
<dl>
<dt>1994 </dt> Attended World Championships
<dd>Gold Medal Men's Hevyweight Divison</dd>
<dd>Bronze Medal Team Divison</dd>
</dl>

The "Attended World Championships" bit is not marked as anything and should, perhaps, be within a <dd>.



--
Tek-Tips Forums is Member Supported. Click Here to donate

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.


 
Foamcow
Thanks, I was hopeing to place that line outside the list tags and thus keep it on the same line as the year but without the text formating. It seems that this is not possible without formatting within the markup.

Please stick with me I'm very new to css and only have passing familiarity of html, but learning is fun.
Thanks to you both for your help.

Never knock on Death's door: ring the bell and run away! Death really hates that!
 
You will have to apply additional formatting to the year. That is the only way you can apply different formatting to the year and expect it to work across different browsers.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
I would use something like

Code:
<h2>Name of Sports Person</h2>
<dl>
<dt<span>Year:</span> Attended World Championships</dt>
<dd>Gold Medal Men's Heavyweight Division</dd>
<dd>Bronze Medal Team Division</dd>

<dt<span>Year:</span> More Details</dt>
<dd>Information</dd>
<dd>Information</dd>

</dl>

CSS:
Code:
dt span {
   font-weight:bold;
}
[code]
so only a <span> inside of a <dt> will be in bold.

Chris.

Indifference will be the downfall of mankind, but who cares?
[url=www.candsdesign.co.uk/]Woo Hoo! the cobblers kids get new shoes.[/url]
[url=www.cram-system.com/]People Counting Systems[/url]

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top