Designating "nofollow" attribute on links in <div> - html

I have the following code in a website footer:
<div class="examples-footer">
First text Example
Second text Example2
</div>
I would like to designate the two links there as "nofollow". However, I can only manipulate the output by inserting additional text/html tags right after
<div class="examples-footer">
and before
First text Example
Just inserting the <rel="nofollow"> tag there won't work; is there a way to do this using the HTML markup under the constraints which I specified, or is it impossible?

If you don't want bots/crawlers/spiders to follow any links on the page, use the robots meta tag in the head:
<meta name="robots" content="nofollow">
If you don't want search engines counting a link for page ranking, use the rel attribute in the link:
<a href="//stackoverflow.com" rel="nofollow">
Neither of these will prevent a human being (or cat) from following a clicked link, of course.

Related

How to implement Schema.org properties in meta data?

Schema.org describes how to implement object properties using the meta tag but the examples given are properties with primitive types such as Text or Boolean. Let's say I want to display a grid of images and each image is of type ImageObject. The copyrightHolder property itself is either an Organization or Person. If I want to include the organization legal name, how would I do that using only meta data?
With "regular" HTML elements I would write:
<span itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<span itemprop="legalName">ACME Inc.</span>
</span>
This obviously doesn't look right:
<meta itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="legalName" content="ACME Inc.">
</meta>
The only thing that comes into mind is using a set of hidden spans or divs.
Using Microdata, if you want to provide structured data that is not visible on the page, you can make use of these elements:
link (with itemprop) for values that are URLs
meta (with itemprop) for values that aren’t URLs
div/span (with itemscope) for items
So your example could look like this:
<div itemscope itemtype="http://schema.org/ImageObject">
<div itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="legalName" content="ACME Inc." />
</div>
</div>
If you want to provide the whole structured data in the head element (where div/span aren’t allowed), see this answer. If you only want to provide a few properties in the head element, you can make use of the itemref attribute.
That said, if you want to provide much data in that hidden way, you might want to consider using JSON-LD instead of Microdata (see a comparison).
I was reading Getting Started again and noticed 2b that states
When browsing the schema.org types, you will notice that many properties have "expected types". This means that the value of the property can itself be an embedded item (see section 1d: embedded items). But this is not a requirement—it's fine to include just regular text or a URL.
So I assume it would be fine to just use
<meta itemprop="copyrightHolder" content="ACME Inc.">

Do not add TITLE as heading to body when exporting org file

This export option:
#+TITLE: My title
Does two things:
adds a meta tag on the document's head: <title>My title</title>
adds a heading at the start of the generated content div: <h1 class="title">My title</h1>
I want 1 but do not want 2. Is it possible to configure this?
Something like this "should" work according to http://orgmode.org/manual/Export-settings.html#Export-settings:
#+OPTIONS: title:nil
#+HTML_HEAD: <title>My special title</title>
but in my setup this doesn't actually suppress the title. it does add an extra <title> to the head block though with the text you put in.
If you make the title blank, e.g.
#+TITLE:
then there is no title, but still apparently two titles in the head. Is that close to what you want?
[Org mode version 9.5.2]
Part of John Kitchin's answer helped me; the following achieves what you need:
#+TITLE: grtcdr's website
#+OPTIONS: title:nil

Website Image as Title, Google Doesn't recognize Image

I currently have an image as my title for my website. Google is not recognizing this as the title and it shows up with something other than what i want in google search. I thought of perhaps adding the below h1 / link...
<a href="/">
<h1 style="postion:absolute;margin:-1000px -1000px;">my title</h1>
<img src="images/logo.jpg" alt="my title"/>
</a>
However this doesn't hide the title like I want it to. Any advice?
The title that Google puts into its search result is not defined by the <h1>-tag but by the <title> tag within the the document's head.
So try this within the <head></head> tags:
<title>my title</title>
The <h1>-tag is picked up by Google but has nothing to do with what Google displays as your site's title, neither does the image.
That aside: for search engine optimization and accessibility reasons you should never use only an <img> as your header graphic.
If you want to define the text that Google puts under the search result's title, go for the meta description and put this in the documents head:
<meta name="description" content="The description of your site, as it will appear on Google Search." />
CSS
h1 { height:200px; background:url('logo.jpg'); width:300px }
h1 span { display:none }
HTML
<h1><span>My Title</span></h1>
And user1394965 is correct. <title> is going to drive what Google lists.
h1 =/= title
You need a title tag in the head of your page. Also, I don't know if you can do this with an actual image or not (I really don't see why you would want to put an image as your title or what purpose it would serve). Maybe you're thinking of a favicon?
Also, theres no need to hide the title off of the page when you use a title tag. Since it's in your header it does not actually get displayed to the body.

HTML div navigation

I`ve seen on various websites, some links appear like this: http://www.myserver.com/page.html#something and when I click on it, it just moves to another portion of the page.
I want to know how to do this. Is it only the URL of the <a href> atrribute?
The fragment at the end of the url coresponds to an ID on the page you're visiting.
If in my page I have a section such as:
<div id="comments">
...
</div>
Then I can take the user to this section by attaching #comments to the pages URL
(http://www.example.com/page.html#comments)
Link to comments
Update
Some of the other answers here correctly point out that you can create an anchor with a name attribute as: <a name="example"></a>.
Although this is technically correct, it's also a very antiquated way of doing things and something I'd recommend you avoid. It's very 1997 as some might say :-)
The text after the hashtag corresponts with an anchor on the page. An anchor is a hidden element on the page which you can link to.
Think for example about a large page with an to top link in it
To create an anchor use:
<a name="C4"></a>
To link to it use: Text
Or you can even link to an id of an element
Check out: links (aka anchors)
Also note that you can use <a name="something"></a> or <a id="something"></a>
or using divs <div id="something"></div>
This is a link to a bookmark on the given page (or even just #something on the current page).
To make it work, you need to define something. You can do this using the name attribute of an <a> tag.
http://programming.top54u.com/post/HTML-Anchor-Bookmark-Tag-Links.aspx

Is there any other use of <link> tag?

Is there any other use of tag? which is useful or it's only for to link css and favicon.?
and what is the difference between <a href=#> and <link>? is link only can be placed in <head>
There are all sorts of uses for link. Here's a list from the HTML5 specification. Link to alternate versions of the page, an icon for the page, the first/next/previous/last page of a series (if it's a series), ...