Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > ul property

Reply
Thread Tools

ul property

 
 
Edwin van der Vaart
Guest
Posts: n/a
 
      09-26-2004
Good day to all,

This sound crazy, but what's the standard css property for the <ul>.
Because I have a menu which I have specified the css for the <ul>, see at
http://www.evandervaart.nl/test/

When I gone use an other <ul> in the content I need to specify the <ul>
with the css.
I tried for the ul {list-style: disc; margin: 1em; padding: 0em 0em 0em
2em; border: 0;}.
When I compare the <ol> and mine <ul> in Firefox, Opera, Galeon (under
Linux/Mandrake 9.2) and Firefox, Opera, IE (under Windows 2000). I see
that there is a little different of 1em margin/padding on the left hand
side.

What is the correct css property (setting) for the <ul>.
--
Edwin van der Vaart
http://www.semi-conductor.nl/ Links to Semiconductors sites
http://www.evandervaart.nl/ Under construction
 
Reply With Quote
 
 
 
 
Neal
Guest
Posts: n/a
 
      09-26-2004
On Sun, 26 Sep 2004 16:56:47 +0200, Edwin van der Vaart
<(E-Mail Removed)> wrote:

> Good day to all,
>
> This sound crazy, but what's the standard css property for the <ul>.


http://www.w3.org/TR/CSS21/sample.html - but of course this is merely
typical.
 
Reply With Quote
 
 
 
 
Edwin van der Vaart
Guest
Posts: n/a
 
      09-26-2004
Neal schreef:
> On Sun, 26 Sep 2004 16:56:47 +0200, Edwin van der Vaart
> <(E-Mail Removed)> wrote:
>
>> Good day to all,
>>
>> This sound crazy, but what's the standard css property for the <ul>.

>
>
> http://www.w3.org/TR/CSS21/sample.html - but of course this is merely
> typical.


So the <ul> have a margin of 1.12em 0 and a margin-left of 40px and no
padding.
Thanx for the uri and info.

Oh,
Did you like the menu?
Does it work ok?
--
Edwin van der Vaart
http://www.semi-conductor.nl/ Links to Semiconductors sites
http://www.evandervaart.nl/ Under construction
 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      09-26-2004
Edwin van der Vaart wrote:

> This sound crazy, but what's the standard css property for the <ul>.


Is crazy. There is no "standard" was of displaying an unordered list.
Different browsers do different things by default. For example, Opera adds
a small vertical margin between list items; other browsers don't.

To be safe:
ul,li{margin:0;padding:0;list-style:disc}

and then add your customisations.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      09-26-2004
Edwin van der Vaart <(E-Mail Removed)> wrote:

>> http://www.w3.org/TR/CSS21/sample.html - but of course this is merely
>> typical.

>
> So the <ul> have a margin of 1.12em 0 and a margin-left of 40px and no
> padding.


You may have missed the "this is merely typical" part.

Browsers are free to implement <ul> elements by default e.g. using some
padding properties and no margins. And even to apply a reasonable left
margin instead of 40px.

But what is your _problem_? Why would you use CSS to make a browser
behave in a manner that it would use without CSS?

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


 
Reply With Quote
 
Edwin van der Vaart
Guest
Posts: n/a
 
      09-27-2004
Jukka K. Korpela schreef:
> Edwin van der Vaart <(E-Mail Removed)> wrote:
>
>
>>>http://www.w3.org/TR/CSS21/sample.html - but of course this is merely
>>>typical.

>>
>>So the <ul> have a margin of 1.12em 0 and a margin-left of 40px and no
>>padding.

>
>
> You may have missed the "this is merely typical" part.
>
> Browsers are free to implement <ul> elements by default e.g. using some
> padding properties and no margins. And even to apply a reasonable left
> margin instead of 40px.
>
> But what is your _problem_? Why would you use CSS to make a browser
> behave in a manner that it would use without CSS?


Well, my problem is that I already specified an unordered list for the menu.
When I would like to use the standard unordered list, then the unordered
list
the same properties as the menu.
See the bottom of the right colomn at:
http://www.evandervaart.nl/test/
--
Edwin van der Vaart
http://www.semi-conductor.nl/ Links to Semiconductors sites
http://www.evandervaart.nl/ Under construction
 
Reply With Quote
 
Edwin van der Vaart
Guest
Posts: n/a
 
      09-27-2004
Toby Inkster schreef:
> Edwin van der Vaart wrote:
>
>
>>This sound crazy, but what's the standard css property for the <ul>.

>
>
> Is crazy. There is no "standard" was of displaying an unordered list.
> Different browsers do different things by default. For example, Opera adds
> a small vertical margin between list items; other browsers don't.


IE adds a small horizontal margin in the <li>.

> To be safe:
> ul,li{margin:0;padding:0;list-style:disc}
>
> and then add your customisations.


Thanx for the tip. I'll customize the unordered list.
--
Edwin van der Vaart
http://www.semi-conductor.nl/ Links to Semiconductors sites
http://www.evandervaart.nl/ Under construction
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      09-27-2004
Edwin van der Vaart <(E-Mail Removed)> wrote:

> Well, my problem is that I already specified an unordered list for
> the menu. When I would like to use the standard unordered list, then
> the unordered list the same properties as the menu.
> See the bottom of the right colomn at:
> http://www.evandervaart.nl/test/


I still don't see the problem - maybe because your example there is so
artificial (no real content).

But if you wish to specify some properties in CSS for one unordered list
only, by not affecting other unordered lists, it's simplest to assign
a class (say <ul class="menu">) and use a class selector (say
ul.menu { ... }) in CSS.

There's generally no way in CSS to "undo" the effects of some CSS rules,
in the sense of saying "use the browser defaults instead". You just need
to avoid specifying the rules as applicable to the elements that should
be left intact; and classes are the simple way.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


 
Reply With Quote
 
Edwin van der Vaart
Guest
Posts: n/a
 
      09-29-2004
Jukka K. Korpela schreef:
> Edwin van der Vaart <(E-Mail Removed)> wrote:
>
>
>>Well, my problem is that I already specified an unordered list for
>>the menu. When I would like to use the standard unordered list, then
>>the unordered list the same properties as the menu.
>>See the bottom of the right colomn at:
>>http://www.evandervaart.nl/test/

>
>
> I still don't see the problem - maybe because your example there is so
> artificial (no real content).


It wasn't artificial. Only I made it artificial as an example to let you
see what I meant.

> But if you wish to specify some properties in CSS for one unordered list
> only, by not affecting other unordered lists, it's simplest to assign
> a class (say <ul class="menu">) and use a class selector (say
> ul.menu { ... }) in CSS.


Yes, I already know that.
I have a javascript, which was looking for a id="nav".
I added class="nav" in the <ul> and changed all the ul properties into
ul.nav.
The problem is solved. Now I can use the standard ul definition.

> There's generally no way in CSS to "undo" the effects of some CSS rules,
> in the sense of saying "use the browser defaults instead". You just need
> to avoid specifying the rules as applicable to the elements that should
> be left intact; and classes are the simple way.


Thanx for the info.
--
Edwin van der Vaart
http://www.semi-conductor.nl/ Links to Semiconductors sites
http://www.evandervaart.nl/ Under construction
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding to property of property of object collection TS ASP .Net 3 08-31-2006 12:57 PM
TableCell: BackColor Property But No BackGround Property? Nathan Sokalski ASP .Net 1 04-29-2006 10:09 PM
DataBinder.Eval for an object's property property... like Eval(Container.DataItem,"Version.Major") Eric Newton ASP .Net 3 04-04-2005 10:11 PM
Set CSS property equal to another CSS property? Noozer HTML 10 10-13-2004 09:20 PM
Is there a way to set the a CSS property to be explicitly the same as another CSS property? Joshua Beall HTML 1 12-10-2003 07:21 PM



Advertisments