I've created a style sheet (css file located in a App-Themes folder) with a series of simple style definitions, one of them being for the 'body' element as follows:
Strangely enough, all style rules are correctly applied (color, font family ,alignment) but the font-size rule seems to be completely neglected. The font-size is never applied. It looks like the font-size must be overriden somewhere else, but there is no
other style definition elsewhere in the web application.
Does anyone have any hints where i could look for?
in an up to date modern browser you can press F12 to open the developer tools. Check which style overrides the font-size of the element of which you thought it was going to be applied to.
Grz, Kris.
Read my blog | Twitter Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
Tx for this hint. I've done this and the body style seems to be overruled by a table style. However, nowhere I have defined a table style, so it looks like it's auto-generated (it says 'user agent stylesheet') ??
Actually i just solved the problem by explicitely defining a table style with font-size definition myself. But I'm still wondering how come that a personally defined style is overriden by a auto-generated style at runtime.... :-§
How come the default style sheet of the browser overrules the custom defined style sheet of the web program? This is the case in all browsers i tested with (IE, FireFox, Chrome, Safari).
There must be some settings to be done to make sure the web application style sheet gets priority?
hdelporte
Member
1 Points
10 Posts
working with style sheets - weird behaviour
Dec 26, 2012 05:43 PM|LINK
I've created a style sheet (css file located in a App-Themes folder) with a series of simple style definitions, one of them being for the 'body' element as follows:
body { font-size: x-small; font-family: Verdana; font-style: normal; text-align: justify; color: #003366; }Strangely enough, all style rules are correctly applied (color, font family ,alignment) but the font-size rule seems to be completely neglected. The font-size is never applied. It looks like the font-size must be overriden somewhere else, but there is no other style definition elsewhere in the web application.
Does anyone have any hints where i could look for?
XIII
All-Star
182674 Points
23445 Posts
ASPInsiders
Moderator
MVP
Re: working with style sheets - weird behaviour
Dec 26, 2012 06:07 PM|LINK
Hi,
in an up to date modern browser you can press F12 to open the developer tools. Check which style overrides the font-size of the element of which you thought it was going to be applied to.
Grz, Kris.
Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
hdelporte
Member
1 Points
10 Posts
Re: working with style sheets - weird behaviour
Dec 27, 2012 09:39 AM|LINK
Tx for this hint. I've done this and the body style seems to be overruled by a table style. However, nowhere I have defined a table style, so it looks like it's auto-generated (it says 'user agent stylesheet') ??
hdelporte
Member
1 Points
10 Posts
Re: working with style sheets - weird behaviour
Dec 27, 2012 09:46 AM|LINK
Actually i just solved the problem by explicitely defining a table style with font-size definition myself. But I'm still wondering how come that a personally defined style is overriden by a auto-generated style at runtime.... :-§
XIII
All-Star
182674 Points
23445 Posts
ASPInsiders
Moderator
MVP
Re: working with style sheets - weird behaviour
Dec 27, 2012 09:51 AM|LINK
Hi,
This is the default style sheet of the browser itself.
Grz, Kris.
Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
bhaskar.mule
Contributor
2264 Points
656 Posts
Re: working with style sheets - weird behaviour
Dec 27, 2012 09:52 AM|LINK
It will help you..
try to give as font-size:10px
It may vary by browser but this should work
X-small is 10 px which is around 7.5 pt
http://css-tricks.com/css-font-size/
Site:Rare technical solutions
hdelporte
Member
1 Points
10 Posts
Re: working with style sheets - weird behaviour
Dec 27, 2012 11:36 AM|LINK
How come the default style sheet of the browser overrules the custom defined style sheet of the web program? This is the case in all browsers i tested with (IE, FireFox, Chrome, Safari).
There must be some settings to be done to make sure the web application style sheet gets priority?
Thanks a lot !!!
XIII
All-Star
182674 Points
23445 Posts
ASPInsiders
Moderator
MVP
Re: working with style sheets - weird behaviour
Dec 27, 2012 12:27 PM|LINK
Hi,
Can you check your doctype? As per this answer http://stackoverflow.com/questions/9308234/user-agent-stylesheet-overriding-my-table-style-twitter-bootstrap. They seem to have had the same problem as you.
Grz, Kris.
Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
hdelporte
Member
1 Points
10 Posts
Re: working with style sheets - weird behaviour
Dec 28, 2012 09:33 PM|LINK
The problem was finally resolved by having a detailed look at the CSS file and better (& more explicitely) redefining & structuring my style sheet
tx for all!!! quickly moving forward!!!