CSS doesn't effect in blade - laravel

I'm encountering a problem today: I just created a new blade view that displays my HTML, but my CSS doesn't work! I tried several ways like putting it directly on the page, putting it outside my layout, nothing to do... it works on all my other pages that are exactly the same place on my workspace.
Here is my blade file:
#extends('layouts.default')
#section('content')
<section class="blog-outer-area mt-5">
<div class="content-area">
<div class="blog-area-sec">
<!-- Start: Blog Sec -->
<div class="blog-sec">
<div class="container">
<!-- Start:Blog Area -->
<div class="blog-inner-area row">
<!-- Start:Blog Left Content-->
<div class="col-lg-8 left">
<div class="item-box">
<div class=" img-holder">
<img src="template/img/home-blog-1.jpg" alt="">
</div>
<div class=" img-holder">
<img src="template/img/home-blog-1.jpg" alt="">
</div>
<div class="info-text-holder">
<h4>{{ $article->titre }}</h4>
<span>{{ $article->created_at->format('d/m/Y') }}</span>
<p>{{ $article->description }}</p>
<ul class="social-icon-simple">
<li><i class="fa fa-facebook"></i></li>
</ul>
</div>
</div>
</div>
<!-- End:Blog Left Content-->
<!-- Start:Blog Right Content-->
<div class="col-lg-4 ">
<div class="right">
<input type="text" name="search" class="search-btn" placeholder="Search Here">
<!-- Start:Recent Posts-->
<h5>Recent posts</h5>
<ul class="recent-post">
<!-- Start:Post 1-->
<li>
<div class="row">
<div class="col-lg-5">
<img src="template/img/blog-4.jpg" alt="">
</div>
<div class="col-lg-7">
<div class="text">
<p>Stetina savours Tour de France return</p>
</div>
</div>
</div>
</li>
<!-- End:Post 1-->
<!-- Start:Post 2-->
<li>
<div class="row">
<div class="col-lg-5">
<img src="template/img/blog-5.jpg" alt="">
</div>
<div class="col-lg-7">
<div class="text">
<p>Top Fitness Gear to Help You Workout</p>
</div>
</div>
</div>
</li>
<!-- End:Post 2-->
<!-- Start:Post 3-->
<li>
<div class="row">
<div class="col-lg-5">
<img src="template/img/blog-6.jpg" alt="">
</div>
<div class="col-lg-7">
<div class="text">
<p>The Southern Ocean is the 'newest' named ocean</p>
</div>
</div>
</div>
</li>
<!-- End:Post 3-->
</ul>
<!-- End:Recent Posts-->
</div>
</div>
<!-- End:Blog Right Content-->
</div>
<!-- End:Blog Area -->
</div>
</div>
<!-- End: Blog Sec -->
</div>
</div>
</section>
#endsection
My Layout integrations:
<link type="text/css" rel="stylesheet" href="template/css/bootstrap.min.css"><!-- Bootstrap -->
<link type="text/css" rel="stylesheet" href="template/font-awesome/css/font-awesome.min.css"><!-- font-awesome -->
<link type="text/css" rel="stylesheet" href="template/css/animate.min.css"><!-- Animation -->
<link type="text/css" rel="stylesheet" href="template/css/flexslider.css"><!-- FlexSlider CSS -->
<link type="text/css" rel="stylesheet" href="template/css/style.css"><!-- Light Theme Core CSS -->
<!-- Google Fonts here -->
<link href="template/css/fonts/poppins.css" rel='stylesheet' type='text/css'>
<link href="template/css/fonts/open-sans.css" type='text/css'>
<link href="template/css/fonts/lato.css" rel='stylesheet' type='text/css'>
My workspace looks like this:

Try this
<link type="text/css" rel="stylesheet" href="/template/css/bootstrap.min.css"><!-- Bootstrap -->
<link type="text/css" rel="stylesheet" href="/template/font-awesome/css/font-awesome.min.css"><!-- font-awesome -->
<link type="text/css" rel="stylesheet" href="/template/css/animate.min.css"><!-- Animation -->
<link type="text/css" rel="stylesheet" href="/template/css/flexslider.css"><!-- FlexSlider CSS -->
<link type="text/css" rel="stylesheet" href="/template/css/style.css"><!-- Light Theme Core CSS -->
<!-- Google Fonts here -->
<link href="/template/css/fonts/poppins.css" rel='stylesheet' type='text/css'>
<link href="/template/css/fonts/open-sans.css" type='text/css'>
<link href="/template/css/fonts/lato.css" rel='stylesheet' type='text/css'>

Related

Canvas as background

Can't figure out how to set this animated canvas as the website background of my portfolio page.
any help would be appreciated. or how do I place the div with text over the canvas?
so it sits nice and flush....................
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Portfolio</title>
<link rel="icon" type="image/x-icon" href="image/favicon.ico">
<script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="style.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js" crossorigin="anonymous"></script>
<nav>
<!-- De checkbox -->
<input type="checkbox" id="check">
<label for="check" id="checkbox">
<i class="fas fa-bars" id="btn"></i>
<i class="fas fa-times" id="cancel"></i>
</label>
<!-- logo en de Buttons in de nav bar -->
<img src="image/logo.png" alt="logo">
<ul>
<li>Home</li>
<li>Projects</li>
<li>About me</li>
<li>Contact</li>
</ul>
</nav>
</head>
<body>
<div id="particles-js">
<script>
particlesJS.load('particles-js', 'particles.json', function() {
console.log('particles.json loaded ...');
});
</script>
<section class="home" id="home">
<div class="max-width">
<div class="home-content">
<div class="text-1">Hey, I'm makkerheineken.</div>
<div class="text-2">Front-End & Back-end Develeper.</div>
</div>
</div>
</section>
</div>
</body>
</html>
You could give the canvas the same size as the screen, add a div with the same size but positioned absolutely, and then put the rest of your elements inside this div.

Why am i getting two MY ACCOUNT on my nav bar using sec:authorize ="isAnonymous()"

<ul class="nav navbar-nav navbar-right">
<li>SHOPPING CART</li>
<li><a sec:authorize="isAnonymous()" th:href="#{/login}">MY ACCOUNT</a></li>
<li><a sec:authorize="isAuthenticated()" th:href="#{/myProfile}">MY ACCOUNT</a></li>
<li><a sec:authorize="isAuthenticated()" th:href="#{/logout}">LOGOUT</a></li>
</ul>
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml" xmlns:sec="http://www.w3.org/1999/xhtml">
<head th:fragment="common-header">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Le's Bookstore</title>
<!-- Bootstrap core CSS -->
<link href="/css/bootstrap.min.css" rel="stylesheet" />
<link href="/css/non-responsive.css" rel="stylesheet" />
<!-- Custom styles for this template -->
<link href="/css/style.css" rel="stylesheet" />
<link rel="icon" href="/image/applie-touch-icon.png" />
</head>
<body>
<div th:fragment="navbar">
<div class="page-top"
style="width: 100%; height: 20px; background-color: #f46b42;"></div>
<!-- Static navbar -->
<nav class="navbar navbar-default navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">LE'S BOOKSTORE</a>
</div>
<div id="navbar">
<ul class="nav navbar-nav navbar-left">
<li class="dropdown"><a href="#" class="dropdown-toggle"
data-toggle="dropdown" role="button" aria-haspopup="true"
aria-expanded="false">BOOKS <span class="caret"></span></a>
<ul class="dropdown-menu">
<li>Browse the bookshelf</li>
<li>Store hours & Directions</li>
<li>FAQ</li>
</ul></li>
<form class="navbar-form">
<div class="form-group">
<input type="text" name="keyword" class="form-control"
placeholder="Book title" />
</div>
<button type="submit" class="btn btn-default">Search</button>
</form>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>SHOPPING CART</li>
<li><a sec:authorize="isAnonymous()" th:href="#{/login}">MY ACCOUNT</a></li>
<li><a sec:authorize="isAuthenticated()" th:href="#{/myProfile}">MY ACCOUNT</a></li>
<li><a sec:authorize="isAuthenticated()" th:href="#{/logout}">LOGOUT</a></li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container-fluid -->
</nav>
</div>
<div th:fragment="body-bottom-scripts">
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
</div>
</body>
</html>
Your namespace is not correct. You may need to add thymeleaf & springsecurity5 as shown below:
<!DOCTYPE HTML>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<!-- head, body, etc -->
</html>
Try to use !isAuthenticated(). Edit your code like this:
<ul class="nav navbar-nav navbar-right">
<li>SHOPPING CART</li>
<li><a sec:authorize="!isAuthenticated()" th:href="#{/login}">MY ACCOUNT</a></li>
<li><a sec:authorize="isAuthenticated()" th:href="#{/myProfile}">MY ACCOUNT</a></li>
<li><a sec:authorize="isAuthenticated()" th:href="#{/logout}">LOGOUT</a></li>
</ul>

Laravel blade. Blade doesn't work

I have route
Route::get("/prodByCat/{category_id}", "ProductController#productsByCategory")->name("product.productsByCategory");
and function
public function productsByCategory($category_id){
$products = Product::where('category_id', $category_id)->get();
return view("cat", compact("products"));
in my template i have only
#extends("index")
#section("content")
#foreach($products as $product)
{{ $product->name }}
#endforeach
#endsection
Problem is - links to bootstrap and custom css doesn't inherits. I tried to create another controller and new template file. But nothing works, except deleting {category_id} from Route. Why passing {category_id} conflicts with links to css files?
I tried composer dump-autoload and reboot computer.All other templates work properly.
My index template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>#yield("title")</title>
#yield("css")
<!-- Bootstrap core CSS -->
<link href="files/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="files/shop-homepage.css" rel="stylesheet">
</head>
<body>
<!-- Navigation -->
#include("layouts._shopNav")
<!-- Page Content -->
<div class="container">
<div class="row">
<div class="col-lg-3">
#yield('category')
</div>
<!-- /.col-lg-3 -->
<div class="col-lg-9">
#yield("carousel")
<div class="row">
#yield("content")
</div>
<!-- /.row -->
</div>
<!-- /.col-lg-9 -->
</div>
<!-- /.row -->
</div>
<!-- /.container -->
<!-- Footer -->
<footer class="fixed-bottom py-3 bg-dark">
<div class="container">
<p class="m-0 text-center text-white">Some writing<br></p>
</div>
<!-- /.container -->
</footer>
<!-- Bootstrap core JavaScript -->
<script src="files/jquery/jquery.min.js"></script>
<script src="files/bootstrap/js/bootstrap.bundle.min.js"></script>
</body>
</html>
The problem is that the wrong path of the css files. You can use
{{ asset('files/jquery/jquery.min.js') }}
to make sure that the path is correct.

Create pdf having each page background in different color using DOMPDF

I am generating reports using DOMPDF in codeigniter. This pdf have 10 pages in which 3 pages have yellow background (Page #2, #5 and #8 and entire page bgcolor needs to be yellow without margin or spacing) rest pages background color is white.
Also, i am using DOMPDF's html5 parser by setting "DOMPDF_ENABLE_HTML5PARSER" config as true. This is because my report html's contains html5 tags like footer.
I googled this and found one solution as to put each page in separate "body" tag but generated output have all pages in yellow background.
Below is my html template:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Report</title>
<link rel="stylesheet" href="css/reports/styles.css" />
</head>
<!-- Page #1 -->
<body>
<div>
<div class="wrapper">
<h1>Heading</h1>
<ul class="index">
<li>2. report 1</li>
<li>5. report 2</li>
<li>8. report 3</li>
</ul>
</div>
</div>
</body>
<!-- Page #2 -->
<body style="background-color: #f2ab02">
<div>
<div class="wrapper">
<h1>Report 1: Analysis & Results</h1>
<img src="/img/reports/human-face.png" class="imglogo" />
</div>
</div>
</body>
<!-- Page #3 -->
<body>
<div>
<h1>Report 1: (1/2)</h1>
<table>...</table>
<footer>
<img src="/img/reports/logo.png" class="footer-logo" />
<div class="page_number">3</div>
</footer>
</div>
</body>
<!-- Page #4 -->
<body>
<div>
<h1>Report 1: (2/2)</h1>
<table>...</table>
<footer>
<img src="/img/reports/logo.png" class="footer-logo" />
<div class="page_number">4</div>
</footer>
</div>
</body>
<!-- Page #5 -->
<body style="background-color: #f2ab02">
<div>
<div class="wrapper">
<h1>Report 2: Analysis & Results</h1>
<img src="/img/reports/human-face.png" class="imglogo" />
</div>
</div>
</body>
<!-- Page #6 -->
<body>
<div>
<h1>Report 2: (1/2)</h1>
<table>...</table>
<footer>
<img src="/img/reports/logo.png" class="footer-logo" />
<div class="page_number">6</div>
</footer>
</div>
</body>
<!-- Page #7 -->
<body>
<div>
<h1>Report 2: (2/2)</h1>
<table>...</table>
<footer>
<img src="/img/reports/logo.png" class="footer-logo" />
<div class="page_number">7</div>
</footer>
</div>
</body>
<!-- Page #8 -->
<body style="background-color: #f2ab02">
<div>
<h1>Report 3: Analysis & Results</h1>
<img src="/img/reports/human-face.png" class="imglogo" />
</div>
</body>
<!-- Page #9 -->
<body>
<div>
<h1>Report 3: (1/2)</h1>
<table>...</table>
<footer>
<img src="/img/reports/logo.png" class="footer-logo" />
<div class="page_number">9</div>
</footer>
</div>
</body>
<!-- Page #10 -->
<body>
<div>
<h1>Report 3: (2/2)</h1>
<table>...</table>
<footer>
<img src="/img/reports/logo.png" class="footer-logo" />
<div class="page_number">10</div>
</footer>
</div>
</body>
</html>
Any help will be appreciated.
I can't say that I would recommend this method, but it might work if you disable the HTML5 parser. The main use of the HTML5 parser in dompdf is to correct syntactical errors. Multiple BODY elements are not permitted and so after passing through the HTML5 parser the multiple body elements will be merged into a single element.

Why bootstrap not working in MS Visual Studio 2010

A newly installed visual studio 2010. Then i tried to add bootstrap for better design but its not working
Here is my code
<%# Master Language="C#" AutoEventWireup="true" CodeBehind="Main.master.cs" Inherits="mySample.Main" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
<link href="contents/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css" />
<link href="contents/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div class="navbar navbar-fixed-top navbar-default" role="navigation" >
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Job Order System</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li>Closed Request</li>
</ul>
</div>
</div>
</div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</form>
<script type="text/javascript" src="<%= Page.ResolveUrl("~/script/jquery-2.1.0.min.js") %>"></script>
<script type="text/javascript" src="<%= Page.ResolveUrl("~/script/bootstrap.min.js") %>"></script>
</body>
</html>
It only display a normal list
Please help me solving this kind of problem. Thank you so much
I see 2 potential problems:
You're using a relative URI in the <link /> elements, this won't be a problem if every page is in the root of your website, but it's good practice to make these Application-root-relative URIs. Add runat="server" to the element and begin the href with ~/ and ASP.NET will automatically give it a correct URI
You've put the <link /> inside <asp:ContentPlaceHolder elements, which means they're the "default content" of the placeholders. If any of your pages set content for that placeholder then the default content (i.e. your bootstrap links) will be removed.

Resources