How to modify link in PHP code [closed]

1

The code snippet is this:

<div class="menu-item" ui-sref="albums" ui-sref-active="active" href="/albums"><i class="icon icon-cd"></i> Álbuns</div>

The idea was to link instead of going to "/ albums" to go to any other link that I type for example: www.google.com

    
asked by anonymous 05.06.2017 / 18:59

2 answers

1

You can do this in several ways:

<a href="http://www.google.com"><div class="menu-item" ui-sref="albums" ui-sref-active="active"><i class="icon icon-cd"></i> Álbuns</div></a>

Then style the a element with whatever you want.

or

<div onclick="location.href='http://www.google.com'" class="menu-item" ui-sref="albums" ui-sref-active="active"><i class="icon icon-cd"></i> Álbuns</div>

and other forms ...

<div class="your-music"><h2>Sua Música</h2>
<div onclick="location.href='http://www.google.com'" class="menu-item active" ui-sref="songs" ui-sref-active="active"><i class="icon icon-note"></i> Músicas</div>
<div onclick="location.href='http://www.pt.stackoverflow.com'" class="menu-item" ui-sref="albums" ui-sref-active="active"><i class="icon icon-cd"></i> Álbuns</div>
<div onclick="location.href='http://www.x123VXG.dxy'" class="menu-item" ui-sref="artists" ui-sref-active="active" ><i class="icon icon-mic"></i> Artistas</div></div>
    
05.06.2017 / 19:11
2

Links are used with the tag <a> . You could use it this way:

<div>
  <a href="meu_link"></a>
</div>

Or even with lists:

<ul class="menu">
    <li class="menu-item">
      <a href="meuLink">Item 1</a>
    </li>
</ul>
  

Note: Replace myLink with the desired link, eg link

    
05.06.2017 / 19:12