troubleshooting Question

How do I completely disable Visual Studio 2005 from writing inline style attributes?

Avatar of alupkaman
alupkamanFlag for China asked on
Microsoft DevelopmentCSS.NET Programming
2 Comments1 Solution1331 ViewsLast Modified:
I use external css style sheets for virtually every style attribute (for a web page). How do I get Visual Studio to completely stop inserting attributes such as style="width:100px"

when I insert a table for example, or work in design view, if I accidentally move anything, VS writes positioning attributes. If I want to insert an inline style, I'll do it myself, but I don't want VS constantly writing width attributes, which override my style sheet for the table, cell, etc. I'm tired of going through every column and removing these because I accidentally bumped something in design view.

I have already tried in Visual Studio, Tools=>Options=>HTML Designer=?CSS Positioning

I have tried unchecking the box completely for positioning attributes. And I have tried checking the box and choosing "no positioning attribute"

This doesn't do anything to solve my problem...does this option even do anything, since the behavior seems to be the same no matter what I check.

So, how do I turn off positioning attributes completely in Visual Studio?? So that if I bump something in design view, such as working with item templates in a form view, there will be no inline styles added?

I can't believe this would even be the default behavior. I understand there are certain situations where inline styles are useful, but 98% of my styles and layouts are defined in the appropriate classes in the external style sheet. So that I can modify everything in one place. It seems counterintuitive to the whole idea of CSS to default to inline styles, since this approach is pretty much the same as the old HTML formatting attributes.

I'm using Visual Studio 2005 Professional Edition.

Kevin Thomas
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros