Community
    • Login

    css formatting not working on embed style sheet at the begging of the style section in specific cases

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 616 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • wonkawillyW Offline
      wonkawilly
      last edited by wonkawilly

      Hi all
      I am getting a strange behavior on N++ while formatting some code.

      Situation:

      I created a html file and in it I added a <style> tag and some embed code to style the page.
      It is an all in one file that contains:

      • HTML
      • Javascript
      • CSS
        code
        When I need to edit the CSS code I activate CSS language from the menu Language > C > CSS, as shown into the following screenshot:
      • Img 1:
        a7265402-6ed6-4df9-9ea5-991a7b03270f-notepad++_5vhmvyJGsD.png

      and of course I do the same for Javascript and HTML codes.
      The problem manifests itself when in CSS mode as shown in the following screenshot:

      • Img 2:
        bc4e3b7b-1b94-488f-8f49-adbaa9d06bb7-notepad++_AkbhDs6Bog.png

      The big red curly bracket highlights the problem: as can be seen some code lines are not well formatted.

      Just moving the same lines after another css block / rule they get formatted correctly as shown below:

      • Img 3:
        c1236a0f-4423-48d4-a1bf-ee8018091e07-image.png

      So it seems that the problem affects only some css selectors, as the asterisk and body in my case (probably others? but I don’t know), when positioned at the start of the <style> section.

      In both cases they work as expected in the browser so the code seems correct as I understand it.

      Also creating a separated file for the css code alone, it is formatted correctly as shown in this last screenshot:

      • Img 4:
        4291ce40-8b79-4fed-892b-6fdff5da811c-image.png

      Questions:

      • What is the cause of the formatting issue shown by Img 2?
      • Someone else can replicate the issue?
      • How can I solve it?

      Thanks in advance.

      mkupperM 1 Reply Last reply Reply Quote 0
      • mkupperM Offline
        mkupper @wonkawilly
        last edited by

        @wonkawilly said in css formatting not working on embed style sheet at the begging of the style section in specific cases:

        Someone else can replicate the issue?

        Please post an example for people to experiment with using the </> code thing that’s available in the forums.

        1 Reply Last reply Reply Quote 3

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors