473,413 Members | 1,802 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,413 software developers and data experts.

How to overwrite UAs default stylesheet?

Hello!

As CSS2 Sec. 6.4 specifies, UA must apply a default stylesheet. How
should I override it _accordingly_?

Assume nested ULs:

-first
+inner
+still inner
-second
-outer

I want to disable the indentation:

-first
+inner
+still inner
-second
-outer

As the recommended UA default says "margin-left: 40px" I could perfectly
adjust my style to "margin-left: -40px" but how to do that in a browser
independant way??

If I don't know the UA default, I need a possibility to get margin-left
to 0, but I found no way (Mozilla 1.0.0)...
Any ideas?

Robert

Jul 20 '05 #1
3 3118
Robert Siemer <Ro***********@spz.uni-karlsruhe.de> writes:
As CSS2 Sec. 6.4 specifies, UA must apply a default stylesheet. How
should I override it _accordingly_?

As the recommended UA default says "margin-left: 40px" I could
perfectly adjust my style to "margin-left: -40px" but how to do that
in a browser independant way??


They overwrite, not add.

ul,li {
margin-left: 0;
padding-left: 0;
}

You need both ul and li, and both margin and padding, because
different browsers make the indent in different ways by default.

--
Chris
Jul 20 '05 #2
In article <87************@dinopsis.dur.ac.uk>, c.********@durham.ac.uk
says...
Robert Siemer <Ro***********@spz.uni-karlsruhe.de> writes:
As CSS2 Sec. 6.4 specifies, UA must apply a default stylesheet. How
should I override it _accordingly_?
....
ul,li {
margin-left: 0;
padding-left: 0;
}
....

....and if the OP only wants to lose the indentation of the sublist then
eg:

li ul, /* any <ul> inside a <li> */
li li /* any <li> inside a <li> */
{
margin-left: 0;
padding-left: 0;
}

Jul 20 '05 #3
In article <87************@dinopsis.dur.ac.uk>, Chris Morris wrote:
Robert Siemer <Ro***********@spz.uni-karlsruhe.de> writes:
As CSS2 Sec. 6.4 specifies, UA must apply a default stylesheet. How
should I override it _accordingly_?
They overwrite, not add.

ul,li {
margin-left: 0;
padding-left: 0;
}

You need both ul and li, and both margin and padding, because
different browsers make the indent in different ways by default.


But be aware, this makes the bullets go outside document in most
implementations.
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

Jul 20 '05 #4

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

Similar topics

3
by: GlennH | last post by:
Hi folks, I want to use the default behaviour of a browser to display xml in an open / close block style. E.g. you can show or hide the sub elements of an element. But.... The default...
4
by: Lénaïc Huard | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I've some namespace problems when defining default values for attributes. My problem seems to come from the fact that the attributes are...
3
by: Mike Dickens | last post by:
hi, i'm sure this has come up before but havn't managed to find an answer. if i have the following xslt <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet method="xml" version="1.0"...
2
by: Haines Brown | last post by:
I have a list defined in a stylesheet that includes: li.down { list-style-image: url(../bin/arrow-f.png); } <ul> <li class="down">list item text </li> </ul>
1
by: Eric Lindsay | last post by:
I am trying to understand the differences between and uses of persistent, default and alternate styles. I have read http://www.w3.org/TR/REC-html40/present/styles.html section 14.3.2 on...
6
by: dubing | last post by:
Hello everyone, If media is not explicitly specified in link as shown below, what's the default media supposed to be, screen or all? I thought it should be 'all'. <link rel="stylesheet"...
8
by: Alan J. Flavell | last post by:
What I was trying to do: to offer a default stylesheet, plus another small stylesheet which can be applied additionally to the default one. Preferably, the optional stylesheet should be initially...
7
by: Bilal | last post by:
Hello all, I came across this problem while working out the bugs in my identity trasnformation stylesheets but sidestepped it for later to see if there is an easier/better solution. This is...
3
by: Kai Kuehne | last post by:
Hi list! It is possible to overwrite only one function with the property-function? x = property(getx, setx, delx, 'doc') I just want to overwrite setx, but when I set the others to None, I...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.