473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

OL list with bold LI?

Hi,
I would like to have a OL list, that is "ordinary" in other aspect
except this:

Since every <LI> will have more than 2 lines of text, I like to make
the first line bold (kind of sub header :-) where I like to have the
number bold also. All other lines within the same LI is to be normal
text, with the closing </LI> in the end of last line.

Now, getting the first line text bold is no problem :-)
But I can't find a valid way (for XHTML 1.1) to make the numbers in
that list bold. Do somebody know how to do it, if it is possible?

TIA

--
/Arne

Jul 20 '05 #1
6 21710
Arne wrote:
Since every <LI> will have more than 2 lines of text, I like to make
the first line bold (kind of sub header :-) where I like to have the
number bold also. All other lines within the same LI is to be normal
text, with the closing </LI> in the end of last line.
Url?
I can't find a valid way (for XHTML 1.1) to make the numbers in
that list bold.


Without knowing the code, I can only suggest a possibility:

<STYLE TYPE="text/css">
ol {font-weight: bold ;}
ol li div {font-weight: normal ;}
</STYLE>

<BODY>
<ol>
<li>
here lies item 1, line 1
<div>here lies item 1 line 2</div>
</li>
<li>
here lies item 2, line 1
<div>here lies item 2 line 2</div>
</li>
</ol>

</BODY>

Tested in Moz 1.6, IE/Win 5.5, O 7.23.

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #2

Brian wrote:
Arne wrote:

Since every <LI> will have more than 2 lines of text, I like to make
the first line bold (kind of sub header :-) where I like to have the
number bold also. All other lines within the same LI is to be normal
text, with the closing </LI> in the end of last line.

Url?

I can't find a valid way (for XHTML 1.1) to make the numbers in
that list bold.

Without knowing the code, I can only suggest a possibility:

<STYLE TYPE="text/css">
ol {font-weight: bold ;}
ol li div {font-weight: normal ;}
</STYLE>

<BODY>
<ol>
<li>
here lies item 1, line 1
<div>here lies item 1 line 2</div>
</li>
<li>
here lies item 2, line 1
<div>here lies item 2 line 2</div>
</li>
</ol>

</BODY>

Tested in Moz 1.6, IE/Win 5.5, O 7.23.


Of cause, even a simple solution is hard to find sometime! I now
compare my self with the professor who search for his glasses when he
had them on the forhead :-)

Thank's Brian!

--
/Arne

Jul 20 '05 #3
*Arne* <ar********@telia.com>:

Since every <LI> will have more than 2 lines of text, I like to make
the first line bold (kind of sub header :-) where I like to have the
number bold also. All other lines within the same LI is to be normal
text, with the closing </LI> in the end of last line.
You're sure you don't want

dl {counter-reset: def;}
dt:before {content: counter(def) ". "; counter-increment: def;}
dt {font-weight: bolder;}

<dl>
<dt>Bold Foo</dt>
<dd>Normal Bar</dd>
...
</dl>?
Now, getting the first line text bold is no problem :-)
li:first-line {font-weight: bolder;}
But I can't find a valid way (for XHTML 1.1)
Say, you're maintaining two versions (HTML 4.01 and XHTML 1.1)?
to make the numbers in that list bold.


List markers are a bit badly or underdefined in CSS2. In CSS3

li::marker {font-weight: bolder;}

would do. Maybe

ul, ol {font-weight: bold;}
li {font-weight: lighter;}

helps.

--
"When a thing has been said and well, have no scruple. Take it and copy it."
Anatole France
Jul 20 '05 #4

Christoph Paeper wrote:
*Arne* <ar********@telia.com>:
Since every <LI> will have more than 2 lines of text, I like to make
the first line bold (kind of sub header :-) where I like to have the
number bold also. All other lines within the same LI is to be normal
text, with the closing </LI> in the end of last line.

You're sure you don't want

dl {counter-reset: def;}
dt:before {content: counter(def) ". "; counter-increment: def;}
dt {font-weight: bolder;}

<dl>
<dt>Bold Foo</dt>
<dd>Normal Bar</dd>
...
</dl>?


Interesting. Hav'nt seen definition list used that way before.

Say, you're maintaining two versions (HTML 4.01 and XHTML 1.1)?
I'm not sure what you mean. The question was for a XHTML page I'm just
"playing around" with so far, as I trying to learn more about that and
CSS. "Officially" I still do HTML 4.01 sites. :-)
to make the numbers in that list bold.

List markers are a bit badly or underdefined in CSS2. In CSS3

li::marker {font-weight: bolder;}


Just what I was wondering about! But not even Mozilla 1.7 supports it?
would do. Maybe

ul, ol {font-weight: bold;}
li {font-weight: lighter;}

helps.


I used what Brian suggested and it works just like wanted, and also
validate. So I'm happy :-)

Thank's for replying!

--
/Arne

Jul 20 '05 #5
Arne wrote:
Since every <LI> will have more than 2 lines of text, I like to make
the first line bold (kind of sub header :-) where I like to have the
number bold also. All other lines within the same LI is to be normal
text, with the closing </LI> in the end of last line.

Now, getting the first line text bold is no problem :-)
But I can't find a valid way (for XHTML 1.1) to make the numbers in
that list bold. Do somebody know how to do it, if it is possible?


This is worth a shot:

ol { font-weight: bold; }
ol li:first-line { font-weight: bold; }
ol li { font-weight: normal; }

--
Shawn K. Quinn
Jul 20 '05 #6
Shawn K. Quinn wrote:
This is worth a shot:

ol li:first-line { font-weight: bold; }


Careful with that one. Mozilla is quite buggy when :first-line is
combined in some way with :link:hover, iirc.

See bug 177539 in Moz/Bugzilla.

http://bugzilla.mozilla.org/

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Wilhelm Kutting | last post by:
Hello i have the following Unordered List with the shown stylesheet definiton (out of mambo cms). What i like to have is that page 3 is shown with circle-full.gif but that didn't work out. Can...
1
by: Sachin | last post by:
How to get the list of installed fonts corresponding to any perticular charactor set? eg. if I want to get Japanese supporting font list (corresponding to char set Shift_JIS), how to do it? please...
0
by: BigAde | last post by:
I'm having problems with the DDL in the datalist below when adding an item. The list binds properly and lists the correct values (up to about 350). The code successfully finds a ddl and...
2
by: genojoe | last post by:
Is it possible to include one line of bold text followed by one line of regular text in the MsgBox control? What I would like to see is the following lines <Bold>The text you entered isn't an...
13
by: deko | last post by:
http://www.liarsscourge.com/ewpi.html The list numbers should be formatted as <h3>, but other text within the <li> should be normal text. <ol> <li> <h3 id="d2">Download latest WordPress...
5
by: donpro | last post by:
https://testbed.odysseyshipping.com/ 1. If you do a "View Source", you'll see that there are 4 unordered lists in the footer yet they are not displaying in the browser (Firefox or IE). Why? ...
1
by: somsom | last post by:
I have one list and one string from database like "email update daily".Now if list contain any word which is in string that word should be bold displayed.for example if list contain update so the...
0
by: saijin | last post by:
I'm planning to call a list of data from an XML file but when I duplicate the content inside the <data></data> it is not showing anything Here's the ActionScript 3.0 import...
0
by: Guilherme Polo | last post by:
On Thu, Sep 18, 2008 at 1:06 PM, April Lekin <lekin2@llnl.govwrote: Yes. You could separate them in two labels (if you are using labels), or apply a different tag if you are using a Text...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.