Bug 130843 - User agent styles overrides custom CSS
Summary: User agent styles overrides custom CSS
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 525.x (Safari 3.2)
Hardware: iPhone / iPad iOS 7.0
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-27 09:52 PDT by webkitsucks
Modified: 2021-12-24 13:37 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description webkitsucks 2014-03-27 09:52:04 PDT
I have an unsorted list in a fixed position header and it seems impossible to override the user agent style. Here's the CSS:

#header {
	position: fixed;
}

#header #nav {
	position: relative;
}

#header #nav ul {
	width: 100%;
	list-style-type: none;
	margin: 0;
	padding: 0;
}

The last CSS rules should override the user agent styles, but they don't.

ul, menu, dir {
    display: block;
    list-style-type: disc;
    -webkit-margin-before: 1em;
    -webkit-margin-after: 1em;
    -webkit-margin-start: 0px;
    -webkit-margin-end: 0px;
    -webkit-padding-start: 40px;
}

That's the user agent style. It all remains active and my navigation doesn't display properly, because of the padding.
Comment 1 Tim Nguyen (:ntim) 2021-12-24 13:37:55 PST
I can't reproduce this anymore:

data:text/html,<ul style="padding:0;"><li>hi</li><li>foo</li></ul>

renders differently from:

data:text/html,<ul><li>hi</li><li>foo</li></ul>