search
HomeBackend DevelopmentPHP Tutorial前端开发写代码的习惯问题

在html中我一般都是先写,然后往里面加标签。。。今天看以老师是 这样写的。。。不晓得 大家能看懂吗,

应该这么说我的顺序是 ---html---/html.

老师的顺序是--....哪一个才是规范的呢。。。 

好吧,表达能力有限。。。


回复讨论(解决方案)

这个也能有规范? 自己感觉吧,怎么顺手怎么来。

我和你的习惯差不多,代码一般都是把配对的东西先打上去,这样不容易漏写,而且符合人的思维习惯。
因为代码在结构上往往都是嵌套的,所以写代码的过程也是人的大脑递归调用的过程啊。
而人的大脑处理栈的能力很有限,往往不知道要返回到哪里去,所以先补全配对的东西是一种很好的做法。

要说是配对,那也得是先写  然后再在里面写内容
要是先  一堆,谁知到谁是谁?

我的个人见解是,你老师的习惯不是个好习惯。标签嵌套一多,他就得疯。坚持你自己的写法吧骚年~~

你老师用的是盲打高手的习惯
你用的是一般人的习惯,像你这样不如找个能自动配对的 ide/编辑器 或者更好

盲打的人只会用backspace来后退,而不是左箭头键
我见过N多打字超快的人都是这样

原来如此。。我还一位我老师的是个规范呢。。还是我自己的写着比较顺手

不要在意这些细节.......

无所谓了,都是浮云。
看看这个:
http://docs.emmet.io/

我觉得习惯看个人自己喜欢就是。但是配对的时候,最好是先配好。免得到处找。

这个我还真没想过,你现在写的少感觉不舒服,写的多了就随便了。

这个问题,老师对于教学方面很熟悉了,标签不会很多,老师的写法,就是少按次光标键,纯懒人方法。
按照人的习惯和程序本身的严谨性,还是配对编写,然后用光标换行,将配对分开,再在中间部分写其他标签或代码,会容易很多,也不会漏。
要知道因为差一个标签回来找bug,会哭的。

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Working with Flash Session Data in LaravelWorking with Flash Session Data in LaravelMar 12, 2025 pm 05:08 PM

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

cURL in PHP: How to Use the PHP cURL Extension in REST APIscURL in PHP: How to Use the PHP cURL Extension in REST APIsMar 14, 2025 am 11:42 AM

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Simplified HTTP Response Mocking in Laravel TestsSimplified HTTP Response Mocking in Laravel TestsMar 12, 2025 pm 05:09 PM

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

12 Best PHP Chat Scripts on CodeCanyon12 Best PHP Chat Scripts on CodeCanyonMar 13, 2025 pm 12:08 PM

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

Explain the concept of late static binding in PHP.Explain the concept of late static binding in PHP.Mar 21, 2025 pm 01:33 PM

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

PHP Logging: Best Practices for PHP Log AnalysisPHP Logging: Best Practices for PHP Log AnalysisMar 10, 2025 pm 02:32 PM

PHP logging is essential for monitoring and debugging web applications, as well as capturing critical events, errors, and runtime behavior. It provides valuable insights into system performance, helps identify issues, and supports faster troubleshoot

HTTP Method Verification in LaravelHTTP Method Verification in LaravelMar 05, 2025 pm 04:14 PM

Laravel simplifies HTTP verb handling in incoming requests, streamlining diverse operation management within your applications. The method() and isMethod() methods efficiently identify and validate request types. This feature is crucial for building

Discover File Downloads in Laravel with Storage::downloadDiscover File Downloads in Laravel with Storage::downloadMar 06, 2025 am 02:22 AM

The Storage::download method of the Laravel framework provides a concise API for safely handling file downloads while managing abstractions of file storage. Here is an example of using Storage::download() in the example controller:

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.