I am encountering some difficulties with setting up my assets in the Laravel 4 Framework. To provide some context, I have an assets folder within my public directory, containing subfolders for css, images, and fonts. Here are the paths:
/laravel-master/public/assets/CSS
/laravel-master/public/assets/images
/laravel-master/public/assets/webfonts
Within the CSS folder, I have my main CSS file, style.css. I am attempting to utilize an image as a background within this CSS file. Here is the code snippet:
.banner-image{
background: transparent url('../assets/images/8662834823_575a23516d_o.jpg') no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
height: 800px;
min-width: 1200px;
}
I have also experimented with:
.banner-image {
background: url('assets/images/8662834823_575a23516d_o.jpg');
}
and:
.banner-image {
background: url('/assets/images/8662834823_575a23516d_o.jpg');
}
When I include this CSS in my view using the div tag:
<div class="banner-image"></div>
Both implementations result in a blank page. The image fails to appear, and I am uncertain of the cause.
Next, I am attempting to display a simple image without CSS. I have tried:
<img src="{{asset('assets/images/fanssignupsplash.png')}}">
and:
{{HTML::image('images/fanssignupsplash.png')}}
and:
{{HTML::image('assets/images/fanssignupsplash.png')}}
All of these attempts result in a broken image icon. The image does not display.
Lastly, back to CSS, I am endeavoring to utilize font files from the webfonts folder mentioned earlier. However, the font does not seem to be applied. While the CSS file loads correctly and changes text color, the font remains unchanged. Here is the relevant CSS:
@font-face {
font-family:'proxima-nova';
src:url('/assets/webfonts/proximanova-bold-webfont.eot');
src:url('/assets/webfonts/proximanova-bold-webfont.eot?#iefix') format("embedded-opentype"),url('/assets/webfonts/proximanova-bold-webfont.woff') format("woff"),url('/assets/webfonts/proximanova-bold-webfont.ttf') format("truetype"),url('/assets/webfonts/proximanova-bold-webfont.svg#ProximaNovaBold') format("svg");
font-weight:bold;
font-style:normal
}
The view being used is a blade file (landing.blade.php). These actions are taking place on localhost utilizing MAMP.
Thank you for your assistance with these issues. As a newcomer to Laravel, I have successfully implemented similar functionalities outside of a framework on a live website. I genuinely appreciate your support.