Why are the icon links on my page not respond to clicks? - html

And by not working, I don't mean that they don't load the page they're connected to. I mean the browser apparently doesn't even see them. Clicking does nothing, no change to the cursor on hover, right-clicking gives no options for "Open link" or "Open link in new tab". It's like they're not even there.
I've tried this in multiple browsers and on multiple devices. Same problem.
The links are written like so:
<div className={`${styles.listItem} ${styles.spotify}`}>
<a
className={styles.link}
href="https://open.spotify.com/artist/01MMcY0GSuDXOTUhyt4ung?si=YIgtCiw5SR26TejkA7dOcg&utm_source=copy-link&nd=1"
target="_blank"
/>
</div>
The only thing I could think to do was wrap the in the tags instead of the reverse. That only breaks it further. The icon won't even show up that way. I've tried inspecting the icons with dev tools, and the tags with the correct hrefs are there.
Here is the most recent version of the site. The problem is with the social media icons in the Contact section at the bottom of the page.
https://kmac-website-g8cm3chxl-a-shotwell.vercel.app/
And here is the code for the entire component:
import React from "react";
import styles from './Social.module.css'
const Social = () => {
return (
<div className={styles.main}>
<h1 className={styles.banner}>REACH OUT.</h1>
<div className={styles.socialContainer}>
<div className={styles.listContainer}>
<div className={`${styles.listItem} ${styles.spotify}`}>
<a
className={styles.link}
href="https://open.spotify.com/artist/01MMcY0GSuDXOTUhyt4ung?si=YIgtCiw5SR26TejkA7dOcg&utm_source=copy-link&nd=1"
target="_blank"
/>
</div>
<div className={`${styles.listItem} ${styles.facebook}`}>
<a
className={styles.link}
href="https://www.facebook.com/MixITMac"
target="_blank"
/>
</div>
<div className={`${styles.listItem} ${styles.instagram}`}>
<a
className={styles.link}
href="https://www.instagram.com/kmacxkmc/"
target="_blank"
/>
</div>
<div className={`${styles.listItem} ${styles.twitter}`}>
<a
className={styles.link}
href="https://twitter.com/KTHAMC1"
target="_blank"
/>
</div>
</div>
</div>
</div>
);
};
export default Social
Any help would be appreciated. Thanks.

I figured it out. The problem was that the links had no text, and the CSS was not set to take up 100% of the space of the containing div. So there was nothing to click on.
.link {
display: block;
height: 100%;
width: 100%;
}
This fixed the problem. I must have deleted the relevant CSS in a past version and wasn't aware of the problem until now. Thanks anyway, guys. Hope someone learns from my mistake.

Related

How to move one HTML element below another with CSS

I am working with a 3rd party support provider and am trying to work around some limitations around what can be customized. I would like to add an HTML element (a) below a label, but only have access to css and footer html. My current idea is to add a hidden anchor in the footer and then try to reposition it via the css. I guess this MIGHT be possible with flexboxes, but my css foo is not that strong. So I figured I would come here and see if there was any way around it.
Concretely, I have a multiline textbox where users will enter their support request, and I need to insert an href to what can be asked right above it. I already have a ::before in place for some basic helper text, but I know that you cannot insert markup using css...thus my current attempt.
Is this even possible without knowing the specific location of each item...only their respective identifiers?
Here is a jsfiddle that reproduces the page as minimized as I can get it.
Again, please note that I ONLY have the ability to add HTML to the bottom of the page (in the footer element), and a global css file (shown in the separate css). That means I cannot edit the html outside the footer - that would be too easy ;)
HTML
<html id="portal_html"><head>
</head>
<body>
<div id="container">
<portal>
<div data-id="ticketForm" id="layoutContainer">
<div>
<div>
<div><h2>Submit a ticket</h2></div>
<div id="field_description">
<label for="description"><!-- react-text: 1235 -->Description<!-- /react-text --></label>
<div>
<div>
<div data-id="description">
<div id="description"><iframe name="deskEditor_New"></iframe></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer id="footerContainer"><div id="footerContainer"><div class="Footer__footerCopyrigt">
<div class="Footer__container2">
<span>Powered by </span>
<a rel="noopener noreferrer" href="supporturl" target="_blank" class="Footer__footerLink">Support Provider</a>
<span> | </span>
<a rel="noopener noreferrer" href="terms" target="_blank" class="Footer__footerLink">Terms of Service</a>
<span> | </span>
<a rel="noopener noreferrer" href="privacy" target="_blank" class="Footer__footerLink">Privacy Policy</a>
<a rel="noopener noreferrer" href="foo">target</a>
</div>
</div>
</div></footer></portal></div></body></html>
and current css:
.ticketDetail .ConversationForm__list+.ConversationForm__list { display:none; }
div[data-id="description"]::before {
content: "Some custom content";
font-size: smaller;
}
label[for="description"], a[href="foo"]{
order:-1;
}
body {
display:flex;
flex-direction:column;
}
UPDATE
I found this SO that sadly shows flexbox will not work because they are not in the same heirarchy :/
....so I believe the answer is that this is not possible :(
Can you use JS?
const textAreaWrapper = document.querySelector('.text')
const linky = document.querySelector('[href=linky]')
document.body.insertBefore(linky, textAreaWrapper)
.someclass {
display: block;
}
.rest {
display: block;
}
.text {
display: block;
}
<span class="someclass">
<label>foo</label>
</span>
<span class="text">
<textarea></textarea>
</span>
<label class="rest">more stuff</label>
<label class="rest">even more stuff</label>
Here is a link I want above the textarea

img not showing up inside div

Here's my code
<div class="table">
<div class="tr">
<div class="td">
<h1 class="logo-fill">
<a href="#" title="Logo">
<img alt="logo" src="./images/logo.png" />
</a>
</h1>
</div>
<div class="td">
<a href="#" title="AdSpace">
<img alt="adspace" src="./images/adspace.png" />
</a>
</div>
</div>
</div>
For some reason, the second image (adspace.png) is not displaying at all. If I remove the entire img tag and replace it with text, the text is displayed. Alternativly if I change the img tag to:
<iframe src="https://clients.ragezone.com/out.php/display/show_custom?id=48" scrolling="no" style="padding: 0px; overflow: hidden;" width="468px" height="60px" frameborder="no"></iframe>
Apparently that works as well. adspace.png is simply a 468px x 60px green box.
My money would be on the fact that you have an adblocker in your browser. Try changing class names and img name.
Adblocker plugins search for certain keywords in the code and block the page elements based on that.
In your image source path I saw one [dot] miss placed that may be a one problem.
This is your code
<img alt="adspace" src="./images/adspace.png" />
And try with this one
<img alt="adspace" src="../images/adspace.png" />
And other problem is your image name I also faced to this issue your image name is adspace.png and you added alt="adspace" and wrap it with link tag having the title with Adspace so the reason is some of plugins in your browser block all the images and divs starting with "ads / ad" this is called adblock plugins.
So you can easily change your img name and change everything starting with "ad" then you can find some useful fixing. Other way is you can remove the adblock plugins from your browser.
And please check your network too some networks admin can block ads too.

Changing the Header Background

I have a forum # http://forum.banaisbul.com
If you check the site you can see there's a problem with the header background. I want to change the entire header background to the color of the logo background. But I don't know which codes to put where.
Matthew Rath gave you the correct answer to the problem that you wrote. But the bigger problem that you have revealed is that you do not know how to use your resources. Take some time and learn to use your web developer tools (web inspector, etc). Then you can solve these issues quickly by yourself.
It's #404040 - Tested in Photoshop:
HTML:
<div style="background-color: #404040;">
<a href="http://forum.banaisbul.com">
<img src="http://forum.banaisbul.com/wp-content/uploads/2014/09/banaisbulsiyah.jpg" border="0" alt="Link to this page">
</a>
</div>
Photoshop Image:
From the looks of it you can simply add some CSS to the div that contains the header image.
<div class="imgheader">
<img src="http://forum.banaisbul.com/wp-content/uploads/2014/09/banaisbulsiyah.jpg" border="0" alt="Link to this page">
</div>
Then in your CSS file out could do
.imgHeader{
background-color: #3D3D3D;
}
Alternatively,
<div style="background-color: #3D3D3D">
</div>
The hardest part will likely be matching the CSS color hex code (e.g. #3D3D3D) to your image. You may want to look here to try to get an exact match : Paletton.com
You need to style the container div which currently has no selector assigned to it:
http://puu.sh/blDRr.png
This being the case you could do:
.cnt-container > div {
background-color: "your colour"
}
you could also add it directly in your page-template (this is called 'inline styling'):
a couple of lines below your opening body tag you'll find
<div>
<img src="http://forum.banaisbul.com/wp-content/uploads/2014/09/banaisbulsiyah.jpg" border="0" alt="Link to this page">
</div>
and you need to change it to
<div style="background-color:#404040">
<img src="http://forum.banaisbul.com/wp-content/uploads/2014/09/banaisbulsiyah.jpg" border="0" alt="Link to this page">
</div>

Strange Black Bar Appearing HTML

I am trying to create a link section in a HTML document. I have a couple links containing images. The code is here: http://jsfiddle.net/u6Tmt/. As you can see after the SO image there is a little black bar which looks almost like an underscore. What is causing this black bar to appear and how do I get rid of it?
In case you don't know what I'm talking about, here is an image to help:
Also here is another copy of the code:
<div id="links">
<a href="http://stackoverflow.com/users/1916721/cabellicar123">
<img src="http://cdn.sstatic.net/stackoverflow/img/favicon.ico" alt="stack overflow">
</a>
<a href="https://github.com/cabellicar123">
<img src="https://assets-cdn.github.com/favicon.ico" alt="github">
</a>
</div>
The bar is the default underline of hyperlinks.
Add this rule to your CSS stylesheet to get rid of it
DIV#links A { text-decoration: none; }
I wouldnt have thought it an issue but if you change
<img src="image URL" alt="stack overflow">
to
<img src="image URL" alt="stack overflow"/>
and remove all spaces in the
<A>
your fiddle fixes
Edit: This & cobra_fast's answer
There seems to be a space in your first a-tag and the hyperlink is underlining it. When you use the a-tags with images, put it on the same line and it seems to work:
<div id="links">
<img src="https://cdn.sstatic.net/Sites/stackoverflow/img/favicon.ico" alt="stack overflow">
<img src="https://web.archive.org/web/20190109105720/https://assets-cdn.github.com/favicon.ico" alt="github">
</div>

Change Background Image on NavBar Click

I have to admit I'm very new to this, but I'm building a website based on a template am just about done except for one thing! I'm trying to get the background to change to a different image when a user clicks on a nav bar item and a different part of the site pops up.
If it's helpful, this is the website: www.pitchadvisor.com
Currently, my nav bar links are set up as follows:
<span></span>What</li>
I tried the following change but it didn't work:
<a href="#!/page_about" onclick="document.getElementById('test').style.backgroundImage='url(http://www.pitchadvisor.com/images/bg2.jpg)'; return false;" >
Any help would be greatly appreciated!!
Thanks!
Its not working because, your background is set in html not css, heres what i came up with to possibly fix it:
Change line 78 of the html from
<div id="bgStretch"><img src="http://pitchadvisor.com/images/bg.jpg" alt=""></div>
to
<div id="bgStretch"><img id='bgimage' src="http://pitchadvisor.com/images/bg.jpg" alt=""></div>
and change your javascript from
<a href="#!/page_about" onclick="document.getElementById('test').style.backgroundImage='url(http://www.pitchadvisor.com/images/bg2.jpg)'; return false;" >
to
<a href="#!/page_about" onclick="document.getElementById('bgimage').setAttribute('src', 'http://www.pitchadvisor.com/images/bg2.jpg');" >
Let me know if this works for you, or anything else i can do.
Will this help?
<a href="#" onclick="javascript:document.getElementById('asd')
.style.backgroundImage='url(http://www.pitchadvisor.com/images/bg2.jpg)';">
Click Me </a>
<div id="asd" style="margin-top:50px; width: 100px; height: 100px; border: 1px dashed green;"></div>
Try it here: http://jsfiddle.net/dTAW3/