Non-clickable image

My social media page icons are not hyperlinked, and I can't figure out why. I've surrounded them with the href attribute, but for some reason, it's not working. Can anyone provide assistance?

Here is the HTML code:

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<style type="text/css">
html{
height: 100%;
width: 100%;
top: 0;
left:0;
overflow: hidden;
}
.background{
position: fixed;
z-index: -1000;
width: 100%;
height: 100%;
overflow: hidden;
top: 0;
left: 0;
}
#background-video{
position: absolute;
top: 0;
left: 0;
min-height: 100%;
min-width: 100%;
}
.content{
position: absolute; 
width: 100%;
min-height: 100%;
z-index: 1000;
}
.content h1{
font-family:Comic Sans MS,  sans-serif;
text-align: center;
font-size: 200px;
text-transform: uppercase;
font-weight: 700;
color: #ffffff;
margin-bottom: 1px;
}
.content h3{
text-align: center;
font-size: 24px;
letter-spacing: 3px;
color: #ffffff;
margin-bottom: 1px;
}
img {
padding-left: 10px;
padding-right: 10px;
}
.social-media-icons{
z-index: 1000;
text-align: center;
display: block;
padding-top: 35%;
}
</style>
</head>
<body>
<div id="background" class="background">
<video id="background-video"autoplay muted loop>
<source src="background.mp4" type="video/mp4">
</video>
</div>
<div class="content">
<h1>A-T</h1>
<h3>ONLINE PORTFOLIO DESIGNED BY </h3>
</div>
<div class="social-media-icons">
<a target="_blank"  href=""><img class="facebook" src="facebook.png" alt="Facebook" width="40px" height="40px"></a>
<a target="_blank"  href=""><img class="twitter" src="twitter.png" alt="Twitter" width="40px" height="40px"></a>
<a target="_blank"  href=""><img class="LinkedIn" src="linkedin.png" alt="LinkedIn" width="40px" height="40px"></a>
<a target="_blank"  href=""><img src="googleplus.png" alt="Google Plus" width="40px" height="40px"></a>
<a href=""><img src="email.png" alt="Email" width="40px" height="40px"></a>
</div>
</body>
</html>

The provided HTML code displays the social media icons without hyperlinking. Could this be due to the z-index property? I am uncertain at this point.

Answer №1

Here's the solution you've been looking for:

The issue lies in your content height being set to min-height:100%, causing it to overlap with your social media divs.

To make them clickable, adding a z-index is correct, but without positioning, z-index won't take effect. Setting position to relative will resolve this and ensure they appear as intended. Additionally, make sure to include a destination in the href tags.

.social-media-icons{
   position:relative;
   z-index: 1000;
   text-align: center;
   display: block;
   padding-top: 35%;
}

Answer №2

Make sure to include a specific destination within the href attribute for every a tag.

<a target="_blank"  href="https://www.instagram.com"><img class="instagram" src="instagram.png" alt="Instagram" width="40px" height="40px"></a>

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

Adjust my website to fit various screen sizes and mobile devices

I'm encountering an issue on my website regarding resizing elements and content on various resolutions, particularly on mobile devices. You can view the website here. I've been testing it on both an iPad and a 14" laptop. While everything appear ...

I don't understand why my BeautifulSoup code is throwing an attribute error even though the variable it's referring to is assigned a value

Currently, I am working with Python 3.9.1 along with selenium and BeautifulSoup to develop my first web scraper targeting Tesco's website. This is essentially a mini project that serves the purpose of helping me learn. However, upon running the code p ...

Learn how to customize the global style within a child component in Angular and restrict the changes to only affect that specific component

I have applied some custom css styling in my global style.css file (src/style.css) for my Angular project. However, I encountered a problem when trying to override this styling in a specific component without affecting the rest of the project. Currently, I ...

Combine and interchange horizontal and vertical form designs within antd 5 for a personalized touch

I need to customize the layout of a form to display checkboxes in vertical mode. Specifically, there is a row of checkboxes that I want to appear vertically aligned rather than horizontally. In the past, I was able to achieve this in antd 4 by applying a ...

Utilizing block buttons within a div containing a Bootstrap button group

My dilemma is trying to center a button group within a container while also making each button occupy half of the container's width. I've attempted using "w-50" and "btn-block," but they don't seem to work when in conjunction with "btn-group ...

Is it possible to utilize X-Y coordinates as repositories for values beyond just X-Y coordinates themselves?

I am in the process of creating a tile-based grid and I need to expand the X-Y coordinates to include additional values for determining characteristics of each tile, such as resources (for example, food, water, stone, lumber) within a game context. Conside ...

What are some successful methods for displaying extensive data lists to users in a meaningful and organized manner?

From dropdown lists to hover menus with fly-out options, there are various ways to present content on a website... I am managing a comprehensive list of U.S. military bases across the world for my website. This list includes both active and inactive bases ...

What kind of GWT component features both a Button and text?

I am looking to develop a customized GWT widget that consists of a rectangular div element resembling a button, accompanied by text positioned adjacent to it. My goal is to enable the selection of this widget so that clicking on either the div/button or th ...

Tips for utilizing the output of a pre-defined function within another function in SASS

How can I effectively utilize the outcome of darken( $var, 10% ) in the SASS function oppositeColor( $darkenedColor )? The code I am working with currently looks like this: $color1: #000000 !default; $color2: darken( $color1, 5% ) !default; $color3: oppos ...

Steps for stopping the sass --watch function on a specific folder

Successfully got my SASS up and running with the help of fantastic documentation available everywhere. The guide I followed was http://sass-lang.com/guide. sass --watch myfolder/css Running a specific command worked like a charm, enabling every change in ...

What is the best way to choose all <pre> tags that have just one line of content?

$('pre:contains("\n")') will target all <pre> elements that have one or more newlines. Is there a way to specifically select <pre> tags with no newline or only one at the end? Any shortcuts available? match <pre>A< ...

Avoiding Overlapping DIVs: Tips to Keep Your Elements in Place

Instead of using table-based layout, I have decided to go with a DIV-based layout in order to streamline the markup and improve page load speed. However, as I am not an expert in CSS, I find it quite challenging. Below are the CSS classes I am currently us ...

Is it possible to move between textboxes using arrow keys in HTML?

Is there a way to navigate through textboxes using arrow keys in HTML without relying on jQuery? Possibly utilizing JavaScript, HTML, CSS, or another method? Thank you for your help! <body> <form> <input type="text"&g ...

Implement a customized toString method for components in ReactJS

Looking to modify the toString method of a class component in reactjs? Check out the code snippet below class C1 extends React.Component{ render(){ return ( <div> {C2.toString()} </div> ) } } class C2 extend ...

CSS: The Drop Down menu suddenly vanishes every time I attempt to select an item from the visible list

I'm facing an issue with my dropdown menu that I can't seem to resolve. Whenever I hover over the menu, it disappears before I can even click on any items. <ul id="menu"> <li><a href="#title">Home</a></li> ...

Align Bootstrap 4 dropdowns with their parent element

Is there a way to match the width of a bootstrap dropdown menu with its parent input group? <div id="ddl_1" class="input-group"> <input type="text" class="form-control "> <div class="input ...

Bootstrap - the input group button is designed to align to the right side

Currently, I am in the process of constructing a navigation bar for a website that includes a search bar and a grouped button. Everything functions properly when viewed on a desktop, but as soon as I switch to mobile view and the collapsible menu is activa ...

The fixed positioned div with jQuery disappears when scrolling in Firefox but functions properly in Chrome, IE, and Safari

Click here to see a div located at the bottom of the right sidebar that is supposed to behave as follows: As you scroll down the page, the div should change its class and become fixed at the top of the screen until you reach the bottom of the parent el ...

Menu options displayed with the help of HTML5 tags

Currently, I am experimenting with creating an interactive HTML5 dropdown menu in my spare time. While researching on W3Schools about dropdown menus, I noticed that all of them utilize CSS classes and id's for styling. This is a snippet of the HTML c ...

Troubleshooting a problem with scrolling functionality while keeping the header in place and ensuring the correct tab is highlighted

I've successfully created a page with a fixed menu that appears when scrolling, and the tabs activate based on their corresponding section IDs. However, I'm encountering some issues: The scrolling behavior is not precise; when scrolling to sec ...