473,395 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Excellent CSS debugging technique

I found an excellent technique in "Eric Meyers on CSS" that I thought
some of you might be interested in.

The technique is to use "debugging" styles to quickly see the layout
of a page. For example, if you are trying to see the layout of a
table-based HTML form (to convert to CSS, of cource ;) ), you would
add the style:

table { border : 2px solid blue;}

I have also used this method to find out where browsers are placing my
DIV's and SPAN's. Overall, I thought it was a great idea. Does
anyone else us it regularly?
Jul 20 '05 #1
12 2861


Trent wrote:
I found an excellent technique in "Eric Meyers on CSS" that I thought
some of you might be interested in.

The technique is to use "debugging" styles to quickly see the layout
of a page. For example, if you are trying to see the layout of a
table-based HTML form (to convert to CSS, of cource ;) ), you would
add the style:

table { border : 2px solid blue;}

I have also used this method to find out where browsers are placing my
DIV's and SPAN's. Overall, I thought it was a great idea. Does
anyone else us it regularly?


Well, Mozilla has the DOM inspector which highlights nodes with a red
border.
And Opera 7 has nice debugging style sheets, try
View->Style->User Mode->Show structural elements/debug with outline
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
"Trent" <sp*******@marx7.org> wrote in message
news:22**************************@posting.google.c om...
I found an excellent technique in "Eric Meyers on CSS" that I thought
some of you might be interested in.

The technique is to use "debugging" styles ... .... table { border : 2px solid blue;}

...Does anyone else us it regularly?


Only when I am having a problem with a
layout (i.e. every other day).

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Jul 20 '05 #3
Trent wrote:
I found an excellent technique in "Eric Meyers on CSS" that I thought
some of you might be interested in.

The technique is to use "debugging" styles to quickly see the layout
of a page. For example, if you are trying to see the layout of a
table-based HTML form (to convert to CSS, of cource ;) ), you would
add the style:

table { border : 2px solid blue;}

I have also used this method to find out where browsers are placing my
DIV's and SPAN's. Overall, I thought it was a great idea. Does
anyone else us it regularly?


Yes. There are at least 2 different ways:

1. Put extra features like that into the CSSs while you are developing. (I use
both border & background-color for that). If you keep them blocked together,
you can "comment them out" when they are OK, leaving them there for easy
switch-on later.

2. Use the Web Developer's toolbar that you can add to Mozilla Firebird. It
has a *large* array of such debugging features built in that you can switch on
and off for any pages. It is very "voyeuristic" being able to see at a glance
what tables & headers, etc, *someone else's* web site is using! (Other
browsers have such tools, but this is the best I've found).
http://texturizer.net/firebird/extensions/#webdeveloper

I still often browse the web using IE with a local CSS (set with the
"accessibility" menu), although I use:
table { border: 1px dotted blue; }
It tells me just how many layout-tables exist across the web!

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Jul 20 '05 #4
Trent wrote:
I found an excellent technique in "Eric Meyers on CSS" that I thought
some of you might be interested in.

The technique is to use "debugging" styles to quickly see the layout
of a page. For example, if you are trying to see the layout of a
table-based HTML form (to convert to CSS, of cource ;) ), you would
add the style:

table { border : 2px solid blue;}

I have also used this method to find out where browsers are placing my
DIV's and SPAN's. Overall, I thought it was a great idea. Does
anyone else us it regularly?


I have a user-stylesheet like that. Mostly, my own tables are not that
complex. But tables of pages someone else did tend to use some quite
heavy table layout. Added to what you do above I do something like:

td { border: 1px solid red; }
td td { border: 1px solid green; }
td td td { border: 1px solid yellow; }

etc. you get the idea

--
Google Blogoscoped
http://blog.outer-court.com
Jul 20 '05 #5
Trent wrote:
I found an excellent technique in "Eric Meyers on CSS" that I thought
some of you might be interested in.

The technique is to use "debugging" styles to quickly see the layout
of a page. For example, if you are trying to see the layout of a
table-based HTML form (to convert to CSS, of cource ;) ), you would
add the style:

table { border : 2px solid blue;}


Unlike border, outline does not affect the layout, so that would be the
preferred option. But the whole trick is silly, it's much better to have
the UA apply this (as is possible with Opera).

--
Spartanicus
Jul 20 '05 #6
Spartanicus <me@privacy.net> wrote in message news:<sn********************************@news.spar tanicus.utvinternet.ie>...
But the whole trick is silly, it's much better to have
the UA apply this (as is possible with Opera).


I haven't found a way of getting IE to do it. (Haven't really look,
honestly). I usually have about 3 different browsers open and test
code as I go along, so adding the debugging styles is a quick
across-the-board way of seeing results.
Jul 20 '05 #7
On Mon, 15 Dec 2003, Spartanicus wrote:
table { border : 2px solid blue;}
Unlike border, outline does not affect the layout, so that would be the
preferred option.


It's been my experience (though, hopefully, these problems will go
away with time) that some of the worse browsers actually get better
results when a border is defined. So there can be some advantages in
defining the border as, for example, 2px solid during this stage of
development, even if none is wanted in the finished product, and then
switching it to 2px none, so that it's still there (and stabilising
the presentation in NN4 and such), but becomes invisible.
But the whole trick is silly, it's much better to have
the UA apply this (as is possible with Opera).


With the greatest of respect: if we're trying to get improved results
across many browsers, then we need a construction technique which does
its job on those browsers. If we only wanted CSS to work on browsers
whose implementation meets our minimum demands, then there are
techniques available for hiding the CSS from the rest, and then they'd
just have to make do with their browser's inherent rendering of HTML.
But as long as we're trying to get _some_ kind of sense out of NN4.*
and IE-whatever-version (and WebTV if you're a masochist), we need
design techniquest which work with those. I think the border trick is
useful - I even wrote a page about it, but as I'm only a dabbler in
this, really, I'll defer to Eric Meyers.

Jul 20 '05 #8
Trent wrote:

table { border : 2px solid blue;}

I have also used this method to find out where browsers are placing my
DIV's and SPAN's. Overall, I thought it was a great idea. Does
anyone else us it regularly?


<snobbish voice> I was doing that before I knew what CSS *was*, and I'm
just a dallying novice ;)</snobbish voice>

Jul 20 '05 #9
Alan J. Flavell wrote:
But the whole trick is silly, it's much better to have
the UA apply this (as is possible with Opera).


With the greatest of respect: if we're trying to get improved results
across many browsers, then we need a construction technique which does
its job on those browsers. If we only wanted CSS to work on browsers
whose implementation meets our minimum demands, then there are
techniques available for hiding the CSS from the rest, and then they'd
just have to make do with their browser's inherent rendering of HTML.
But as long as we're trying to get _some_ kind of sense out of NN4.*
and IE-whatever-version (and WebTV if you're a masochist), we need
design techniquest which work with those. I think the border trick is
useful - I even wrote a page about it, but as I'm only a dabbler in
this, really, I'll defer to Eric Meyers.


The proposed usage was as a *debugging technique*, this can be done
using the most advanced UA if you take the limitations of other UA's
into account. As a final step the code can then be ruggedized to work in
less capable clients.

Your assumption that "we" are trying, or even should be trying to get
any CSS to work in NS4 is out of step with reality.

--
Spartanicus
Jul 20 '05 #10
Trent wrote:
Spartanicus <me@privacy.net> wrote in message
news:<sn********************************@news.spar tanicus.utvinternet.ie>...
But the whole trick is silly, it's much better to have
the UA apply this (as is possible with Opera).


I haven't found a way of getting IE to do it. (Haven't really look,
honestly). I usually have about 3 different browsers open and test
code as I go along, so adding the debugging styles is a quick
across-the-board way of seeing results.


You can identify your own CSS in Tools > Internet options > Accessibility.

I often use such a CSS for this sort of diagnostic, eg:
table { border: dotted 1px blue; }
(It works for IE 5 and IE 6, although IE 5 makes the above look solid not
dotted!).

I use both methods, depending on the purpose. Sometimes I want borders or
background colours just for certain features, not all of a type.

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Jul 20 '05 #11
sp*******@marx7.org (Trent) writes:
DIV's and SPAN's. Overall, I thought it was a great idea. Does
anyone else us it regularly?


yes been doing this for some time but didn't know there's a text about
it.

i'm mostly a backend specialist but when i do layout work, i will
sometimes use all sorts of colorization and such to see much more
easily where things get positioned.

i have impaired vision and must do this out of necessity. others
don't need the technique as much i suppose.

a page layout with complex structure can look something like a tossed
salad when i'm in debugging mode!

bye.
--
-------------------------------------------------------------------------------
Jerry Sievers 305 854-3001 (home) WWW ECommerce Consultant
305 321-1144 (mobile http://www.JerrySievers.com/
Jul 20 '05 #12
On 15 Dec 2003 05:29:30 -0800, sp*******@marx7.org (Trent) wrote:
I found an excellent technique in "Eric Meyers on CSS" that I thought
some of you might be interested in.

The technique is to use "debugging" styles to quickly see the layout
of a page. For example, if you are trying to see the layout of a
table-based HTML form (to convert to CSS, of cource ;) ), you would
add the style:

table { border : 2px solid blue;}

I have also used this method to find out where browsers are placing my
DIV's and SPAN's. Overall, I thought it was a great idea. Does
anyone else us it regularly?


This is an excellent book all around. Expensive, but worth it IMO. Also,
the companion Web site is very good. Look for the three pages on a glossary
for the book, choosing a Doctype, and hiding styles from older browsers.

Chris
--
Of course, I got my copy for free -- from the local public library.
Jul 20 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Java script Dude | last post by:
To all Mozilla JS Guru's (IE dudes welcome), I have spent the last three years developing complex DHTML applications that must work in IE 5.5sp2+ but I use Mozilla 1.3+** to do all my...
5
by: phnimx | last post by:
Hi , We have developed a number of plug-in .NET Library Components that we typically deploy with our various applications by installing them into the GAC. Each of the applications contains an...
4
by: yuanliu1 | last post by:
Hi, I am debugging my code of visual c++ 6.0. I found it is extremely slow to run after the code is compiled as "debug" mode and OK as "release mode", I would say the difference is around 10x....
0
by: mandarkraftware | last post by:
Hi All, Let me present you with list of consultants currently available. Name / Job Title Summary Ramchandran/Java · 7+ years experience in the field of Software Development. · Expertise...
1
by: Sachin | last post by:
Hi All, Let me present you with list of consultants currently available. Name / Job Title Summary Ramchandran/Java · 7+ years experience in the field of Software Development. · Expertise...
4
by: John Wilmot | last post by:
I have a service that is set up to use remoting. Is there a way that calls from a web page to this service can be debugged in Visual Studio 2005?
3
by: SteveD | last post by:
Hi guys, http://luaforge.net/frs/?group_id=327 pgdb.zip is an addition to scite-debug, which adds source debugging to the popular SciTE programmer's editor. gdbpy.zip is a standalone version...
6
kenobewan
by: kenobewan | last post by:
Congratulations! You are one of the few who realise that over 80% of errors are simple and easy to fix. It is important to realise this as it can save a lot of time. Time that could be wasted making...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.