Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>HTML PHP Preview PlusNew to Visual Studio Code? Get it now.
HTML PHP Preview Plus

HTML PHP Preview Plus

KPK gh

|
1,981 installs
| (0) | Free
Advanced live preview for HTML and PHP files with JavaScript support, PHP server integration, and powerful layout system
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

HTML Preview Extension

A powerful VS Code extension for live previewing HTML files with advanced JavaScript support and PHP server integration.

Features

  • Live Preview: Real-time preview of HTML files with automatic updates
  • PHP Support: Built-in PHP development server for dynamic content
  • Advanced JavaScript Support: Full support for modern JavaScript features
  • Layout System: Flexible layout system with grid, flex, and masonry options
  • Form Handling: Automatic form submission handling with PHP integration
  • State Management: Built-in state management for dynamic content
  • Component System: Reusable component system for better code organization

Requirements

  • Visual Studio Code ^1.60.0
  • PHP (for PHP server features)

Installation

  1. Install from VS Code Marketplace:

    • Open VS Code
    • Go to Extensions (Ctrl+Shift+X)
    • Search for "HTML Preview"
    • Click Install
  2. Manual Installation:

    • Download the .vsix file
    • Run: code --install-extension html-preview-0.0.1.vsix

Usage

Basic HTML Preview

  1. Open an HTML file
  2. Use one of these methods to open the preview:
    • Press Ctrl+Shift+V (or Cmd+Shift+V on Mac)
    • Open command palette and type "Show HTML Preview"
    • Right-click in editor and select "Show HTML Preview"

PHP Server

  1. Ensure PHP is installed on your system
  2. Open command palette (Ctrl+Shift+P)
  3. Type "Toggle PHP Server"
  4. Check status bar for server status

Layout System

Use data attributes to create responsive layouts:

<div data-layout="grid" data-columns="3" data-gap="1rem" data-responsive>
    <!-- Content -->
</div>

Available layouts:

  • Grid: data-layout="grid"
  • Flex: data-layout="flex"
  • Masonry: data-layout="masonry"

Form Handling

Forms are automatically handled when PHP server is running:

<form action="process.php" method="post">
    <input type="text" name="message">
    <button type="submit">Send</button>
</form>

Examples

Basic PHP Example

<!DOCTYPE html>
<html>
<head>
    <title>PHP Test</title>
</head>
<body>
    <?php
    echo "<h1>Current time: " . date('Y-m-d H:i:s') . "</h1>";
    ?>
</body>
</html>

Layout Example

<div data-layout="grid" data-columns="3" data-gap="1rem" data-responsive>
    <?php
    for ($i = 1; $i <= 6; $i++) {
        echo "<div>Grid Item $i</div>";
    }
    ?>
</div>

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you encounter any issues or have questions:

  1. Check the documentation
  2. Open an issue
  3. Contact support at your-email@example.com
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft