I am trying to add a background-image to "a" links inside a "div" but the image is not being displayed.
I also tripple checked the img path and it is ok.
What I tried is the following:
div a[href^='htt'] {
margin-left: $basismarge*4;
background-image: url("../../public_html/oefeningen/images/www.png");
}
This is a part of the index.html code:
<div>
<div>
<h1>CSS3 Oefening 1</h1>
<span>Welkom</span>
</div>
<div>
<h2>© Thomas More</h2>
</div>
</div>
<p><i class="fas fa-home fa-3x"></i></p>
</body>```
With this I would have expected that the image would be showing.
It should work fine and it does with my own image. Try using an external image address to validate. Most probably there is something wrong with your url path. Check the Network tab in the Development tools to see if you're actually fetching the image properly.
If the path is valid and you're fetching the image properly after all, check if the image is not actually displayed but blending in with the styles you have for the link and its parents(for example the image upper left corner and the anchor element both have white background).
Related
I am trying to build a portfolio website, with a moving gallery but the image is not displayed, it shows the alternative image instead. Any help is appreciated.Here is the code:
<div class="section1">
<img class="imgr"src="photo_1.jpg" alt="nothing">
</div>
I even copied the relative path from Vscode, but it is still not working.
It must be the path to the image. Try replacing "photo_1.jpg" with "./photo_1.jpg".
I am trying to add a logo to my webpage. I am using CSS and eclipse. The image shows as a broken image and I am not sure why. The image I am trying to use is in the folder specified :
Does it need to be added in CSS or can someone please help me to know where I am wrong. Thank you.
<body>
<div class="jumbotron">
<h2 style="text-align: center; color: white;"> New Plan </h2>
<a href="#">
<img src="resources/img/logo.png">
</a>
</div>
</body>
This wouldn't be a css issue if the browser is showing the broken link icon. That icon means the path to the file is incorrect or it can't retrieve it.
To confirm this, take resources/img/logo.png and add it to the end of the URL where your HTML is, excluding any files. For instance, if your URL is http://example.com/index.php, you want to make the URL read as http://example.com/resources/img/logo.png, without the index.php.
You will need to tweak this URL until the image shows up in the browser, since you didn't provide a URL where the HTML is running. When that happens, the URL in the address bar is the one you can use for the image URL.
My website runs on Concrete5.
I wanted to add some more Font Awesome icon to an existing page, but it's not showing. Strange thing is, there already are icons on my webpage and they are showing...
However when I edit the block with the icons in it to check the HTML, there is no HTML/CSS saying the icons should be there!
When I add an icon in the content block in HTML, nothing shows. But when I add an icon with an HTML block it does show.
For instance the tree columns underneath the green picture show three green check boxes.
And this is what the content block says is in the block:
<p>Sessie 1</p>
<p>Analyse van je proces van vliegangst en je omslagpunt</p>
<p>Stoppen van de angst, piekeren en vervelende herinneringen</p>
<p>Praktische oefeningen voor thuis</p>
See the website here
As you can see, there is no font-awesome css in there. But icons are showing on the webpage. The css is also showing when you check the html of the page.
Now, if I would put
<p> <i class="fa fa-camera-retro"></i> test</p>
In the same block (a content block, in the html window). It won't show a camera. It would just show "test".
If I then go back to the content block and see what's in the html, it says
<p>test</p>
Now if I would put the same line of code in an HTML block, it does show the camera icon.
So there are two things happening:
Older font-awesome icons are showing on the webpage but not in the content blocks html.
New font-awesome icons can't be added through html in content blocks, but can in HTML blocks.
Edit: When I use this code:
<p class="fa fa-camera-retro"></p>
It does show in the content block. But then I can't simply add a symbol with some text, because the font will be from the font-awesome font.
the <i> tag still isn't working.
so
<i class="fa fa-camera-retro"></i>
Gives nothing.
The icons only appear when there's text between the code:
<i class="fa fa-camera-retro">foo</i>
However, the editor changes the <i> tag then to an <em> tag. And 'foo' then has the font-awesome font. Not the font of my website.
****SOLUTION****
If I do it like this:
<p><i class="fa fa-camera-retro"> </i> some text</p>
Everything works as I want.
Still, all the older font-awesome css from the website is missing from the content blocks, but it is rendering when I view the website in a browser. If anyone has a suggestion how that can be fixed?
Ahh, I think I see your problem. You entered a new HTMLblock, and just pasted in the fa-camera-retro. FontAwesome works as a class and should be entered within a tag.
You can use the <i> tag for it, but also the <p> tag or whatever you want. It should be then something like
<i class="fa fa-camera-retro"></i> (dont forget the extra fa class to make it appear as a font awesome.
It's also worth remembering for the future that when you use the content block, TINYMCE automatically strips out some HTML tags by default, this includes <i>'s... To prevent TINYMCE from doing this, go to:
Dashboard > System & Settings > BASICS / Rich Text Editor. Once there, select 'Custom' and add the following line
verify_html: false
For more information, it's worth keeping this in your bookmarks when using Concret5, especially the content block: http://www.tinymce.com/wiki.php/Configuration3x:verify_html
I saw this on your page:
It should be <p><i class="fa fa-camera-retro"></i> some text</p>
Result:
So basically what you need to so is just change this
<p>fa-camera-retro</p>
to this
<p><i class="fa fa-camera-retro"></i> some text</p>
The trick to adding FontAwesome icons in C5 Content blocks is using the em tag along with adding code for non-breaking space between them.
<em class="fa fa-camera-retro"> </em>
Check if you have given your icon any sort of margin, I had the same problem where some icons would make when I checked keenly I noticed I had a CSS rule.
p i{
margin-left:10px;
}
when I removed that margin all my icons worked.
I have a simple website, as I'm a beginner programmer. I inserted a <p> tag, which worked all fine and dandy. There was two words in the paragraph which I wanted to link to a different page on my website, and it decided it didn't want to work. I don't know why it didn't work, because I have <div> tags in the same document to the same page that were working fine.
Edit: To define what wasn't working: It wasn't clickable. It changed color, like a normal hyperlink tag should, but was just a piece of text. You just couldn't click it. Even tags with an invalid or nonexistent href should be clickable. Right? Maybe I'm wrong, again, I am a beginner.
The other strange thing was that in my CSS file, I had the text-decoration set to none, so it shouldn't have changed color in the first place.
CSS:
a{
text-decoration:none;
}
This is the HTML that I had an issue with:
<p id="p1">Ingsoc is the Newspeak word for English Socialism. (For more on Newspeak, see the Ministry of Truth page.)</p>
And here's an example of a link with the same destination that worked just fine:
<a href="TruthPage.html">
<div id="minitrue">Ministry of Truth</div>
</a>
Instead of
<a href="DifferentPage.html">
try
<a href="http://www.yoursite.com/folderpath/DifferentPage.html">
where 'yoursite.com' and 'folderpath' are changed to match your situation.
The code looks ok to me. You could try...
<p />
<div>This is just basic text that was doing what it was supposed to. This was the text that I wanted to link to a different page.
</div>
if it's working within a div tag
Your problem is that your href="DifferentPage.html" is not vailid. My suggestion is to open that other page on your site, then copy the location in the address bar.
I'm working with HTML that was already built; all the pictures will work with my local machine except for the images in the slideshow.
This is the code that works:
<div class="backgroundImage" id="homePageBanner2" style="background:url(http://demandware.edgesuite.net/aajh_prd/on/demandware.static/Sites-beats-Site/Sites-beats-Library/default/v1355443668325/images/homepage/2-seasonal-pill-gap_2400x650.jpg) center 0 no-repeat;">
<img src="http://demandware.edgesuite.net/aajh_prd/on/demandware.static/Sites-beats-Site/Sites-beats-Library/default/v1355443668325/images/homepage/2-seasonal-pill-gap_2400x650.jpg" style="display:none;" />
</div>
This won't, it just shows up black. (Keep in mind this format works for all the other pictures in this html.)
<div class="backgroundImage" id="homePageBanner1" style="background:"../demandware.edgesuite.net/aajh_prd/on/demandware.static/Sites-beats-Site/-/default/v1355443668325/images/MainImage2.png") center 0 no-repeat;">
<img src="../demandware.edgesuite.net/aajh_prd/on/demandware.static/Sites-beats-Site/-/default/v1355443668325/images/MainImage2.png" style="display:none;" />
</div>
"background:"
Could be that you end your style right after you specify background:
You have 2 image references here, one in the markup and one in the CSS style. Not sure, what the point is of that.
If the style argument is really broken in the code, which is what appears to be the case from what you pasted, it is possible that the image sits in the document root and the CSS sits in a subfolder, so that only the relative URL for the background image works if the HTML file is also in the root. The image tag source URL would point to one folder above the root in the hierarchy and that's probably not where the image is. Because the background image CSS is broken in the local version, neither image appears.
style="background:"../demandware.edgesuite.net/aajh_prd/on/demandware.static/Sites-beats-Site/-/default/v1355443668325/images/MainImage2.png") center 0 no-repeat;"
Did you mean:
style="background:url(../demandware.edgesuite.net/aajh_prd/on/demandware.static/Sites-beats-Site/-/default/v1355443668325/images/MainImage2.png) center 0 no-repeat;"
If you are in business manager
src="/images/homepage/2-seasonal-pill-gap_2400x650.jpg?$staticlink$"
if this is in an isml file
src="${URLUtils.staticURL('/images/homepage/2-seasonal-pill-gap_2400x650.jpg')}"
Is the most consistent for all instances (dev, stg, development, and prod)