Magento Expert Forum - Improve your Magento experience

Results 1 to 4 of 4

How to use inline css?

  1. #1

  2. #2
    Junior Member
    Join Date
    Oct 2016
    Posts
    260
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    When CSS is written using the style attribute, it's called an "inline style". Inline styles look and operate much like CSS, with a few differences. Inline styles directly affect the tag they are written in, without the use of selectors.

    For example:

    <html>
    <head>
    </head>
    <body>
    <p style=”color:blue;”>
    I am paragraph.
    </p>
    </body>
    </html>

  3. #3
    Junior Member
    Join Date
    Mar 2017
    Location
    Delhi
    Posts
    90
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    It's simple to use but it increases your Page Load Time that is not a good practice. Use Inline CSS where necessary otherwise avoid it.
    See the below code for how you can use it

    Inline CSS is used to apply the unique style to a single HTML element

    This style tag change the color of your heading
    <h2 style="color:blue;"> your text or heading>/h1>

  4. #4
    Junior Member
    Join Date
    Sep 2016
    Posts
    101
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    The inline style uses the HTML "style" attribute. This allows CSS properties on a "per tag" basis. The following is an example of how the inline style is used.

    <p style="color:red;font-size:18px">This is a paragraph!</p>

    This inline style will change the color of the paragraph to red and make the font size 18 pixels.


    Event Management Companies in Delhi

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •