0

Okay, so I am creating this mobile website where I am trying to change the font-size and color of some text. Now, I have tested my code on my PC, iOS and Android (using Chrome browser) and only on the Android there seems to be a problem. When using an imported CSS document some settings will not change, but if I type then in directly into the element using the "style" attribute everything works.

Font

The font-size seems to have different levels as when I type in:

font-size: 31px;

it gives me this:

Hello

However if I were to change it to:

font-size: 30px;

the font size will now be like this:

Hello

Color

Also, the color on Android never seems to change as the color is always black. I have tried changing it to both other dark and bright colors without any success (note the colors are changing on both my PC and on iOS).

Override

I am thinking that there might be some sort of snippet of code which would override these default settings. If anyone of you have found one when importing CSS to a PHP/HTML doc or have any other solution it would gladly be appreciated!

4
  • i think your style is overwritten by some other class or css styling try: font-size: 30px !important; Commented Jan 12, 2015 at 18:46
  • Will try it! Thanks for the fast response. Commented Jan 12, 2015 at 18:48
  • Thank you a lot! It did solve the color issue I had, don't really know why only Android overwrote the css and not the others. However as my font-size is embedded in my jQuery it complicates it a bit. i will look for a solution for adding "!important" in jQuery and hope that will be the solution I am looking for. Thanks again! Commented Jan 12, 2015 at 18:56
  • I will make it an answer so that others can notice the solution.... btw. it is not Android this is HTML/CSS it can be that a class attached to a div tag or whatever is overwritting your styles Commented Jan 12, 2015 at 18:59

1 Answer 1

1

your style is overwritten by some other CSS class or css styling use:

font-size: 30px !important;

thereby your styling will be applied over all other stylings thereby overwriting all predefined stylings

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.