Suppose I have a file called Index.html and another file called another.html , when I click another.html in Index.html I want header like this Index.html/Another.html , is it possible ?
If you think of a navbar you can copy paste it from index.html to another.html or use a frgmantation strategy which would avoid having the same code on multiple places.
If you are talking about the URL you can specify this in the header with the title tag:
<title>index/another.html</title>
But it would be bad style to say index.html/another.html instead use index/another.html
Related
I couldn't figure out a title that descibes what I need but I will explain here. (I know how to make a sub page, just cant figure out how to make a path).
This may seem like a stupid question (which I cant figure out for the life of me after doing research), but how does one create a sub page to your html file so that it is a pathway such as:
exemplesite . com/Porfolio/
then you click an image which takes you to a new subpage and then the URL becomes:
exemplesite . com/Portfolio/Project-1
and this without changing pages. (I do not want this: exemplesite . com /Project-1)
Hope this makes sense.
Thank you
To create links for subpages, link to the folder, then the title of the page within that folder you want to link to.
For example:
This is how you do it:
PAGE NAME
If the FILENAME.html is not the same directory you'll address it like this:
PAGE NAME
answer via: https://forums.digitalpoint.com/threads/creating-links-for-subpages.2150899/
In the example you gave, Portfolio/Project-1, you would have a folder, Porfolio, and within it, a file, Project-1.html.
You can create "jump-to" anchors within your page by adding simply referencing element ids in a local href link (see snippet). I added a sizeable (ish) padding-bottom to clearly demonstrate the jump.
p {
padding-bottom:40px;
}
<body>
<p>Link to Books</p>
<h2>Introduction</h2>
<p>Welcome!</p>
<h2>Fruit</h2>
<p>Apples, Bananas, etc.</p>
<h2 id="books">Books</h2>
<p>List of books</p>
</body>
Is there a ('newbie-simple') way to embed an image inside html, however not in the inline form as usual:
<img src="data:image/png;base64,iVBORw0KGgoAAAA [...]" />
but in a form where the base64 code is placed on the end of the html file?
A possible benefit of this method would be that an image can be inserted in the page on more than one place using the same image data from the bottom of the html file.
TL;DR: With pure HTML/CSS - unfortunately no.
I need that too for Sciter Notes project to save notes (plain HTML files) with embedded images.
Ideally you should be able to do something like this:
<img src="cid:1234" />
...
<data id=1234 type="image/png" base64>
iVBORw0KGgoAAAA...
</data>
but unfortunately no such mechanism yet.
But you can implement schema explained above with script though.
If you are using HTML5, then you do not have to worry about caches. The browser will load all images and store them into an image-list, therefore the image will be loaded only once and reused at every place the key (the URL to the source image) is found.
The only thing you will have to do, if you are only using HTML, is to copy the URL of the image into every place you need to use it. This is necessary, because you cannot declare variables in HTML and hence cannot change them from another place in the document. For this purpose you would need additionally javascript for example.
Then you can go ahead with CSS to adjust the pictures to your requirements. Yu can either define classes in the header and let the img tags have these classes, or you can type the style properties inline or you can import an external CSS-file.
EDIT:
An example with javascript would be to add this code in
<body>
<img id="img" src="myIMG.jpg">
<script type="text/javascript">
function changeImage(id, src) {
document.getElementById(id).src=a;
}
</script>
</body>
Here the function changeImage is declared now. You can call this function either via onclick or inside of the script tag. You can address the correct image through its ID as first parameter (you will have to give every image its ID, don't confuse it with the image-list of your browser, here you define the ID in the img-tag) and the new source url as second parameter.
Back with another big question:
I have to create a network of pages with content linked though them. For link inside the same page i'm using this method:
<div id="anchorname">
The content.
</div>
and:
Link Text
Now i have to link to the #anchorname from another page but it doesn't work, i tried this:
Link Text
Is there something i am doing wrong?
This is possible to do. You might try using the full name of the page including the suffix. e.g:
Link Text
If that doesn't work then I would experiment with using a full path.
EDIT: As you've stated that you're using Wordpress then you should try it like this:
Link Text
I know that linking in general looks like
examplesite.com
I was wondering how would someone link within the page it self. Sort of like when someone clicks on biography section in Wikipedia and it scrolls down to the part that has the biography but staying on the same page.
Any example could would be great.
I believe that you're referring to URL fragments (a.k.a. named anchors or bookmark links).
You'd create such a link like:
Jump to example
Which would take you to the part of the page where the element with the ID of example exists. Like:
<h1 id="example">example</h1>
In older versions of HTML, the name attribute was first used for this, however the ID has replaced that.
What you posted is actually a link inside a website. It does not contain a protocol such as http:// nor starts with // which would indicate a protocol-relative link, so it would load exampleside.com relative to whatever path you are currently on.
These are the kind of links you can use (each inside href="..."). We assume that you are currently on http://example.net/foo/index.html
https://example.com - goes to the "external" site https://example.com
//example.com - goes to the "external" site xxx://example.com with xxx being the protocol used to load example.net, so in my example http://example.com
www.example.com - goes to http://example.net/foo/www.example.com as it is not an external link
#foo - goes to the element with id="foo" on the current site (does not load anything from the server)
So what you want is probably the last example: ... and then id="foo" on the element you want to jump to.
Add some id to the element you want to link to, e.g
<div id="target">Hello</div>
Then you can link it by using #:
Go to target
Go to target
<hr style="height: 300vh" />
<div id="target">Hello</div>
I have trying to make pretty url's with .htaccess. The structure of the pages is like this- http://example.com/category_id=1/item_id=1:
index
index->category
index->category->single_item_from_category
I've trying to make this like-http://example.com/category-1/item-1.html but the css on the third level where is /item-1.html isn't there. Is like the page doesn't have css at all.
I must say that this site is in sub folder of main sait: http://example/site-is-here/
This is the .htaccess code
RewriteRule ^vcat-([^/]*)/video-([^/]*)\.html$ /second/video_category.php?video_cat_id=$1&video_id=$2 [L]
and this is the link in the php/html part
'.$row['video_title'].'
on all other pages those 'pretty url's' are working. The problem is only whit pages that are like this index.php/category/item
When I go on the page which seems to miss css fail and check in source of the page the link to the css is: http://example.com/sait/vcat/css/main.css
but should be
http://example.com/sait/css/main.css
Just add base href in your <head></head> section like this:
<base href="http://www.example.com/sub-folder/" />
It should work.