Atributos HTML

Atributos HTML Todos os elementos HTML podem ter atributos Atributos fornecem informações adicionais sobre um elemento Atributos são sempre especificados na tag de início Atributos geralmente vêm em pares nome / valor como: name = “value”

 

O atributo href Links HTML são definidos com a tag <a>. O endereço do link é especificado no atributo href:

Exemplo

<a href="https://www.w3schools.com">This is a link</a>

O atributo src
Imagens HTML são definidas com a tag .

O nome do arquivo da origem da imagem é especificado no atributo src:

Exemplo

<img src="img_girl.jpg">

Atributos de largura e altura
Imagens em HTML têm um conjunto de atributos de tamanho, que especifica a largura e a altura da imagem:

Exemplo

<img src="img_girl.jpg" width="500" height="600">

O tamanho da imagem é especificado em pixels: width = “500” significa 500 pixels de largura.

Você aprenderá mais sobre imagens em nosso capítulo Imagens em HTML.

O atributo alt
O atributo alt especifica um texto alternativo a ser usado quando uma imagem não pode ser exibida.

O valor do atributo pode ser lido pelos leitores de tela. Dessa forma, alguém “escutando” a página da web, por exemplo uma pessoa com deficiência visual, pode “ouvir” o elemento.

Exemplo

<img src="img_girl.jpg" alt="Girl with a jacket">

Exemplo
Veja o que acontece se tentarmos exibir uma imagem que não existe:

<img src="img_typo.jpg" alt="Girl with a jacket">

O estilo Atributo
O atributo style é usado para especificar o estilo de um elemento, como cor, fonte, tamanho etc.

Exemplo

<p style="color:red">I am a paragraph</p>

Atributo lang
O idioma do documento pode ser declarado na tag.

O idioma é declarado com o atributo lang.

Declarar um idioma é importante para aplicativos de acessibilidade (leitores de tela) e mecanismos de pesquisa:

<!DOCTYPE html>
<html lang="en-US">
<body>

...

</body>
</html>

 

As primeiras duas letras especificam o idioma (en). Se houver um dialeto, use mais duas letras (US).

O título Atributo
Aqui, um atributo de título é adicionado ao elemento

. O valor do atributo title será exibido como uma dica ao passar o mouse sobre o parágrafo:

Exemplo

<p title="I'm a tooltip">
This is a paragraph.
</p>

 

O artigo ajudou ?
SimNão

40 Comments

Your latest blog post truly resonated with me! The depth of insight and the clarity of your thoughts are commendable. It’s evident that you’ve put a lot of thought and research into this topic, and it shows. Your ability to present complex ideas in such an accessible and engaging manner is a rare skill. Thank you for sharing your knowledge and perspective – it’s been a thought-provoking read and I’m already looking forward to your next piece!

I just couldn’t depart your site before suggesting that I actually enjoyed the standard information a person provide for your visitors? Is gonna be back often in order to check up on new posts

With havin so much content and articles do you ever run into any issues of plagorism or copyright violation? My blog has a lot of unique content I’ve either authored myself or outsourced but it looks like a lot of it is popping it up all over the internet without my agreement. Do you know any methods to help reduce content from being stolen? I’d certainly appreciate it.

What i do not understood is in fact how you’re not really a lot more well-appreciated than you may be right now. You are so intelligent. You know thus significantly relating to this topic, produced me in my opinion believe it from so many various angles. Its like women and men don’t seem to be fascinated until it is something to accomplish with Girl gaga! Your individual stuffs outstanding. At all times take care of it up!

I’ve been exploring for a little bit for any high-quality articles or weblog posts in this sort of area . Exploring in Yahoo I ultimately stumbled upon this site. Studying this info So i am satisfied to express that I have a very good uncanny feeling I discovered just what I needed. I such a lot surely will make sure to don’t overlook this site and provides it a look regularly.

The very root of your writing while appearing agreeable initially, did not really settle very well with me personally after some time. Somewhere throughout the paragraphs you were able to make me a believer but just for a short while. I still have a problem with your leaps in assumptions and one would do well to fill in those gaps. In the event you can accomplish that, I could definitely end up being impressed.

Do you have a spam problem on this site; I also am a blogger, and I was wondering your situation; we have developed some nice procedures and we are looking to swap solutions with others, please shoot me an e-mail if interested.

Deixe uma resposta