1

My default Head block is like this

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
         <link src="//fonts.googleapis.com/css?family=Raleway:400,600,600italic,500italic,500" src_type="url" /> 
        <css src="css/bootstrap.min.css" />
         <css src="css/custom-gw.css" />
        <css src="css/fetch_gw.css" />
        <css src="css/styles-m.css" />
        <css src="css/styles-l.css" media="screen and (min-width: 768px)"/>
        <css src="css/print.css" media="print" />


    </head>
</page>

it generates output like this in page source

<link  rel="stylesheet" type="text/css"  media="all" href="http://localhost:8080/mac/pub/static/frontend/GWtheme/GW/en_US/css/styles-m.css" />
<link  rel="stylesheet" type="text/css"  media="all" href="http://localhost:8080/mac/pub/static/frontend/GWtheme/GW/en_US/css/bootstrap.min.css" />
<link  rel="stylesheet" type="text/css"  media="all" href="http://localhost:8080/mac/pub/static/frontend/GWtheme/GW/en_US/css/custom-gw.css" />
<link  rel="stylesheet" type="text/css"  media="all" href="http://localhost:8080/mac/pub/static/frontend/GWtheme/GW/en_US/css/fetch_gw.css" />
<link  rel="stylesheet" type="text/css"  media="screen and (min-width: 768px)" href="http://localhost:8080/mac/pub/static/frontend/GWtheme/GW/en_US/css/styles-l.css" />
<link  rel="stylesheet" type="text/css"  media="print" href="http://localhost:8080/anthony/pub/static/frontend/GWtheme/GW/en_US/css/print.css" />
<link  href="//fonts.googleapis.com/css?family=Raleway:400,600,600italic,500italic,500" />

but when i apply Raleway font on body its not working I can however see this in fire bug but its not appying

body {
    color: #6d4d3d;
    font-family: "Raleway",sans-serif;
    font-size: 16px;
    line-height: 1;
}
3
  • Is the font-family declaration being overwritten by any other CSS?
    – Ben Crook
    May 4, 2016 at 16:35
  • Move your layout to current theme or module directory. Ctrl+Shift+M Clear browser cache and try to reload again
    – mrtuvn
    May 5, 2016 at 9:23
  • @Rakhi Is your issue resolved?
    – Nafsss
    Aug 2, 2021 at 9:16

1 Answer 1

1

Try setting up your xml file like this:

app/design/frontend/{{vendor}}/{{theme}}/Magento_Theme/layout/default_head_blocks.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <!-- Google Fonts -->
        <link src="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800" src_type="url" rel="stylesheet" />
    </head>
</page>

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.