CSS Inline Style

CSS Inline Style. Cascading Style Sheet (CSS) is a style sheet language, that represents how an HTML page should be presented. It primarily styles the performance of a particular part of the markup language code. There are three methods to include CSS in any HTML code, which are, Internal, External, and Inline. While we call the externally described style sheet in our page in the External method, we represent the style within <style >  in the same HTML code in the Internal method. It does style attributes for styling elements. Internal CSS is held in the same HTML page, as it is used for styling the elements being used in the code.

Read Also: CSS Attribute Selectors

How does CSS Inline Style Work?

In Inline style CSS, we style a specific element of the HTML code. In the case of Inline Style CSS, ‘style’ is used as an attribute of any distinct element, which has different properties and is used for the individual styling of any HTML element. We will explain the use of inline CSS through an example:

Read Also: What Is CSS?

CSS Inline Style

There are two examples of Inline style single inline CSS and multiple inline CSS.

<!---CSS Inline Style for single Elements ---->
<h1 style="color:hotpink; font-size:50px; font-style: italic;">CSS Inline Style For Single Element</h1>
<!---CSS Inline Style for Mutiple Elements ---->
<h1 style="text-decoration: underline;color: hotpink;border:2px solid #eee; font-weight: 400px;">CSS Inline Style For Multiple Elements</h1>

Note: In the above two examples, In the HTML example is separated with comments. we have utilized many assets on style attributes, such a font-weight, color, and border, etc. There are many other assets that can be looked upon. It will be a good idea to create a sample HTML page, and try as many style properties as possible, for the purpose of awareness and ease. Inline

Read Also: Introduction to CSS Controls

Inline CSS for an Image Element.

<img style=" border: 5px solid #eee; padding: 10px;" src="Image Source (URL)" height="300px" width="600px">

So, in this article, there were several parts discussed, which explain, how CSS inline style can be performed into one’s HTML Markup. However, if the Markup is a large level and needs severe styling, it is advised that one must use an external style sheet. That not only helps the performance but also structures the scheme properly. Inline CSS can be utilized if the design is small and very few elements, that are not effective in nature, need styling. Inline style CSS is a restricted level variation that is limited to that element of that HTML page only. For marking styles on a global level, using External style sheets will be a more reliable idea.

Leave a Reply

Your email address will not be published. Required fields are marked *