I am trying to write a simple HTML page and I want to put my css and my favicon in another folder, put this does not work.
<link rel="shortcut icon" type="image/x-icon" href="../other/home.ico" />
<link rel=stylesheet href="../other/home.css" />
when I use this code, it doesnt find the right file even though i think it is the right way to write it.
my HTML file is in the folder: (E:\website\transendence) while my css and favicon is in: (E:\website\other)
Related
I am making a website and there is an error.
It won't show the website icon.
Proof: https://i.stack.imgur.com/053Xh.png
Code:
<link rel="icon" href="images/favicon32.ico" type="image/x-icon"
You are not closing the link tag add this " /> " at the end
<link rel="icon" href="images/favicon32.ico" type="image/x-icon" />
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
Do the following things.
Please close you link tag by adding "/>"
For good practice, first move favicon in main/root folder, not in inner folders, to load it fast
Change your favicon file name into "favicon" and its extension must
be "ico" not icon. Please see the file name carefully.
<head>
<title><!--i want to add a picture into the title--></title>
</head>
plz help me guys I'm creating a website only using html. I want to know how to add a picture into the title which is shown in the browser
Title is used to display the page title as text.
You should use the balise below to display an icon named logo.png for example:
<link rel="icon" type="image/png" href="logo.png" />
You actually need to add a favicon to a website.
<link rel="icon">
Simply add the following code to the <head> element:
<link rel="icon" href="http://example.com/favicon.png">
What you're looking to add is actually a called a favicon. It is a tiny image you'd like to add next to the title of your website.
See this article for more info on favicons: https://www.abeautifulsite.net/what-are-favicons.
Some things to consider (taken from the article)
The most common sizes for favicons are:
32x32
48x48
64x64
-128x128
You can use a favicon generator to turn your image into the proper format and download it.
Insert the following code into your head after downloading your favicons and placing them in the directory of your html website.
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
Make sure you use an icon file with sizes as mentioned by #Joshua. Insert the following code.
<link rel="icon" href="....logo.ico?v=2" />
You will need to add ?v=2 query string to force a refresh. Otherwise you might have cache issues.
The image next to the page title in the browser tab - how can you link an image here?
That image is called 'favicon' and it's a small square shaped .ico file, which is the standard file type for favicons. You could use .png or .gif too, but you should follow the standard for better compatibility.
To set one for your website you should:
Make a square image of your logo (preferably 32x32 or 16x16 pixels, as far as I know there's no max size*), and transform it into an .ico file. You can do this on Gimp, Photoshop (with help of a plugin) or a website like Favicon.cc or RealFaviconGenerator.
Then, you have two ways of setting it up:
A) Placing it on the root folder/directory of your website (next to index.html)
with the name favicon.ico.
or
B) Link to it between the <head></head> tags of every .html file on your site, like this:
<head>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
</head>
If you want to see the favicon from any website, just write www.url.com/favicon.ico and you'll (probably) see it. Stackoverflow's favicon is 16x16 pixels and Wikipedia is 32x32.
*: There's even a browser problem with no filesize limit. You could easily crash a browser with an exceedingly large favicon, more info here
It is called 'favicon' and you need to add below code to the header section of your website.
Simply add this to the <head> section.
<link rel="icon" href="/your_path_to_image/favicon.jpg">
This is the favicon and is explained in the link.
e.g. from W3C
<link rel="icon"
type="image/png"
href="http://example.com/myicon.png">
Plus, of course the image file in the appropriate place.
Add a icon file named "favicon.ico" to the root of your website.
<link rel="apple-touch-icon" sizes="114x114" href="${resource(dir: 'images', file:
'apple-touch-icon-retina.png')}">
or you can use this one
<link rel="shortcut icon" sizes="114x114" href="${resource(dir: 'images', file: 'favicon.ico')}"
type="image/x-icon">
ADD THIS
**<HEAD>**
< link rel="icon" href="directory/image.png">
Then run and enjoy it
Is it possible to have this code:
<link rel="icon" href="icon.gif" />
Using css document?
(I would rather not have to go through and add that to every pages)
and is it possible to set title of page using css(I am not gonna use it as all pages have different title but just for general info)
You cannot set the favicon using CSS.... You need to use a link tag with rel value of shortcut icon.
Inorder to set that, you need to put the below string in between the <head> tags..
<link rel="shortcut icon" href="favicon.ico" />
-----^-----
<!--Remember to have .ico as the extension else
some browsers fail to load other extensions -->
You need to also specify the type attribute here type="image/x-icon" if IE fails to load your favicon, if it loads fine, you can just ignore the type attribute.
You can't do it using CSS it can only be done by inserting
<link rel="icon" href="icon.gif" />
as you have described above..
CSS is used to format some text/images etc in the page and and there is nothing to format in icon let me guess if you are working on many pages you probably have either a blog or an script to generate pages just add this line of text in it..
And you can always change icon of each page at once by just changing the icon itself...:)
You can't set a favicon from CSS - if you want to do this explicitly you have to do it in the markup as you described.
Most browsers will, however, look for a favicon.ico file on the root of the web site - so if you access http://example.com most browsers will look for http://example.com/favicon.ico automatically.
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
In href, you have to pass the image url.
Here is the combination of combination of .ico and .gif image
<link rel="shortcut icon" href="favicon.ico">
<link rel="icon" type="image/gif" href="animated_favicon1.gif">
I am trying to upload a favicon in my wordpress site. I have followed every step correctly but still its not showing the favicon. Fisrt I converted my pic to favicon.ico . Then I uploaded it to my root directory. Then I added the following code to my header.php file in the <head> tag :
<link rel="shortcut icon" href="http://misspassiton.com.au/favicon.ico" />
I have tried this one as well
<link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" />
I have also visited : http://codex.wordpress.org/Creating_a_Favicon
but nothing seems to be working. I dont know whats wrong with it. I would be grateful, if anyone could help me
Regards
Omayr.
It seems that your .ico file is corrupted. I can't open it in my browser. Other than that, it looks like you are doing everything ok.
If you can open http://misspassiton.com.au/favicon.ico directly in your browser, then you'll know it's working.
Requesting http://misspassiton.com.au/favicon.ico, it responds but seems that the image is broken. So the href is ok ;)
2 suggestions:
First: try to use a tool that
converts images in ico (i.e.
http://www.favicon.cc/)
Second: if you want to use
bloginfo(), you have to pass as
parameter 'url' because if you pass
'template_directory' it will return
'http://example/home/wp/wp-content/themes/parent-theme' that is completely wrong and as you can see it doesn't point to public root
(see the reference)
edit : add also type on the link (for IE)
<link rel="shortcut icon" href="http://misspassiton.com.au/favicon.ico" type="image/vnd.microsoft.icon" />
I was having the same problem. The code below worked. Add to the header.php file right before the end head tag. Your image should be in the root of your wordpress installation.
/* ADD FAVICON */
<link rel="icon" href="<?php bloginfo('siteurl'); ?>/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="<?php bloginfo('siteurl'); ?>/favicon.ico" type="image/x-icon" />