a link stretching horizontally on the webpage

While building my basic HTML site, I encountered an issue with my anchor tags (). They are extending all the way across the screen with a black background, which is part of the footer design.

<!DOCTYPE html>
<html ng-app="myApp">
<head>
<title>Under construction</title>


<link rel="stylesheet" style="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" style="text/css" href="app/stylesheets/stylesheet.css">

        <script src="//code.angularjs.org/1.3.0-rc.1/angular.min.js"></script>
        <script src="https://code.angularjs.org/1.3.0-rc.1/angular-route.min.js"></script>
        <script src="app/JS/app.js"></script>

</head>



<body>



<div class="container">
<div ng-view>

</div>
</div>



        <div id="footerDiv" class="footBackground">
<hr>
             <a href="" target="_blank">
                <div ng-init="imgsrc ='app/images/linkedin.png'" ng-mouseover="imgsrc='app/images/linkedinHover.png'" ng-mouseout="imgsrc='/app/images/linkedin.png'">
                    <img ng-src="{{imgsrc}}" width="50" height="50" class="footLinkedIn"></img>
                </div><br />
            </a>

        <a href="" target="_blank"><h5><span>Website created by <br />Adam parker</span></h5></a>
<hr>
        </div>

</body>
</html>

I have attempted multiple times to address the issue with the extended anchor tag, but so far nothing has worked.

Even after trying to modify the anchor tag using CSS, I still can't seem to resolve the problem. The code snippet is short, and I am puzzled as to why it spans over half of the screen. Any assistance would be greatly appreciated.

PS. I temporarily removed some code for troubleshooting purposes, specifically focusing on fixing the lengthy anchor tag in the footer.

Answer №1

Try switching the order of your anchor tags and div to prevent the div from stretching across the page width.

<div ng-init="imgsrc ='app/images/linkedin.png'" ng-mouseover="imgsrc='app/images/linkedinHover.png'" ng-mouseout="imgsrc='/app/images/linkedin.png'">
  <a href="https://uk.linkedin.com/pub/adam-parker/101/29/910" target="_blank">
    <img ng-src="{{imgsrc}}" width="50" height="50" class="footLinkedIn" />
  </a>
</div>

Check out this example for reference

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Issue: Module './' could not be located

Encountered this error while trying to launch my application using NPM start. Strangely, it worked perfectly on another computer. I unzipped the file, ran npm install, and attempted to start the app, only to be hit with the following error: Any assistance ...

What is the best way to integrate PHP code within CSS?

I'm working on a script that requires me to add PHP code within a CSS stylesheet. However, when I attempt to do so, nothing seems to happen! Is it even possible to include PHP code in a CSS file? ...

Numerous divs positioned above a myriad of images

Is there a way to create multiple images with a tag name overlaying each one as a link? I've been able to add a tag name on top of one image, but not on others. Every time I try to duplicate the div containing the image and tag, the tags do not show u ...

Ways to ensure that a JavaScript code runs only once within React components

I am working on implementing file upload with preview and here is the code for my component: const [uploadField, setUploadFiled] = useState() useEffect(() => { const temp = new FileUploadWithPreview('fileUpload', { multiple: multi ...

Automatically Importing in VSCode - A Guide to Enabling Full Path Imports for Material-UI

When utilizing the auto import function in VSCode to bring in Material-UI components, it defaults to a named import from the main file: import { Button } from "@material-ui/core" Nevertheless, I prefer the auto import to be a full path import li ...

Tips for controlling image sizes on larger devices while maintaining the appearance on Retina displays

I've been searching on the internet, but I got lost in complex explanations. I thought maybe someone here could help me out. :) I have a website with both mobile and desktop versions. Most of it looks good on different devices but there are some elem ...

When users visit my contact HTML page, they are redirected to the contact PHP page, but unfortunately, the email is

I am currently facing an issue with my contact form. After filling out the form and hitting the "send" button, it redirects to the contact.php page but fails to send an email or work as intended. Can someone please assist me and identify what's causin ...

The jQuery validation feature is failing to function properly within a bootstrap modal

I'm facing an issue with the jQuery validation plugin in my express app sign-up form that uses Bootstrap for the front-end. Despite setting rules and messages for name, email, and phone number fields, the validation is not functioning correctly. Below ...

I am wondering why the vue-router is only changing the URL and not displaying the corresponding view component

I've encountered an issue where the vue-router is only toggling the URL when clicking on the navigation link, but not updating the view component. Surprisingly, there are no apparent errors in my code. Despite this, the console indicates that the Home ...

Sapper neatly stacking pages one below the other

My sapper/svelte app has a strange behavior where when I navigate from my profile page to another page (such as the home page), the home page briefly loads underneath the profile page before displaying correctly. Here is what it looks like before clicking ...

The z-index property does not seem to function properly when used in conjunction

I am experiencing an issue with the z-indexes of two divs: one with default positioning and the other with a fixed position. No matter how I adjust the z-index values, it appears impossible to make the fixed-positioned element go behind the statically pos ...

What is a global variable used for in JavaScript?

Here is the code snippet that I am currently working on: $(".link").each(function() { group += 1; text += 1; var links = []; links[group] = []; links[group][text] = $(this).val(); } ...

Instructions on integrating the ng2-bootstrap Timepicker with new Forms

I've been working on developing a custom component that wraps the ng2-bootstrap timepicker module. However, I'm encountering some issues with getting the new Angular 2 FormControl to function correctly, even after updating to the latest version o ...

A guide to utilizing ng-model for binding data in table rows for inline editing

I am facing an issue with the getTemplate function in my AngularJS application. I have an object with 3 values empID, empName, empEmail and here is my code: var app = angular.module('myApp' , []); app.controller('myCtrl' , function($ ...

"How can I extract father's details by clicking on a button

After clicking, I need to access the parent element. Here is the HTML code I have: <button mat-icon-button (click)="download($event)"> The generated HTML code is as follows: <button _ngcontent-wsc-c153="" mat-icon-button=&q ...

Could you provide the parameters for the next() function in Express?

Working with Express.js to build an API has been a game-changer for me. I've learned how to utilize middlewares, handle requests and responses, navigate through different middleware functions... But there's one thing that keeps boggling my mind, ...

CSS problem: Chrome scrolling overflow glitch (ghost margin/padding)

Hey there, I've run into a bit of an issue with two divs containing tables - one acting as a header and the other as a scrollable content area. Everything is working perfectly except for this mysterious border/margin that keeps appearing in Chrome on ...

Extract the content of a div element and update its numerical value using Selenium WebDriver in Java

In Java, while creating test cases with Selenium, I am stuck at a point where I need to extract the text from a div element and increase its numeric value by 1 to use it for later comparison. For instance, <div id="some_id">#27</div> If the ...

The error message "ReferenceError: window is not defined" occurs when using npm clevertap-react in Next.js

Recently, I embarked on the task of integrating the Web SDK Quick Start Guide from CleverTap into my Next.js application. In my quest for the best approach, I came across packages like clevertap-web-sdk and clevertap-react on npm. Despite following the rec ...

Adding list elements within a bootstrap `<li class="list-group-item"> using JavaScript is a simple process

Bootstrap is giving me trouble when I try to add a list. The list ends up outside of my Bootstrap code instead... Here is the image of the output I am seeing: https://i.sstatic.net/XhXAw.png My Code: var title = document.getElementById('title&ap ...