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>
Related
i decided to make redirects with images but i have small problem.
Look at this screen:
https://i.stack.imgur.com/eEnNB.png
This is this item:
<p><div><a title="Home" href="/home"><img src="/icons/home.svg" width="55" height="55" /></a></div></p>
It shows strange rectangle, i dont want to show it. Do you have any ideas?
That outline is an accessibility feature (Which might be added as part of a CSS theme, but hard to know without the full context of the codebase). However, removing it is not a good idea, as it will worsen the experience for people with visibility impairment (Check http://www.outlinenone.com/).
What we can do, however, is make it look better. You have a <div> with a <a> nested in a <p>, it being the reason for the rectangle not encasing the whole icon and instead overlapping on top of it, as it believes it to be an inline element (Ideally, you don't want to use block elements in p tags). Here, you're getting block elements, such as a <div> and an <img> inside of the <p>). So what I recommend is:
Remove <p> and <div>, and leave it only wrapped in the <a>
Add the display: inline-block CSS property to the <a> tag, resulting in:
<a style="display:inline-block;" title="Home" href="/home">
<img src="/icons/home.svg" width="55" height="55" />
</a>
If you want a block element, simply remove the <p> tag:
<div>
<a title="Home" href="/home">
<img src="/icons/home.svg" width="55" height="55" />
</a>
</div>
Without full context it will be difficult to answer but:
Try to set a element display:block or display:inline-block
Try to set IMG width and height as style="width:55px;height:55px"
Add display: inline-block to the <a> tag
<p>
<div>
<a style="display:inline-block" title="Home" href="/home">
<img src="https://media.istockphoto.com/id/1357549139/photo/shot-of-an-adorable-baby-boy-wearing-a-hoody-towel.webp?s=612x612&w=is&k=20&c=MvuPLKqQhs7f6ZIsPf8oTgw08OiCvmmjJNeNdL0FG4M=" width="55" height="55" />
</a>
</div>
</p>
I have this image: http://fs5.directupload.net/images/160602/xfrddbfa.png
and I would like to add it into my website. But, I'd also like to add a small gap in between each and every flag.
Is that somehow possible? Here is the HTML where I'd like to place it as a pseudo element before the class "headline":
<div class="bottom_dual">
<a title="title" href="#">
<span class="headline">Lorem ipsum</span>
</a>
<span class="caption">Lorem ipsum.</span>
<span class="more">
<a class="teaser_link" href="#">more</a>
</span>
</div>
Thanks for your help!
Image editing isout of the scope of HTML/CSS and I would really suggest just making separate images using image editing software for each flag if this is what you intend to do, but I will provide an ugly work around if you truly wish to do this.
Also, I'm not sure you're using pseudo element correctly.
Place the image tag 5 times - 1 for each flag.
<img id="flag1" src="example.com" />
<img id="flag2" src="example.com" />
<img id="flag3" src="example.com" />
<img id="flag4" src="example.com" />
<img id="flag5" src="example.com" />
Use CSS to crop each image to each flag.
#flag1{
position: absolute;
clip:(rect, 0px, 30px, 20px, 0px); // Position of the flag
}
etc..
I hate myself for even giving that answer. Seriously, just edit the image.
The best way to solve this problem is to use photoshop..
Cut your 5 flags out from that one single image
Then move them (space them )...
Links which You could refer to:
https://www.youtube.com/watch?v=6aMbMk9IGoM
https://www.youtube.com/watch?v=VTHudF4fo2I
The above links explain you on how to cut (crop ) an image and to move them..
Hope this helps you..
use this style :
.headline:before{
padding-left:30px;
background:url(http://fs5.directupload.net/images/160602/xfrddbfa.png) no-repeat -66px 0px;
content:" ";
}
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.
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>
It seems like a simple problem but whatever i did i couldn't solve it. I post a link about what i am talking. http://www.olmasigereken.com/demo/?view=listen&artist=ibrahim+ferrer&track=dos+gardenias
If you look at page codes you will see that order of items is red arrow artistname dash(-) trackname twitter and facebook links. However the output is not like that. I want to put everything on one line with correct order which is red image artistname dash trackname twitter and facebook links.
Note: When you click it if you don't see anything please refresh the page.
<li>
<img src="img/track_arrow.gif" alt="" />
<div class="singer">
<?php echo $a[artistname]?>
</div>
-
<div class="song">
<?php echo $a[trackname]?>
</div>
<div class="fav">
<a target="_blank" href="#" /><img src="img/twit.gif" alt="share on twitter" /></a>
<a target="_blank" href="#"> <img src="img/face.gif" alt="share on facebook" /> </a>
</div>
<br />
</li>
The floating left of links inside is causing conflict. If you remove the float: left as seen in the following screenshot, I think you will get what you want...
You need to set some css propertys like
.ikinciSol ul li {
widht: 375px;
}
.fav{
float: right;
}
Hope this may helpful to you.
try this to put each element between li balises and use the css attributewith ul element: list-style-type:none;