• Login
Community
  • Login

how to preview the html file

Scheduled Pinned Locked Moved General Discussion
11 Posts 8 Posters 53.2k Views
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.
  • R
    rich engle
    last edited by Nov 30, 2021, 5:45 PM

    is there a way to quickly preview what the html code would look like as a web page?

    P 1 Reply Last reply Nov 30, 2021, 6:03 PM Reply Quote 0
    • P
      PeterJones @rich engle
      last edited by PeterJones Nov 30, 2021, 6:04 PM Nov 30, 2021, 6:03 PM

      @rich-engle ,

      There’s a plugin called Preview HTML, which should do what you want – it creates a new panel in Notepad++ that will show a rendered view of the current HTML document. (Note that the preview window is not a full web browser; don’t expect javascript to run, and don’t expect to be able to browse/navigate your whole website through the preview window; it’s just the current document). When you make a change and save the HTML file, you can hit refresh on that preview window.

      Alternately, you can just use Notepad++'s built-in View > View Current File in … submenu, and choose to load your HTML file in Chrome, Edge, Firefox, or (shudder) IE. This will just tell your chosen browser to use the file://… URL to the file you are editing. When you make a change and save the HTML file in Notepad++, you can then use your browser’s refresh to refresh it.

      A D 2 Replies Last reply Dec 1, 2021, 2:38 AM Reply Quote 4
      • A
        artie-finkelstein @PeterJones
        last edited by Dec 1, 2021, 2:38 AM

        @peterjones

        There’s also the tab context menu option to Open in Default Viewer for folks that don’t use any of the pre-configured browsers.

        1 Reply Last reply Reply Quote 3
        • D
          Diego Acosta @PeterJones
          last edited by Aug 29, 2022, 11:50 AM

          @PeterJones Thank you! Thank you! Thank you!

          1 Reply Last reply Reply Quote 0
          • C
            Coolcreep 1465
            last edited by Coolcreep 1465 Jan 5, 2023, 8:27 PM Jan 5, 2023, 8:27 PM

            I’ve followed the View > View Current file in steps method but it only opens the raw code, not the formatted type of stuff I have if I open it from the regular notepad app, so I know it’s not a problem with my code. (If it is a problem with my code, it’s because I didn’t format it to Notepad++ or something like that) Does anyone have any idea how to solve this problem?

            P 1 Reply Last reply Jan 5, 2023, 8:31 PM Reply Quote 0
            • P
              PeterJones @Coolcreep 1465
              last edited by Jan 5, 2023, 8:31 PM

              @Coolcreep-1465 said in how to preview the html file:

              View > View Current file in steps method but it only opens the raw code,

              My guess is that you didn’t name your file blah.html (or blah.asp or blah.php or whatever other web format you are using), so the browser treats it as plain text.

              But also remember that view current file in opens the source in the browser; there is no server… so if you expect the server to run some code to generate your HTML, that’s not going to happen.

              C 1 Reply Last reply Jan 5, 2023, 8:33 PM Reply Quote 0
              • C
                Coolcreep 1465 @PeterJones
                last edited by Jan 5, 2023, 8:33 PM

                @PeterJones thanks, I’m only barley starting to learn this stuff, so any help is much appreciated. sorry if I asked a pointless question in your eyes.

                C 1 Reply Last reply Jan 5, 2023, 8:34 PM Reply Quote 0
                • C
                  Coolcreep 1465 @Coolcreep 1465
                  last edited by Coolcreep 1465 Jan 5, 2023, 8:37 PM Jan 5, 2023, 8:34 PM

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • A
                    Alan Kilborn
                    last edited by Alan Kilborn Jan 5, 2023, 9:15 PM Jan 5, 2023, 8:47 PM

                    Also note that for this to work you have to have an actual file – no folks, something like new 4, even if you’ve set its Language to html, isn’t going to cut it. Hit the actual Save on it, give it a real name (ending in e.g. .html) on your disk.

                    Rue the day when Don introduced this “new X” concept (and making it worse: with auto-remembering these “files” over runs of N++). What seemed like a good idea in 2003…hmmm.

                    1 Reply Last reply Reply Quote 1
                    • B
                      Babies getaway
                      last edited by Mar 8, 2023, 7:58 PM

                      This post is deleted!
                      1 Reply Last reply Reply Quote -3
                      • R
                        Ramsha Afzal
                        last edited by Jul 7, 2023, 9:58 AM

                        This post is deleted!
                        1 Reply Last reply Reply Quote -1
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors