Tips, tricks and all the info about Microsoft Visual Studio 2008

Enhanced CSS & HTML Support in Visual Studio 2008

, posted: 13-Mar-2008 09:00

Visual Studio 2008 is equipped with better HTML and CSS support than Visual Studio 2005 and the new features should make anyone who spends a lot of time in design/HTML view a lot happier.

The software now shares the same web designer that comes with the Expression Web product so it gives developers all the goodies that designers have in that package.

Among those new features is the introduction of the split view between design and source, CSS style manager, CSS Properties Grid as well as CSS and JavaScript intellisense in source view.

More on JavaScript intellisense can be found in this article: A happy JavaScript-er with the new features of Visual Studio 2008

HTML Editing Split View
This is one of the features I really like about Visual Studio 2008. In the past I used to find it quite annoying to have to switch between source and design view and even more so when the switching used to break your HTML code.

With the split view introduced this now becomes less of a problem. A great thing about split view is the synchronisation between both views as can be seen in the image below.



Any changes you do in either view is immediately reflected on the other view. In the image above you can see there are some selected text in source view and that same text is shown selected in design view.

Improved CSS Support
Another big change the Visual Studio 2008 Web designer is support for CSS. As mentioned earlier Visual Studio 2008 comes with a CSS Styles Manager and CSS Properties Grid which can be seen below.

CSS Properties Grid
You can think of the CSS properties Grid as the traditional properties window that you use to specify the properties of an ASP.NET web control, so this is basically where you can define the CSS style settings such as font, background and so on. 



If you select a section in design/source view that has a CSS style applied on it the properties window will show you the applied attributes of that style to the selected section as shown below. This is a nice easy way to know which styles are affecting a particular section.



In addition, the properties grid also supports identifying overridden style sheets, so if say you have a div tag with a style applied to it, and inside it there is paragraph tag with another style applied to it, you will be able to identify which style is being applied to a set property and the overridden property will be crossed as shown below.



CSS Style Manager
Another new enhancement with CSS support is the CSS Style Manager; this is the second CSS tab next to the Toolbox tab that can be seen in the first screenshot earlier in the post.



The CSS Style Manager allows you to add existing styles by pointing to an existing CSS file, create new styles or modify existing ones. You can also find all instances where a style is being used as shown in the options below. You can also see a preview of the code of any particular style by hovering over the style name.



If the icon name next to the style has a circle around it this indicates that the style is being used in the current document. The list of visible styles can be modified re-sorted using the options dialog next to the New Style link button as shown in the image below.



CSS Intellisense in Source View
Not only does Visual Studio 2008 have improved style management options but also when you’re editing HTML in source view you’ve got CSS style intellisense that gives you direct access to your CSS classes, etc when editing your HTML as shown below. This feature also works with ASP.NET controls and not just standard HTML.



Another new feature with Visual Studio 2008 is the introduction of nested master pages while this can be an entire post in itself basically the idea is that now you can assign created two master pages and assign one master page as the master page template for the second master page.


Download Visual Studio 2008 90 day trial
For detailed information and to request a free 90-day trial DVD of Visual Studio 2008 Team Suite to be sent out to you, go to the Microsoft Visual Studio webpage.

About the Author
Daniel Wissa is a Web Developer working in Christchurch. He has a B.Com. from the University of Canterbury where he studied Information Systems and Computer Science and is also a MCAD in .NET.

He has been involved with Microsoft and Microsoft communities for many years since being a Student Partner at Canterbury University a few years ago to currently leading the Christchurch .NET user group. He also maintains a blog
http://www.dan.net.nz where he regularly blogs about Microsoft technologies, local user group events and more.



Other related posts:
The New Zealand ALM Conference 2011 (Application Life Cycle Management)
Writing your own Html Helpers for the ASP.NET MVC Framework
Automating Visual Studio 2008






About the Visual Studio 2008 Blog

In the years since the hugely successful release of Visual Studio 2005, Microsoft has used developer feedback from all over the world to introduce over 250 new features in the 2008 release.

This sponsored blog will bring Visual Studio 2008 tips and tricks from well known developers in the Australian and New Zealand tech community directly to you.

Make sure you bookmark this blog or subscribe to our RSS feed.



Other blog posts

The New Zealand ALM Conference...
Writing your own Html Helpers ...
Automating Visual Studio 2008...
Windows Azure Table Storage - ...
Windows Azure Table Storage - ...
XML and XSLT in Visual Studio ...
Introduction to New SQL Server...
Using the Visual Studio 2008 P...
Getting started with Windows A...
Why consider sitting for an MC...


Some recent comments

Praveen M on Visual Studio 2008 support for building SilverLigh: I installed SILVERLIGHT TOOLS for VS2008 at my work. I am able to do silverlight...

zefo on Unit testing with Visual Studio 2008: Just minor recommendation: better use *.png for the screenshots. Jpeg is more su...

gil ziny on Unit testing with Visual Studio 2008: When I associate the unit test with TFS testing policy, if fails during check-in...

lynette on Visual Studio 2008 JavaScript Debugging: i have enable in IE the ability to debug scripts. if i go to my section in my c...

Junkie on Why consider sitting for an MCTS or MCP Certificat: The way you presented the case for certification has been completely different f...

Brian Link on Unit testing with Visual Studio 2008: You seem to be incorrect in one of your opening remarks - it seems that web.conf...

Dipanwaya on Unit testing .Net Compact Framework applications w: Steps Behind the Test in the VS 2008? How to test a module in the VS 2008 Envir...

Ricardo on Visual Studio 2008 support for building SilverLigh: Yes! Found the solution myself :) Reset the environment of Visual Web Developer...

Ricardo on Visual Studio 2008 support for building SilverLigh: Have the same problem after installing Visual Web Developer 2008 SP1 and Silverl...

kjward on Automating Visual Studio 2008: thanks lots for all the great info. i'm sure the answer to my question is in th...



Disclaimer

The Visual Studio 2008 blog is sponsored by Microsoft NZ. The blog posts are the authors' genuine accounts of their experiences with Visual Studio 2008 and are not influenced or filtered by Microsoft NZ in any way.