css formatting not working on embed style sheet at the begging of the style section in specific cases
-
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:

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:

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:

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:

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.
-
@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.
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