![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Firefox uses padding on <ul>/<ol> anyway, many other browsers use margin (margin is suggested in CSS 2.1 Appendix D). You need padding for this to work since overflow: hidden brings the left _border_ edge of the ul>'s principal block box to the right of the float, not its left margin edge. |
#3
| |||
| |||
|
|
Please take a look at http://www.gavelcade.com/list_next_to_float.html How can I style a list so that if it appears next to a left-floated box as the first list does in this example, the list items, with their bullets, still appear indented relative to the text above and below the list (i.e., without having the bullets overlapping the float), without messing up the appearance if the list *doesn't* happen to land next to the float, as in the case of the second list? |
#4
| |||
| |||
|
|
On 2007-10-26, Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote: Please take a look at http://www.gavelcade.com/list_next_to_float.html How can I style a list so that if it appears next to a left-floated box as the first list does in this example, the list items, with their bullets, still appear indented relative to the text above and below the list (i.e., without having the bullets overlapping the float), without messing up the appearance if the list *doesn't* happen to land next to the float, as in the case of the second list? You can bring the whole list, including bullets, neatly to the right of the float with: { overflow: hidden; /* to start new block formatting context */ margin-left: 0; padding-left: 40px; } on the <ul>, which won't do any harm if it isn't to the right of a float. |
#5
| |||
| |||
|
|
Ben C wrote: On 2007-10-26, Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote: Please take a look at http://www.gavelcade.com/list_next_to_float.html |
#6
| |||
| |||
|
|
In article <5of98uFmpei8U1 (AT) mid (DOT) individual.net>, Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote: Ben C wrote: On 2007-10-26, Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote: Please take a look at http://www.gavelcade.com/list_next_to_float.html The most curious thing, although there are different renderings across different browsers, especially in regard to the bullets, in Safari alone, the styles are off. There is no blue float. Safari alone is not tolerant to your missing closing curly bracket on the styles in the head. Yes, I found that and closed it on my local version before I posted the |
#7
| |||
| |||
|
|
Ben C wrote: On 2007-10-26, Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote: Please take a look at http://www.gavelcade.com/list_next_to_float.html How can I style a list so that if it appears next to a left-floated box as the first list does in this example, the list items, with their bullets, still appear indented relative to the text above and below the list (i.e., without having the bullets overlapping the float), without messing up the appearance if the list *doesn't* happen to land next to the float, as in the case of the second list? You can bring the whole list, including bullets, neatly to the right of the float with: { overflow: hidden; /* to start new block formatting context */ margin-left: 0; padding-left: 40px; } on the <ul>, which won't do any harm if it isn't to the right of a float. Thanks so much for this. I understand the caveat about the list being only partially next to the float! Answer: good only for short lists. |
|
I gotta go back and read what overflow: hidden really means. It's more involved than I had expected. |
#8
| |||
| |||
|
|
li>€ List item 1</li li>€ List item 2</li Using Option 8 for the dot on a Mac produces very nice results, that look pretty consistent with your list further down which has real html bullets. There is perhaps something more dependable? |
![]() |
| Thread Tools | |
| Display Modes | |
| |