Skip to content
Related Articles
Open in App
Not now

Related Articles

Primer CSS Inline Styles

Improve Article
Save Article
Like Article
  • Last Updated : 28 Apr, 2022
Improve Article
Save Article
Like Article

Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Its approach to CSS is influenced by Object-Oriented CSS principles, functional CSS, and BEM architecture. It is highly reusable and flexible. It is created with GitHub’s design system.

In this article, we will learn about Primer CSS inline styles. Primer CSS inline styles are used to give inline CSS to style any element.

Syntax:

<div style="INLINE_STYLING" >
    Content
</div>

Example 1: In this example, we will set the height and width of an image using inline styles.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <meta name="viewport" content=
        "width = device-width, initial-scale = 1">
  
    <link rel="stylesheet" href=
</head>
  
<body>
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>
      
    <h3>Primer CSS Inline Styles</h3>
      
    <img src=
        width=400px height=400px>
</body>
  
</html>


Output:

 

Example 2: In this example, we have provided different inline styling to the different tags.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <meta name="viewport" content=
        "width = device-width, initial-scale = 1">
  
    <link rel="stylesheet" href=
</head>
  
<body>
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>
      
    <h3>Primer CSS Inline Styles</h3>
      
    <p style="text-align: center;">
        I am centered Paragraph
    </p>
      
    <span style="color:red;"
        I am a span tag
    </span>
      
    <h2 style="font-family:cursive;">
        I am a cursive heading
    </h2>
      
    <p style="font-style: oblique;">
        I am oblique Paragraph
    </p>
</body>
  
</html>


Output:

 

Reference: https://primer.style/css/principles#inline-styles


My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!