| | |
Style for just numbers in ol lists
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
It's not pretty nor creative but is Valid XHTML 1.0 Strict:
html Syntax (Toggle Plain Text)
<ol> <li style="font-size:24px"> <span style="font-size:12px">This text is 12px. The bullet number is 24px.</span> </li> <li> <span style="font-size:12px">This text is 12px. The bullet number is 12px.</span> </li> </ol>
Last edited by buddylee17; Apr 12th, 2008 at 2:56 pm.
•
•
Join Date: Feb 2005
Posts: 427
Reputation:
Solved Threads: 12
There may be a solution, but I can almsot gaurentee that it will only work on a few browsers!
Sometimes life holds wonderful suprises - shame I sleep through them all.
http://www.choose-easyweb.com - Not my design, nor my idea :)
http://www.choose-easyweb.com - Not my design, nor my idea :)
•
•
Join Date: Feb 2005
Posts: 427
Reputation:
Solved Threads: 12
Okay... you say that you want it to take on the same style as outside the list.
Please tell me you have styling for Paragraphs...????
If so, simply use a Paragraph inside the List (should still be Valid, Semantic etc.), and then, where you haveyou paragraph style, simply follow it with
, ol p
Please tell me you have styling for Paragraphs...????
If so, simply use a Paragraph inside the List (should still be Valid, Semantic etc.), and then, where you haveyou paragraph style, simply follow it with
, ol p
Sometimes life holds wonderful suprises - shame I sleep through them all.
http://www.choose-easyweb.com - Not my design, nor my idea :)
http://www.choose-easyweb.com - Not my design, nor my idea :)
It's not a kludge to have an outer style affect the list ( including the bullets/numbers ) and have an inner style affect the content of items themselves. Use 'relative' styles if possible , e.g use
font-size: 80%; on the outside, font-size: 125%; on the inside. If you have no way to speak 'relatively' e.g. if you're setting font-face for the list and want to restore it within items; plan this from the beginning and make style selectors that summarize and apply properties to the 'outer' body text, and text inside list items. Then use deep, more specific selectors to affect certain lists and their outer areas differently, etc, etc. You may find that it becomes quite less of a problem than you imagine it may be. Plato forgot the nullahedron..
Thanks.
The problem was that I had:
- a master list of several hundred elements
- an h2 title at the top of each list item
- several different kinds of html elements in the different list items (after the h2 titles)
- adding a class to each element other than the li and h2 tags would have been time-prohibitive.
The normal-sized li numbers looked funny beside the large h2 text in the headers. I wanted the li numbers to take the font and size from the h2 tag.
I was converting an old "tag soup" HTML file where someone actually got it to work on most browsers in quirks mode. But the trouble is that it had tangled tags:
Every attempt to validate this and make it render like the old page failed.
I solved it by using these selectors:
The problem was that I had:
- a master list of several hundred elements
- an h2 title at the top of each list item
- several different kinds of html elements in the different list items (after the h2 titles)
- adding a class to each element other than the li and h2 tags would have been time-prohibitive.
The normal-sized li numbers looked funny beside the large h2 text in the headers. I wanted the li numbers to take the font and size from the h2 tag.
I was converting an old "tag soup" HTML file where someone actually got it to work on most browsers in quirks mode. But the trouble is that it had tangled tags:
HTML and CSS Syntax (Toggle Plain Text)
<ol> <h2><li>heading 1</h2> <p>body of list item</p> <h2><li>heading 2</h2> <p>body of list item</p> </ol>
Every attempt to validate this and make it render like the old page failed.
I solved it by using these selectors:
HTML and CSS Syntax (Toggle Plain Text)
body>ol>li {styles} body>ol>li>* {styles} body>ol>li>h2 {styles}
Last edited by MidiMagic; Apr 14th, 2008 at 5:31 pm.
Daylight-saving time uses more gasoline
![]() |
Other Threads in the HTML and CSS Forum
- Previous Thread: Help with Forms
- Next Thread: Page working in IE7/8b, Opera9, Safari3, but NOT Firefox2/3b5
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7






