Laravel Font face in layout and other blade -


I have layout view with two fonts in a CSS and header, and there is a header output for another blade view: {{HTML :: Style ('css / style1.css')}} @Elder ('header') & lt; Style type = "text / css" & gt; @ Font-face {font-family: new-font; Src: url ('font / brandon_grotesque_medium.ttf'); } & Lt; / Style & gt; & Lt; Style type = "text / css" & gt; @ font-face {font-family: Noto-Sans; Src: url ('font / NotoSans-Bold.ttf'); } & Lt; / Style & gt;

They both work fine in this layout view. But I have another scene:

  @extends ('layout') @section ('header') {{HTML :: style ('css / posts / style2.css')} } @ Stop @ section ('content') my content here @stop   

style2 css works fine in my second view, but the fonts are missing. I have tried putting a font script in the header section in my second view, but still nothing. What can be the problem?

You can use an property () .

  & style style = "text / css" & gt; @ Font-face {font-family: nav-font; src: url ('{{asset (' font / brandon_grotesque_medium.ttf ')}}'); } & Lt; / Style & gt; & Lt; Style type = "text / css" & gt; @ font-face {font-family: Noto-Sans; Src: url ('{{asset (' font / NotoSans-Bold.ttf ')}}'); } & Lt; / Style & gt;   

This type of approach will remove the need for relative path because it will solve a complete URL. This will remove the "relative wizard", as Zawaki mentioned in the comment.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -