0

So I'm currently trying to combine 2 separate .css files for my landing page. They both import different google fonts, problem is, as you all know the last .css style will override the first. Is there a good way to handle this issue or is it something that is not normally done? All class names are different as well.

<link href='http://fonts.googleapis.com/css?family=Raleway:600,900' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Lato:300,400,700' rel='stylesheet' type='text/css'>

maybe Im just not calling for the .css in the correct way...If you need more info from me, let me know. Is this a common issue?

5
  • 1
    what's your problem exactly ? do you meet any conflict in using those fonts ? Commented Jul 31, 2014 at 6:48
  • How do you expect us to do anything, you choose the design of your website, I don't understand why you need us to tell you which css rule to keep Commented Jul 31, 2014 at 6:48
  • I think it won't give any issue. Because both are different fonts and you are going refer with different names. No issues. Commented Jul 31, 2014 at 6:48
  • 1
    You can actually combine them into one line using the pipe delimiter (like <link href='http://fonts.googleapis.com/css?family=Lato:300,400,700|Raleway:600,900' rel='stylesheet' type='text/css'>) Commented Jul 31, 2014 at 6:49
  • It is not true that “the last .css style will override the first”, so what is the problem. (If CSS declarations conflict, then the last one wins other things being equal, but you have not shown any CSS declarations.) Commented Jul 31, 2014 at 7:52

3 Answers 3

2

Google fonts allows you to add all fonts into a collection, because you are doing it separately, it is getting overwritten.

<link href='http://fonts.googleapis.com/css?family=Lato:400,700,300italic|Raleway:600,900' rel='stylesheet' type='text/css'>
Sign up to request clarification or add additional context in comments.

Comments

0

this shouldn't be any problem at all. the Google fonts will be loaded separately. And you will call them into your css by writing the following code

h1, h2, h3 {
    font-family: 'Raleway';
}

p {
    font-family: 'Lato';
}

Comments

0

Take advantage of Font Pairings.

In that case, you put a pipe character (vertical line) between each font type.

The code would appear as follows:

<link href='http://fonts.googleapis.com/css?family=Raleway:600,900|Lato:300,400,700' rel='stylesheet' type='text/css'>

You can read more here

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.