back

CodeWithRahul

More
  • Home
  • Cources
  • Tutorials
  • Tutorials
  • Projects
  • Notes
  • Contact
  • Work With Us
  • HTML
  • CSS
  • JAVASCRIPT
  • CC++
  • PHP
  • PYTHON
  • REACT JS
  • DSA

RahulGoswami.com

Create an account
  • INTRODUCTION
    • HTML Introduction
    • HTML Working
    • HTML Prerequisite
    • HTML Document
    • HTML Structure 1
    • HTML Page
    • HTML Structure 2
    • HTML Editor
    • HTML View Source
    • HTML Tags
    • HTML Element
    • VS Code
    • installation
  • HTML BASIC TAGS
    • Skeletal Tags
    • Heading Tags
    • Paragraph Tag
    • Horizontal Line Tag
    • Line Break Tag
    • Center Tag
    • Preserve
    • Formatting Tag
  • HTML FORMATTING TAGS
    • Monospaced Font
    • Text Abbreviation Tag
    • Acronym Tag
    • Text tags
  • HTML QUOTATIONS
    • Blockquote Tag
    • Quote Tag
    • Text Citation Tag
    • Text Direction Tag
    • Address Text Tag
    • Code Tag
  • HTML ATTRIBUTES
    • HTML Attributes
    • HTML Core
    • Attributes 1
    • Attributes 2
    • Attributes 3
  • HTML LINKS
    • HTML Links
  • HTML COMMENTS
    • HTML Comments
  • HTML IMAGES
    • HTML Images
  • HTML LISTS
    • HTML Lists
    • HTML Unordered List
    • HTML Ordered List
    • HTML Definition List
  • HTML TABLES
    • HTML Tables
  • HTML BLOCK ELEMENT
    • HTML Block
    • Elements
  • HTML INLINE ELEMENT
    • HTML Inline
    • Elements
  • HTML FORMS
    • FORM Introduction
    • More on forms

    HTML Core Attributes

    The most widely used attribute is core attributes. There are 4 types of core attributes:

    • Id
    • Class
    • Title
    • Style

    The Id Attribute:

    This is the most widely used attribute. The id attribute is used to give a unique id to an HTML element. Each element in HTML with an id attribute has its own unique identity, just as each of us has our own unique identity. Multiple elements can’t share the same id.

    For Example:

    <p id="html"> This is HTML tutorials <p>
    <p id="python"> This is Python tutorials <p>
    
    In the above example, it is easy to distinguish the two paragraphs with the name- id attribute having two different values i.e. html and python.

    The class Attribute:

    The class attribute is used to specify a class to an HTML element. It is not unique like the id attribute. Multiple elements can share the same class. It is used to associate an element with a stylesheet, JS.

    The title Attribute:

    The id attribute is used to give a title to an HTML element. When the HTML element is loading, a tooltip of the cursor comes and shows the written title.

    For Example:

    <h4 title="hello, metto"> Title Attribute <h4>
    

    Output:

     Title Attribute 

    The style Attribute:

    The style attribute is used to give styling to an HTML element. It is a property of CSS (Cascading Style Sheet). It is mainly used by the CSS. It is the inline property of an element. In CSS, if we want to style within an HTML element we use the style attribute in inline of an HTML element.
    Owner of this WebPage Image

    CodeWithRahul

    Copyright © 2023 CodeWithRahul.com