Link does not return to page. previous

Asked

Viewed 37 times

-1

Hello. I’m a beginner in programming and I’m having problems with a website.

I added some pages to a "One Page" site, but the links to these additional pages do not return to index.php, with the exception of Logo.

Follow the menu code I kept the same on both pages:

<nav class="collapse navbar-collapse navbar-right" role="navigation">
                    <ul id="nav" class="nav navbar-nav">
                        <li><a href="#body">Home</a></li>
                        <li><a href="#about">Quem Somos</a></li>
                        <li><a href="#service">Serviços</a></li>
                        <li><a href="#portfolio">Parceiros</a></li>
                        <li><a href="#testimonials">Depoimentos</a></li>
                        <li><a href="#price">Consórcio</a></li>
                        <li><a href="#contact">Contato</a></li>
                    </ul>
                </nav>

  • What should I do if someone answers my question? https://answall.com/help/someone-answers Accept answer https://i.stack.Imgur.com/evLUR.png

2 answers

0

Your href are pointing to specific id, which would work if the references were from the same page. You can enter the address (url) instead of an id, since they are on different pages. Also, the ideal would be for your Nav to be dynamic (in a single php file being required in each page).

The href attribute specified in your code is only specifying an internal destination location (containing id) in the current document.

0

These links are also called bookmarks or anchors and serve to link to another section on the same page.

Example:

<!DOCTYPE html>
<html>
<body>

<h2>Lorem Ipsum</h2>

<a href="#ondeConeguir">Onde posso conseguí-lo?</a><br>
<a href="#sumario">Sumario</a>

<p>O que é Lorem Ipsum?</p>

<p>Lorem Ipsum é simplesmente uma simulação de texto da indústria tipográfica e de impressos, e vem sendo utilizado desde o século XVI, quando um impressor desconhecido pegou uma bandeja de tipos e os embaralhou para fazer um livro de modelos de tipos. Lorem Ipsum sobreviveu não só a cinco séculos, como também ao salto para a editoração eletrônica, permanecendo essencialmente inalterado. Se popularizou na década de 60, quando a Letraset lançou decalques contendo passagens de Lorem Ipsum, e mais recentemente quando passou a ser integrado a softwares de editoração eletrônica como Aldus PageMaker.</p<

<p>Porque nós o usamos?</p>
<p>É um fato conhecido de todos que um leitor se distrairá com o conteúdo de texto legível de uma página quando estiver examinando sua diagramação. A vantagem de usar Lorem Ipsum é que ele tem uma distribuição normal de letras, ao contrário de "Conteúdo aqui, conteúdo aqui", fazendo com que ele tenha uma aparência similar a de um texto legível. Muitos softwares de publicação e editores de páginas na internet agora usam Lorem Ipsum como texto-modelo padrão, e uma rápida busca por 'lorem ipsum' mostra vários websites ainda em sua fase de construção. Várias versões novas surgiram ao longo dos anos, eventualmente por acidente, e às vezes de propósito (injetando humor, e coisas do gênero).</p>


<p>De onde ele vem?</p>
<p>Ao contrário do que se acredita, Lorem Ipsum não é simplesmente um texto randômico. Com mais de 2000 anos, suas raízes podem ser encontradas em uma obra de literatura latina clássica datada de 45 AC. Richard McClintock, um professor de latim do Hampden-Sydney College na Virginia, pesquisou uma das mais obscuras palavras em latim, consectetur, oriunda de uma passagem de Lorem Ipsum, e, procurando por entre citações da palavra na literatura clássica, descobriu a sua indubitável origem. Lorem Ipsum vem das seções 1.10.32 e 1.10.33 do "de Finibus Bonorum et Malorum" (Os Extremos do Bem e do Mal), de Cícero, escrito em 45 AC. Este livro é um tratado de teoria da ética muito popular na época da Renascença. A primeira linha de Lorem Ipsum, "Lorem Ipsum dolor sit amet..."</p>

<P id="ondeConeguir">Onde posso conseguí-lo?</p>
<p>Existem muitas variações disponíveis de passagens de Lorem Ipsum, mas a maioria sofreu algum tipo de alteração, seja por inserção de passagens com humor, ou palavras aleatórias que não parecem nem um pouco convincentes. Se você pretende usar uma passagem de Lorem Ipsum, precisa ter certeza de que não há algo embaraçoso escrito escondido no meio do texto. Todos os geradores de Lorem Ipsum na internet tendem a repetir pedaços predefinidos conforme necessário, fazendo deste o primeiro gerador de Lorem Ipsum autêntico da internet. Ele usa um dicionário com mais de 200 palavras em Latim combinado com um punhado de modelos de estrutura de frases para gerar um Lorem Ipsum com aparência razoável, livre de repetições, inserções de humor, palavras não características, etc.</p>

<p id="sumario">Sumário</p>
<p>A frase "Lorem ipsum dolor sit amet consectetuer" aparece na ajuda online do Microsoft Word. Essa frase parece ser originada de um idioma latino inteligente. Na verdade, é uma tolice.</p>
<p>Mais Informações</p>
<p>Embora a frase seja tolice, ela tem uma história longa. A frase foi usada por vários séculos por tipógrafos para mostrar as características mais distintivas de suas fontes. Isto é usado porque as letras envolvidas e o espaçamento de letra naquelas combinações revelam o que ela tem de melhor, o peso, design, e outras características importantes da face.</p>

<p>Uma edição de 1994 da revista "Before & After" descreve "Lorem ipsum ..." como uma versão latina confusa de uma passagem de Finibus Bonorum et Malorum, um tratado na teoria de ética escrita por Cícero em 45 A.C. A passagem "Lorem ipsum ..." é tirada do texto, "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit ...", que a tradução é "Não existe ninguém que ama a própria dor, que procura por ela e quer senti-la, simplesmente porque ela é dor...".</p>


<p>Durante o ano de 1500, uma impressora adaptou o texto de Cicero para desenvolver uma página de amostras de tipo. Desde então, o texto latino tem sido o padrão da indústria de impressão para texto falso ou sem significado. Antes do advento da publicação eletrônica, desenhistas gráficos rascunhavam os seus layouts fazendo garranchos para indicar o texto. O advento das folhas auto-adesivas pré-impressas com o texto "Lorem ipsum" deu um caminho mais realista para indicar onde o texto formaria uma página.</p>
</body>
</html>

What is a hyperlink

A hyperlink is a link from one page to another destination (address) usually another web page, but can also be a figure, an email address, an archive or a program.
In a web browser, hypertext tags are displayed as hyperlink - interactive screen-formatted words or areas where the site visitor can click to jump to another page, display a figure, visit another site or start a download. This method of passing from page to page became known as "surfing the Web".

To create a hyperlink we use the command formed by the TAGS pair <a> </a> with the following syntax:
<a href="destination">text or figure or element</a>

Hyperlink text is a word or phrase, which has been assigned to a URL of destination. In this case the site visitor can click anywhere from word or phrase to display your destination.
example: <a href="/">Text</a>
result:  Text

Figure hyperlink is a figure that has been assigned to a URL of destination. In this case, the visitor of the site can click on any part of the figure to display its destination. The part highlighted in green is responsible for displaying the figure and the part in magenta is the destination when clicking on the picture shown.
example: <a href="destination"><img src="URL of origin of the figure"></a>

Hyperlink element - it is also possible to engage any element between <a href="destination" > </a> to create a stylized hyperlink.
<a href="destination">element</a>

When creating a hyperlink (http:/server/path/filename) the destination is encoded as a tracker uniform resource (URL).
A URL contains the location, path and filename on a web server or network. The URL also identifies the protocol that will process the file, such as HTTP, FTP etc. as shown below:

inserir a descrição da imagem aqui

The first part of a URL is the protocol, which informs a browser which Internet service should be used to download the document. A protocol is separated from the rest of the URL by two dots.
Examples of most commonly used protocols:
a) ftp - FTP servers are file deposits such as, documents, sounds, figures, computer programs etc..
b) mailto - indicates electronic mail transport.
c) http - get information from web servers. This is perhaps the most common protocol you will find when surfing the Web.
d) https - creates a connection to a secure web server, and then encrypts all page and information requests.

The second part, which appears to the right of the protocol, identifies the server on which the document is stored. Note that you have to separate the Web server protocol with two bars.

The third part defines the exact location of the document, that is, identifies the folders or subdirectories containing the page or file. If a page or file is stored in the root folder of a server, your URL will not have a path.

The fourth part of a URL is the file name. If it does not include the specific file name, the browser looks for a page default (default.htm or index.htm).

After the file name, an HTTP URL may have an indicator, also known as anchor, which directs the user to a part page specific. Indicators are preceded by the numeric sign # (or tic tic), example: href="plano_de_background.php#readability"> http://www.dominio.com/html/plano_de_fundo.php#readability.
Another parameter that can be used after the file name is the point of question ? which indicates information about queries that should be transferred to a Web server.

Absolute path and relative path
An absolute URL contains a full address, with the protocol, the server Web, path and file name.

A relative URL has one or more missing parts. Missing information are taken from the page containing the URL.
For example: if you want to link to another page within the same directory, you do not need to put the whole address as <a target="_Blank" href="http://www........ tutorial/html/letreiro_digital.php">http://www........ com/kit/tutorial/html/letreiro_digital.php ,  just put the name of the sign file.php
Example:
<a href="letreiro_digital.php">Signs digital</a>

IS common web pages use Urls relative containing only a partial path and a file name.

Examples:
to walk a directory ahead:
<a href="director1/filename.htm">element</a>

to walk two directories ahead:
<a href="director1/directory2/filename.htm">element</a>
Sand the file is found in one or more previous directories, the parameter ".. /" as many times as there are directories. Examples

an earlier directory:
<a href=".. /filename.htm">element</a>

two previous directories:
<a href=".. /.. /filename.htm">element</a>

Destination board
- How to make a link open in another window?
You might want to put a link on your page that opens on another window so that the visitor does not leave your site, for example, put a link to a page outside the site. Just include an attribute "target" (target), thus:
<a href="http://www......... com" target="_Blank" >Musicas Italianas</a>

The possible attributes are:
_Blank - Create a new browser window and load the URL inside it.
_self - load the URL into the same frame or current window .
_top - sets the target frame to be the whole browser window by removing all framesets.
_Parent - remove the current Frameset and load the URL instead.
The absence of this parameter sets the hyperlink target frame for the default target frame of the current page. This is a configuration recommended.

A hyperlink can also open e-mail program and has the following syntax:

<a href="mailto:[email protected]">text figure or element</a>

In this case when the visitor clicks on the link shown (text figure or element), will open the new message screen of the user’s default email system, making it possible to create an e-mail message addressed to your by electronic mail.
Obs: Not all web browsers offer hyperlink support for email addresses.  

Indicators on the page
An indicator is a location or selected text on a page. It uses indicator as destination for a hyperlink. For example, to display a particular topic on a page, add a hyperlink with the indicator as your destination. When the site visitor clicks on the hyperlink, the related part of the page is displayed.
Surround the element that will serve as a hyperlink with the following highlighted code in red color:

<a href="#name">Element</a>
Note: in the hyperlink the name must be preceded by the numeric sign # (or tic)

and put the indicator <a name="name"></a> in the part you want to display.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.