954,591 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

CSS formatting

It used to be, that when I would type:

#div{

and hit "return", Visual studio would autocorrect to:

#div
{

as well as a number of other things. That is just the easiest example. It also doesn't automatically indent the next line...

I am using Visual Studio 2008 SP1.

I've looked through Tools>Options and nothing really jumped out at me. I'm sure it's just some kind of pebkac error on my part, so any assistance would be greatly appreciated.

J'Tok
Light Poster
39 posts since Jan 2008
Reputation Points: 22
Solved Threads: 0
 

div is a tag. you cant use it as id. remove # sign. ya visual studio automatically formats it so its easier to read. whats your exact problem?

djzia
Newbie Poster
17 posts since Dec 2009
Reputation Points: 8
Solved Threads: 2
 

sorry, that was poorly written it should be "#divid"

Really my problem is just one of ease of use. It used to do that, now it doesn't. It's not really a big deal if not, just so much more convenient.

J'Tok
Light Poster
39 posts since Jan 2008
Reputation Points: 22
Solved Threads: 0
 

This problem resolved itself once I updated VS2010.

J'Tok
Light Poster
39 posts since Jan 2008
Reputation Points: 22
Solved Threads: 0
 
#div{
...
}


If you want to apply a style to all div tags you should use this code instead.

div {
...
}


dots are the styles you want to apply. If you typed the new code VS 2010 should auto format for you as long as there are no other mistakes in the css or other areas.

BrianHelp
Newbie Poster
7 posts since Apr 2010
Reputation Points: 16
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: