简体   繁体   中英

Visual Studio 2012 intellisense and HTML attributes

I'm new to VS. I've looked around, and can't find anything about this:

When typing an html tag, typing the start of a valid attribute name such as href correctly hints it, but does not add the ="" after the attribute, and I always have to type it myself.

Coming from other editors where it add the equal and quotes and places the editing caret between the quotes, this is annoying.

Am I missing the proper way to do this? Or is there anything I need to do, customization-wise?

I think it has something to do with the way you should use VS, in general you don't have to press enter or tab to complete your keyword(like some of the other editors), you can for example do this:

begin writing href and when you find that it is the one hilighed in the autocompletion window press =

similarly for Tags , begin wirting with < and when you find what you search press > and the requiered tags would be created.

I hope this helps you.

Make sure the 'Insert attribute value quotes when typing' option is selected in Tools -> Options -> Text Editor -> HTML -> Formatting.

Once selected, your attribute name and quotes will automatically be inserted whenever you type the start of an attribute followed by the = key. Your cursor will be positioned within the quotes so that you can type the value.

Example

Type <a hr and press = .

The attribute name will be completed for you, double quotes will be appended, and your cursor will be positioned within them so that you can start typing the value immediately.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM