Home > front end >  Add source q&a: Alt tag?
Add source q&a: Alt tag?

Time:09-24



This code can add Alt tag? If you can ask the great spirit show ~ ~ ~ ~

CodePudding user response:

Can't Alt is unique to img tags you can add an img tag in a div wide high to 100% can the whole float on div then give img Alt tag with respect to ok

CodePudding user response:

reference 1st floor nian_cj response:
not Alt is unique to img tags you can add an img tag in a div wide high to 100% can be the whole float on div then give img Alt tag with respect to ok
is not unique to other HTML tags also support the Alt attribute,
 


CodePudding user response:

 
<script type="text/javascript">
The function getcontent () {
Document. The getElementById (" app "). The setAttribute (' Alt ', 'you see here).
debugger;
}
</script>
<style>
# app {
Width: 200 px;
Height: 200 px;
Background: gray;
}
</style>
<body>

CodePudding user response:

LZ take this code to see results

CodePudding user response:

refer to the second floor is a little small lewd honest reply:
Quote: refer to 1st floor nian_cj response:

Can't Alt is unique to img tags you can add an img tag in a div wide high to 100% can the whole float on div then give img Alt tag with respect to ok
peculiar to also can't say other HTML tags also support the Alt attribute,
 




The Alt attribute is in the case of img tags do not have pictures of the default display content,
Web crawler will use ` Alt ` TAB to understand image content, therefore they were thought to SEO is very important

CodePudding user response:

reference 5 floor nian_cj reply:
Quote: refer to the second floor is a little small lewd honest reply:

Quote: refer to 1st floor nian_cj response:

Can't Alt is unique to img tags you can add an img tag in a div wide high to 100% can the whole float on div then give img Alt tag with respect to ok
peculiar to also can't say other HTML tags also support the Alt attribute,
 




The Alt attribute is in the case of img tags do not have pictures of the default display content,
Web crawler will use ` Alt ` TAB to understand image content, so they think it's important for SEO

CodePudding user response:

Can add Alt, belongs to the div tags, is not the same as you understand the img Alt, for example:
 
Content


 
$(function () {
$(" all "). Attr (" Alt ", "123")
});

CodePudding user response:

refer to 7th floor xiaoxiang dream response:
can add Alt, belong to the div tags, is not the same as you understand the img Alt, for example:
 
Content


 
$(function () {
$(" all "). Attr (" Alt ", "123")
});


Add can certainly add, is that there is no img that the role of the default content, if you're going to be a custom attribute, does not recommend using this in the original of the same name, there will be ambiguity

CodePudding user response:

refer to the eighth floor nian_cj response:
Quote: refer to 7th floor xiaoxiang dream response:

Can add Alt, belongs to the div tags, is not the same as you understand the img Alt, for example:
 
Content


 
$(function () {
$(" all "). Attr (" Alt ", "123")
});


Add can certainly add, is that there is no img that the role of the default content, if you're going to be a custom attribute, do not recommend using this in the original of the same name, there will be ambiguity


Indeed, unless there is a rigid requirements, or Alt will ambiguity, careful don't even have the best
  • Related