Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Overriding webkit- user agent styles
Message
 
General information
Forum:
CSS
Category:
Styling
Miscellaneous
Thread ID:
01599142
Message ID:
01599242
Views:
28
>>>>>>How do you override the style defined in the Chrome “user agent stylesheet”?
>>>>>>
>>>>>>For example, I have a UL element on a page that in the Chrome Development Tools shows properties as in “user agent stylesheet”. This UL is shown as sized to be 608 by 63px which is not enough (width) to show all LI elements in one line. So the last LI element breaks into the next line. (IE 10 does not have this problem).
>>>>>>
>>>>>>I am trying figure how to override this webkit engine behavior (the same problem occurs on iPad browser).
>>>>>>I am guessing that the problem rests with the “user agent stylesheet” but if you see that I can be resolved in another way, please let me know.
>>>>>
>>>>>The 'user agent stylesheet' settings are just the styles built into the browser - a default if you provide nothing else. It's common practice to completely override these so that you start with a clean slate for all browsers. Plenty of examples around - first one I found : http://meyerweb.com/eric/tools/css/reset/
>>>>>
>>>>>Simply make sure this is the first stylesheet loaded then build your own requirements on top of that. I thought that if you use Bootstrap it pretty much did this anyway?
>>>>
>>>>First, thank you for the link; I will follow it. Yes, I do use Bootstrap 3 but webkit overrides some properties from 'user agent stylesheet'
>>>
>>>Everything overrides user agent settings - it's at the bottom of the heap. The main point is that it's best to override *everything* that might be defined in user agent settings - otherwise you'll always potentially get variations between browsers.
>>>
>>
>>Thank you. This (yesterday) was the first time I came across the concept of 'user agent stylesheet'. Such thing probably exists in IE but not "visible" in the Development Tools.
>
>Viv hit the definition on the head in his first reply. A user agent stylesheet is the official (W3C) terminology for a browser's default stylesheet. It provides styles for element properties that do not have styles defined anywhere else. I had not thought of his suggestion to override all of them but it makes perfect sense. Browser-specific behavior is what we are trying to get away from, not embrace.

Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform