P粉0221405762023-09-04 14:56:13
Your localhost is the machine that runs your code, it acts like a server, but locally. If you want to access the site on your mobile phone, you'll need to find your computer's IP address. You can get this by opening a command prompt and typing ipconfig and checking the IPv4 address, there may be two, try one of them. Then make sure your phone and computer are connected to the same network (e.g. let computer and phone connect to the same WiFi. But make sure that WiFi is not private), then you can use this IP on your phone, then the port number , for example 192.158.1.38:4000
, where 4000
is the port number.
Judging from your css
tags, I guess you want to test the responsive code, I can suggest you check the browsing by right-clicking anywhere on the browser window and clicking "Inspect" From here, you can switch between mobile and desktop views and even choose a different mobile device to see how your site will look on those devices
If you need more help, please let me know. Hope this helps you :)
P粉4404536892023-09-04 09:18:53
Please follow the steps below:
Step 1: Open CMD and write ipconfig
Step 2: Find the ipv4 address
, similar to IPv4 address: 192.168.x.x
Step 3: Write the address into your mobile phone and add :PORT
PORT=write the port number your website runs on at the end, it will be displayed in browser url
中vscode
in code> or live server
extension
Website: http://192.168.x.x:PORT