html - Navigation active with css -


I have two pages and both of them are included in navigation, so editing it once in both of them Makes easy But now I am very unsure how to implement the classroom activation, which shows that you are in highlights with CSS. This code is:

  & lt; Li & gt; & Lt; A href = "../ / rapport / index.php" square = 'relation' & gt; Rapport & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "../ diagram / index.php" square = 'diagram' & gt; Diagram & lt; / A & gt; & Lt; / li & gt;   

Edit: This is CSS for image and CSS and icons. In the blade I did it to activate it:

  & lt; Li class = 'pil {{($ aktiv ==' sok ')? 'Active': ''}} '& gt; & Lt; A class = 'sok' {{HTML :: linkRoute ('sok', 'Søk')}}   

CSS:

  .navbar-default.navbar-nav>. Active & gt; a.rapport: first, .navbar-nav & gt; Li & gt; A synergy: {before background-image: url ('../ images / top3.png'); } .navbar-default.navbar-nav>. Active & gt; a.diagram: first, .navbar-nav & gt; Li & gt; A.diagram: first {background-image: url ('../ images / top2.png'); }    

Add a variable $ page to your page. For example,

Rappport Page

  & lt ;? Php $ page = 'Rapport'; ('Header.php'); ? & Gt;   

In the diagram page

  & lt; Php $ page = 'diagram'; ('Header.php'); ? & Gt;   

header.php

  & lt; Li & gt; & Lt; A href = "../ relationship / index.php" class = "& lt; php if ($ page == 'Rapport') {echo 'active';}? & Gt; & gt; coordination & lt; / a & Lt; / li & gt; 
  • Comments

    Popular posts from this blog

    Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

    multithreading - PhantomJS-Node in a for Loop -

    c++ - MATLAB .m file to .mex file using Matlab Compiler -