Which Inline Attribute Specifies the Styling of Elements in HTML? Last Updated : 15 Oct, 2024 Comments Improve Suggest changes Like Article Like Report An inline attribute in HTML refers to the style attribute, which allows you to apply CSS directly to a specific element. This provides quick, element-specific styling without affecting other elements or requiring external stylesheets. It is defined directly within the HTML tag.What is the style Attribute?The style attribute is an inline attribute used in HTML to apply CSS styles directly to an individual element. Unlike external or internal stylesheets, which apply to multiple elements across a page or site, the style attribute allows you to define unique styling for a specific element.Syntax<p style="color: red; font-size: 18px;">This is a styled paragraph.</p>Examples of inline attribute to specifies the styling of elements in HTMLExample 1: Here the inline CSS to style elements directly within the tags. Each element has specific styles applied, such as color and font size HTML <!DOCTYPE html> <html> <head> <title>Inline attribute specifies the styling of elements</title> </head> <body> <h1 style="color:Blue;font-size:25px;"> Java - Inline style </h1> <p style="color:red;">Java - paragraph</p> <p style="color:green;font-size:40px;"> python - paragraph </p> <hr style="border-color:orange;"> </body> </html> Output:inline attribute specifies the styling of elementsExample 2: In this example, we use inline CSS styling by directly applying color and font size to headings. Each heading features unique styles for Java and Python, HTML <!DOCTYPE html> <html> <head> <title>inline attribute specifies the styling of elements in HTML</title> </head> <body> <h1 style="color:Blue;font-size:25px;"> Java - Inline style </h1> <h2 style="color:green;font-size:15px;"> Python - Inline style </h2> </body> </html> Output:inline attribute specifies the styling of elements in HTML Comment More infoAdvertise with us Next Article Which Inline Attribute Specifies the Styling of Elements in HTML? S sravankumar_171fa07058 Follow Improve Article Tags : HTML Web technologies HTML-Attributes HTML-Questions Similar Reads What is significance of declaring attribute in HTML elements ? In this article, we will know HTML Attributes' significance while declaring and their implementation through the examples. All HTML elements have attributes that will provide additional information about that particular element. It takes 2 parameters, ie, a name & a value which define the proper 2 min read Which attribute is used to declare the language of the web page in HTML ? The HTML lang attribute is used to declare the language of the element content it is used on. Some examples of languages are en for English, es for Spanish, etc. This attribute contains a single value, which is the language_code that is used to specify the language of the content that is displayed. 1 min read Tags vs Elements vs Attributes in HTML In HTML, tags represent the structural components of a document, such as <h1> for headings. Elements are formed by tags and encompass both the opening and closing tags along with the content. Attributes provide additional information or properties to elements, enhancing their functionality or 2 min read Which HTML Attribute is used to justify the content ? The HTML attribute is used to justify-content is the align attribute. The align attribute of <p> tag is used to justify the text on a web page. This can be done by assigning the value to the aligned attribute as justified. The justification of the text aligns the text in such a way that it occ 2 min read Which property specifies the top margin of an element in CSS ? In this article, we are going to discuss the margin-top property that specifies the top margin of an element. In order to specify the top margin of an element, CSS provides a styling element called margin-top which sets the top margin of an element. This property accepts an integer value. The defaul 2 min read Like