Move an item within another SCSS

0

I have a web page and I am trying to move a link element "a" into an existing "div". The generated code would be something like this:

<a href="google.es" class="download-link">Download file</a>
<form>
  ...
  </form>
<div class="footer"></div>

The idea is to move the link within the class "footer" through SCSS. I am a newbie in the layout and I can not find the form. I suppose I could do it through the backend of the page, but I leave that as a last resort. Thank you very much everyone.

    
asked by Javier 09.07.2018 в 09:36
source

1 answer

0

Only with css, or scss in your case you could do something like this, in this way you can get the link to be seen in the footer:

.footer {border:1px solid black;width:100%;height:100px;}
.download-link {position:absolute;top:20%;}
<a href="google.es" class="download-link" id="link">Download file</a>
<form>
  ...
  </form>
<div class="footer" id="footer"></div>

But I recommend doing it with javascript to avoid having to force the positioning of the elements, with js it is much easier and advisable, you would have to make the link son of the footer, here is an example:

document.getElementById("footer").appendChild(document.getElementById("link"));
.footer {border:1px solid black;width:100%;height:100px;}
<a href="google.es" class="download-link" id="link">Download file</a>
<form>
  ...
  </form>
<div class="footer" id="footer"></div>
    
answered by 09.07.2018 в 13:50