Let us now discuss the different HTML tags. This will make more sense as we see these tags in action. As you can see, they are situated side by side, only taking up the necessary width needed for the content they hold. These next three blue areas are Inline tags. This means that any tags must start on the next line. As you can see, they take up the entire width of the parent container. These pink areas represent our block-level elements or tags. The width of the browser, our parent tag, will be the width of the block-level element. This green area represents the parent container. Inline Element: Takes up the current space that exists in. The following are the attributes of the Block level element and Inline element.īlock Level Element: Takes up the whole width of their parent container. When the mouse has hovered over a tag, where the title has displayed. title: title provides an identifier, or a tooltip of sorts, for the tag.style: style attribute is used for Inline CSS.You will find these used mostly with CSS and sometimes with JavaScript. class: the class attribute is similar to the id tag, except the value of the attribute can be repeated multiple times on a given page.That means that no two tags can have the same value in an id The id attribute value must be unique on a given page. It is used mostly for JavaScript and styling, with CSS (Cascading Style Sheets). This adds no visual change to the tag itself. Let’s go over the four most commonly used global attributes. The global attribute is able to be set on all tags. The class attribute can take multiple values, which can be whatever you want them to be. The second attribute is the class attribute. The id attribute’s value can be anything you want it to be, though it can’t have any space in it. Here is a perfect example of what a tag looks like with an attribute added Add Pizza The output of this tag in the browser will display Hello World!Īn attribute is an additional value that can configure a tag or adjust the tag’s behavior. In this case, 1 is the largest default text that you can have displayed in the browser. The one that follows the h indicates the size of the header that is being used. The h in the tag name lets us and the browser know that we are working with a header tag. Here is an example of a tag with some text inside. Sometimes developers might refer to tags as elements. Web development, programming languages, Software testing & others What is a Tag?Ī tag is an instruction to tell the browser how it should display certain content on the screen. Start Your Free Software Development Course
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |